Skip to content

Instantly share code, notes, and snippets.

@valentinbud
Last active October 24, 2021 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save valentinbud/0b514e9920470a920cebb23139903f12 to your computer and use it in GitHub Desktop.
Save valentinbud/0b514e9920470a920cebb23139903f12 to your computer and use it in GitHub Desktop.
oasis network state sync

The consensusrpc node

On localhost initiliaze the node with

ENTITY_DIR=/localhostdir/entity
ENTITY_ID=`cat $ENTITY_DIR/entity.json | jq -r .id`

mkdir -p /localhostdir/node-consensusrpc
cd /localhostdir/node-consensusrpc

oasis-node registry node init \
    --node.entity_id $ENTITY_ID

Add the new node to the entity. Your entity might contain a lot more nodes. Include each of them with --entity.node.descriptor.

ENTITY_DIR=/localhostdir/entity

oasis-node registry entity update \
    --signer.backend file \
    --signer.dir $ENTITY_DIR \
    --entity.node.descriptor /localhostdir/node-validator/node_genesis.json \
    --entity.node.descriptor /localhostdir/node-consensusrpc/node_genesis.json

Copy the nodes *.pem files to the server using scp, rsync, etc.

On localhost issue an entity register transaction

GENESIS_FILE_PATH=/localhostdir/genesis.json
ENTITY_DIR=/localhostdir/entity
OUTPUT_REGISTER_TX_FILE_PATH=/localhostdir/gen-register.tx

oasis-node registry entity gen_register 
    --genesis.file $GENESIS_FILE_PATH \
    --signer.backend file \
    --signer.dir $ENTITY_DIR \
    --transaction.file $OUTPUT_REGISTER_TX_FILE_PATH \
    --transaction.fee.gas 5600 \
    --transaction.fee.amount 1000 \
    --transaction.nonce 8 # change with your corespoding nonce from the wallet

Copy the transaction to an Oasis running node and submit it to the network

oasis-node consensus submit_tx \
    --transaction.file /node/gen-register.tx -a unix:/mnt/node/data/internal.sock

Afterwards the consensusrpc node should register to the network. From the node that can be checked with.

oasis-node control status -a unix:/node/data/internal.sock | grep last_registration

Check if the new node is present in the registry

oasis-node registry node list -v -a unix:/node/data/internal.sock | grep <NODE IP ADDRESS>
datadir: /node/data
log:
level:
default: warn
tendermint: warn
tendermint/context: error
format: JSON
genesis:
file: /node/etc/genesis.json
worker:
registration:
entity: /node/entity/entity.json
consensusrpc:
enabled: true
consensus:
tendermint:
core:
listen_address: tcp://0.0.0.0:26656
# Make sure you substitute <NODE IP ADDRESS> with
# the actual IP Address of your node
external_address: tcp://<NODE IP ADDRESS>:26656
p2p:
seed:
- "E27F6B7A350B4CC2B48A6CBE94B0A02B0DCB0BF3@35.199.49.168:26656"
metrics:
address: 0.0.0.0:3000
mode: pull
datadir: /node/data
log:
level:
default: debug
tendermint: warn
tendermint/context: error
format: JSON
genesis:
file: /node/etc/genesis.json
worker:
registration:
entity: /node/entity/entity.json
consensus:
validator: true
tendermint:
core:
listen_address: tcp://0.0.0.0:26656
# Make sure you substitute <NODE IP ADDRESS> with
# the actual IP Address of your node
external_address: tcp://<NODE IP ADDRESS>:26656
state_sync:
enabled: true
# The trust hash is taken from https://www.oasisscan.com/blocks/4986713
trust_hash: 04591dc989c84f016a7f0c9dab54b20e9c92602ab5a94f6b6b2d727c734c230a
trust_height: 4986713
consensus_node:
# The following are the three consensusrpc nodes from mainnet
- "jRTuzzh5an8kVouUrJjHj+5NgDyngEwfVIQJXALlN3I=@194.233.73.154:9100"
- "fgo5K2nTD4wPGc3gVbe1P9yUgkzSRmiTUuBMZGfP3d4=@209.126.6.224:9100"
- "rKqwuyDLfa7WNa09u8JQRcPL700WdKcS4BPlg4nDWD0=@135.181.98.191:9100"
p2p:
seed:
- "E27F6B7A350B4CC2B48A6CBE94B0A02B0DCB0BF3@35.199.49.168:26656"
metrics:
address: 0.0.0.0:3000
mode: pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment