Skip to content

Commit

Permalink
Merge pull request #28 from decentrio/main
Browse files Browse the repository at this point in the history
add key assignment instruction
  • Loading branch information
laloquidity authored Apr 29, 2024
2 parents d8500ee + 8922ed6 commit 15ab4b8
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions chain/onex-mainnet-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,47 @@ The validators also need to set up the `onex-mainnet-1` consumer chain. Here are
```bash
# detail of setup will appear here
cd $HOME/go/bin
wget -O onexd https://github.com/onomyprotocol/onex/releases/download/v1.0.3-onex/onexd && chmod +x onexd
onexd version # v1.0.3-onex
wget -O onexd https://github.com/onomyprotocol/onex/releases/download/v1.1.0/onexd && chmod +x onexd
onexd version # v1.1.0
onexd init <moniker> --chain-id onex-mainnet-1
cd $HOME/.onex/
wget -O config/genesis.json https://raw.githubusercontent.com/onomyprotocol/onex/main/chain/onex-mainnet-1/genesis-without-ccv.json
cd $HOME/.onomy_onex
wget -O config/genesis.json https://raw.githubusercontent.com/onomyprotocol/onex/main/chain/onex-mainnet-1/genesis-with-ccv.json
```

The validators **MUST NOT** run the node but wait until the new genesis is published on the Onomy repository, which will be detailed in step **[3. Vote on the consumer-addition proposal](#5-vote-on-the-consumer-addition-proposal)**.
### 3. Key assignment

### 3. Vote on the consumer-addition proposal
The proposal to launch `onex-mainnet-1` as a consumer chain will be submitted on the Onomy provider mainnet and the validators should participate in voting for the proposal. After the proposal is passed, the validators should wait until the `spawn_time` and replace the old genesis file with the new `genesis-with-ccv.json` file from the Onomy repository.
One important thing the validators are encouraged, but not required to do when a consumer chain is being onboarded, is to assign a key different from the key they use on the provider chain. However, if the validators choose to have different validator keys on consumer chains, they ***MUST*** do key-assignment before the `spawn_time` and only handle on provider chain. Failing to assign key during these times can cause liveliness problems with the consumer chains. If validators have not used key assignment for the consumer node yet, please wait until Onex is live and receiving valset updates from the provider before doing so.

To get current validator key in consumer chains, the validators should run this command:
```bash
wget -O /$HOME/.onex/config/genesis.json https://raw.githubusercontent.com/onomyprotocol/onex/main/chain/onex-mainnet-1/genesis.json
# Run this command to get the validator key, which is encrypted
# in `ed25519` format, not `secp256k1`
onexd tendermint show-validator
> {"@type":"/cosmos.crypto.ed25519.PubKey","key":"abcdDefGh123456789="}
```

### 6. Wait for genesis and run
Assigning different key to the consumer:
```bash
onomyd tx provider assign-consensus-key onex-mainnet-1 <consensus-key-above> --from <signer>
```

To recheck the keys:
```bash
onomyd query provider validator-consumer-key onex-mainnet-1 $(onomyd tendermint show-address)
```

**Note**: If the validators choose not to use different validator keys, the validator keys used in Onomy can be simply copied to the Onex chain config.

```bash
cp .onomy/config/priv_validator_key.json .onomy_onex/config/priv_validator_key.json
```

When the chain is started, valdiators can check if it is ready to sign blocks with:

```bash
onexd query tendermint-validator-set | grep "$(onexd tendermint show-address)"
```
### 4. Wait for genesis and run

At the genesis time, validators can start the consumer chain by running
```bash
Expand Down

0 comments on commit 15ab4b8

Please sign in to comment.