How to connect NEAR Rainbow Bridge with my own Ethereum infra?

184 Views Asked by At

I'm trying to understand what parts of config I need to modify.

{
        "nearNetworkId": "testnet",
        "nearNodeUrl": "https://rpc.testnet.near.org/",
        "ethNodeUrl": "https://rinkeby.infura.io/v3/<project_id>",
        "nearMasterAccount": "<near_token_holder_account>",
        "nearMasterSk": "<near_token_holder_sk>",
        "nearClientAccount": "ethonnearclient10",
        "nearProverAccount": "ethonnearprover10",
        "nearClientTrustedSigner": "eth2nearrelay10.testnet",
        "ethMasterSk": "<eth_token_holder_sk>",
        "ethEd25519Address": "0x9003342d15B21b4C42e1702447fE2f39FfAF55C2",
        "ethClientAddress": "0xF721c979db97413AA9D0F91ad531FaBF769bb09C",
        "ethProverAddress": "0xc5D62d66B8650E6242D9936c7e50E959BA0F9E37",
        "ethErc20Address": "0x8151a8F90267bFf183E06921841C5dE774499388",
        "ethLockerAddress": "0x5f7Cc23F90b5264a083dcB3b171c7111Dc32dD00",
        "nearFunTokenAccount": "mintablefuntoken11"
}

I have my own infura for rinkeby I have my own erc20 token on rinkeby

What is nearMasterAccount? Where can I get nearMasterSk? What is ethMasterSk?

In following command:

rainbow transfer-eth-erc20-to-near --amount 10 --eth-sender-sk <eth_token_holder_address> --near-receiver-account <near_token_holder_account>

eth_token_holder_address is it my own eth address? --eth-sender-sk - looks like it should be my eth private key. Is this true?

1

There are 1 best solutions below

0
On

eth_token_holder_address is it my own eth address? --eth-sender-sk - looks like it should be my eth private key. Is this true?

Yes, this is true.

This command will send ERC20 tokens from a given Rinkeby Ethereum account to a given NEAR Testnet account. The other values you are looking for are also related to these two accounts:

"nearMasterAccount": "<near_token_holder_account>",
"nearMasterSk": "<near_token_holder_sk>",
"ethMasterSk": "<eth_token_holder_sk>",

Here's how to find this info.

For Ethereum

  1. Install MetaMask
  2. Switch to the Rinkeby network in the MetaMask UI
  3. Generate a new account (public/private keypair) which you only intend to use with Rinkeby (you'll be able to use your mainnet accounts, but you wouldn't want to accidentally leak a mainnet private key, so be careful!)
  4. Switch to this new account in the MetaMask UI. Click on the account name to copy it to clipboard. This is your eth_token_holder_address
  5. In the current MetaMask UI, once I've selected an account, I can click a triple dot icon (•••) near the top right, click "Account Details", and then there's an "export private key" option. This is your eth_token_holder_sk

For NEAR

  1. Create an account at wallet.testnet.near.org – remember the account name you use, this is your near_token_holder_account
  2. Open up your terminal, and install near-cli
  3. Run near login. This will open wallet.testnet.near.org and allow you to select which account you'd like to authorize in near-cli. Select the account you created above.
  4. The above command added a Full Access key to your account, and saved its private key to your local filesystem. You can find it by looking in your home directory, ~, in a folder called .near-credentials. For me, the full path to this file is ~/.near-credentials/default/chadoh.json. Open this file, copy the private key. This is your near_token_holder_sk