Closed Vishwas1 closed 2 years ago
Following are the steps for setting up a 2 node cluster in EVMOS
> git clone https://github.com/tharsis/evmos.git
> cd evmos
> make install
mkdir ~/multi-node
> evmosd testnet init-files --v 2 --output-dir ~/multi-node
--v
- Number of validator nodes
--output-dir
- Directory to store the nodes related info
multi-node
will looks something like following:├── gentxs
│ ├── node0.json
│ └── node1.json
├── node0
│ └── evmosd
│ ├── config
│ │ ├── app.toml
│ │ ├── config.toml
│ │ ├── genesis.json
│ │ ├── node_key.json
│ │ └── priv_validator_key.json
│ ├── data
│ │ └── priv_validator_state.json
│ └── key_seed.json
└── node1
└── evmosd
├── config
│ ├── app.toml
│ ├── config.toml
│ ├── genesis.json
│ ├── node_key.json
│ └── priv_validator_key.json
├── data
│ └── priv_validator_state.json
└── key_seed.json
We now have to make port changes for some parameters, because at this moment, both nodes have same port configuration for the most params
The following parameters of node1/evmosd/config/app.toml
should have the values set as follows:
address = "tcp://0.0.0.0:2317"
(Under [api]
)address = "0.0.0.0:10090"
(Under [grpc]
)address = "0.0.0.0:9191"
(Under [grpc-web]
)address = "0.0.0.0:8555"
(Under [json-rpc]
)address = "0.0.0.0:8556"
(Under [json-rpc]
)The following parameters of node1/evmosd/config/config.toml
should have the values set as follows:
proxy_app = "tcp://127.0.0.1:36658”
laddr = "tcp://0.0.0.0:36657"
(Under [rpc]
)laddr = "tcp://0.0.0.0:34323"
(Under [p2p]
)persistent_peers = "<node-id>@0.0.0.0:34223"
(Under [p2p]
, leave the <node-id>
as it is and change the IP address to 0.0.0.0
and port to 34223
which is actually the port of node0
's listen address (defined below)The following parameters of node0/evmosd/config/config.toml
should have the values set as follows:
laddr = "tcp://0.0.0.0:34223"
(Under [p2p]
)persistent_peers = "<node-id>@0.0.0.0:34323"
(Under [p2p]
, leave the <node-id>
as it is and change the IP address to 0.0.0.0
and port to 34323
which is actually the port of node1
's listen address (defined above)Save the files and exit
# Node0
> evmosd start --home ~/multi-node/node0/evmosd
# Node1 (In another terminal window)
> evmosd start --home ~/multi-node/node1/evmosd
We will be running a local Evmos testnet with one node, to see the transfer of tokens between two Evmos accounts:
> evmosd testnet start --v 1 --output-dir .
This will start a local Evmos testnet, whose data and config info will be located in the folder named in the format: evmos_<chain-id>-1
. Since, we executed this command from HOME, it will be created there. Note down the <chain-id>
as this will required during the Metamask Network configuration
In the file ~/evmos_<chain_id>-1/node0/evmoscli/key_seed.json
, note the seed phrase as this will be used to import account in Metamask
Open Metamask in expanded view (in a new tab). It is recommended install Metamask in a serperate browser, as this will used for testing purpose.
Click on import using Secret Recovery Phrase
Now enter the seed phrase that we noted from the earlier step above, and set a new password. Click Restore
Now you will have an account with 400 ETH (Evmos tokens) if you switch to [Localhost:8545](http://Localhost:8545)
in Metamask.
We have edit the setting for [Localhost:8545](http://Localhost:8545)
network. Go to Settings > Network > Localhost:8545
. In the Chain ID field, enter the <chain-id>
that we noted earlier. Edit Currency from ETH
to AEVOMS
.
Return to the homepage of Metamask. Create a new account by clicking on Create Account
. And now transfer of tokens from Account 1
to second account is possible.
If we want to run this node at some later time also, create a folder: > mkdir ~/blockchain-node
Copy the node folder ~/evmos_<chain_id>
to > mkdir ~/blockchain-node
. The reason for doing so was that the node folder created was temporary, and will be deleted when the current session ends. In the following section, we will be looking at how we can run it again in a later session.
> cd ~/blockchain-node
. Here, we had already copied the node folder that was created in the above section> evmosd start --home evmos_<chain-id>-1/node0/evmosd
Log of successful transaction taken from Evmos daemon
9:53AM INF executed block height=640 module=state num_invalid_txs=0 num_valid_txs=1 server=node
9:53AM INF commit synced commit=436F6D6D697449447B5B3120323430203139362036352034302032353520313731203433203930203135302033352032352036312032333220313731203230322031333020323037203232342031383120323136203530203139322031383420313237203738203139342031383720313137203131382032322039325D3A3238307D
9:53AM INF committed state app_hash=01F0C44128FFAB2B5A9623193DE8ABCA82CFE0B5D832C0B87F4EC2BB7576165C height=640 module=state num_txs=1 server=node
Evmos Docs: https://evmos.dev/guides/tools/remix.html
Evmos
and Gaia
with the help of startport
The steps to bootstrap through starport for both of them is similar with config port differences as we will see. Let's take Gaia
as an example:
config.yml
which will have the configs to run the Gaiad chain. open the file in an editorversion: 1
accounts:
- name: akash
coins: ["10000000000000uatom", "100000000stake"]
- name: badal
coins: ["50000000000uatom"]
validator:
name: akash
staked: "1000000stake"
host:
rpc: ":26657"
p2p: ":26656"
prof: ":6061"
grpc: ":9095"
grpc-web: ":9093"
api: ":1318"
frontend: ":8081"
dev-ui: ":12346"
faucet:
name: badal
coins: ["100000uatom"]
port: 4500
build:
binary: "gaiad"
init:
home: "home/arnab/.gaia"
genesis:
chain_id: "localcosmos-1"
Here we have defined two accounts to be created Akash
and Badal
, with Badal
being defined as the faucet
config.yml
is defined, run the following command to start the chain:
$ starport chain serve --reset-once -v -c ./config.yml
The above steps are similar for running Evmos
chain as well, with difference being in ports and account names
Both Gaia and Evmos chains were run using the starport
. Below are their config.yml
configuration:
Gaia:
accounts:
- name: akash
coins: ["10000000000000uatom", "100000000stake"]
- name: badal
coins: ["50000000000uatom"]
validator:
name: akash
staked: "1000000stake"
host:
rpc: ":26657"
p2p: ":26656"
prof: ":6061"
grpc: ":9095"
grpc-web: ":9093"
api: ":1318"
frontend: ":8081"
dev-ui: ":12346"
faucet:
name: badal
coins: ["100000uatom"]
port: 4500
build:
binary: "gaiad"
init:
home: "home/arnab/.gaia"
genesis:
chain_id: "localcosmos-1"
Evmos:
accounts:
- name: alice
coins: ["100000000stake", "100000000000000000000aevmos"]
- name: bob
coins: ["5000000000000aevmos"]
validator:
name: alice
staked: "100000000000000000000aevmos"
host:
rpc: ":36657"
p2p: ":36656"
prof: ":7061"
grpc: ":10095"
grpc-web: ":10093"
api: ":2318"
frontend: ":9081"
dev-ui: ":22346"
faucet:
name: bob
coins: ["100000aevmos"]
port: 4501
build:
binary: "evmosd"
init:
home: "$HOME/.evmosd"
app:
evm-rpc:
address: "0.0.0.0:8545" # change the JSON-RPC address and port
ws-address: "0.0.0.0:8546" # change the JSON-RPC websocket address and port
genesis:
chain_id: "evmosd_9000-1"
app_state:
staking:
params:
bond_denom: "aevmos"
mint:
params:
mint_denom: "aevmos"
crisis:
constant_fee:
denom: "aevmos"
gov:
deposit_params:
min_deposit:
- amount: "10000000"
denom: "aevmos"
evm:
params:
evm_denom: "aevmos"
Account badal
from gaiad
, and bob
from evmos
were chosen to be the relayer accounts. So we will focus on them
When both chains were started, the mnemonics of badal
and bob
were noted as follows:
badal
:
[GAIA DAEMON] cosmos16xv7mzk9gffqs28wxq9etdsz083af7jxhzu2xt
[STARPORT] 🙂 Created account "badal" with address "cosmos16xv7mzk9gffqs28wxq9etdsz083af7jxhzu2xt" with mnemonic: "path oak treat put saddle quarter uniform broom aunt text cotton slice hotel mention dwarf prosper prepare buffalo still alone sweet lesson worth gentle"
bob
:
[EVMOS DAEMON] evmos147h9vvlhxxe8nhjgaadraeu93rv9xv36dvfv0v
[STARPORT] 🙂 Created account "bob" with address "evmos147h9vvlhxxe8nhjgaadraeu93rv9xv36dvfv0v" with mnemonic: "scissors crouch hair bacon magnet analyst drip scare palace tragic verify forget have census blame best rabbit buzz hip whale define also october flag"
Now while trying to use the hermes CLI to restore the account addresses through following comand:
$ hermes keys restore --mnemonic <account-mnemonic> <chain-id>
Account address of badal
(Gaia
chain) was imported exactly how its supposed to be. But the account address of bob
(Evmos
chain) was different.
bob
when starting the chain with starport: evmos147h9vvlhxxe8nhjgaadraeu93rv9xv36dvfv0v
bob
after the mnemonic import through hermes CLI: evmos1e5qlekdtkqwud53dtdau9pqxttempkdzxwd8nw
The public key type of Evmos is /ethermint.crypto.v1.ethsecp256k1.PubKey
. It seems that version of Public key type defined in Evmos could be different from what is defined in Hermes.
So, we are putting a halt specific to Evmos IBC transfer for now till the time things are stable
Update on Hermes Relayer:
The issue with hermes relayer described in the above comment was raised on their repo (https://github.com/informalsystems/ibc-rs/issues/1785)
There were two set of responses: 1) Related to new branch that was created as part of the issue 2) Related to existing main branch supporting evmos
The first comment's approach did actually work. Since, the second comment suggests that the main branch of Hermes already supports Evmos and requires some hermis config file changes, which needs to seen later