Skip to content

Instantly share code, notes, and snippets.

@Bambarello
Forked from valentinbud/README.md
Last active November 26, 2021 17:58
Show Gist options
  • Save Bambarello/4dce9786be2f7fa9b462fa77b15e122f to your computer and use it in GitHub Desktop.
Save Bambarello/4dce9786be2f7fa9b462fa77b15e122f to your computer and use it in GitHub Desktop.
oasis network state sync
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:
- "[email protected]:26656"
metrics:
address: 0.0.0.0:3000
mode: pull

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: 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
- "[email protected]:9100"
- "[email protected]:9100"
- "[email protected]:9100"
p2p:
seed:
- "[email protected]: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