Single Validator Node Network
It is possible to provision a local "network" consisting of a single validator node. This may be useful for specific development use cases.
Before proceeding, make sure to look at the prerequisites required for running an Oasis Core environment followed by build instructions for the respective environment (non-SGX or SGX). The following sections assume that you have successfully completed the required build steps.
WARNING
These instructions are for a development-only instance, do not use them for setting up any kind of production instances as they are unsafe and will result in insecure configurations leading to node compromise.

Provisioning an Entity

To provision an entity we first prepare an empty directory under /path/to/entity and then initialize the entity:
1
mkdir -p /path/to/entity
2
cd /path/to/entity
3
oasis-node registry entity init --signer.backend file --signer.dir .
Copied!

Provisioning a Node

To provision a node we first prepare an empty directory under /path/to/node and the initialize the node. The node is provisioned as a validator.
1
mkdir -p /path/to/node
2
cd /path/to/node
3
oasis-node registry node init \
4
--signer.backend file \
5
--signer.dir /path/to/entity \
6
--node.consensus_address 127.0.0.1:26656 \
7
--node.is_self_signed \
8
--node.role validator
Copied!
After the node is provisioned we proceed with updating the entity whitelist so that the node will be able to register itself:
1
oasis-node registry entity update \
2
--signer.backend file \
3
--signer.dir /path/to/entity \
4
--entity.node.descriptor /path/to/node/node_genesis.json
Copied!

Creating a Test Genesis Document

To create a test genesis document for your development "network" use the following commands:
1
mkdir -p /path/to/genesis
2
cd /path/to/genesis
3
oasis-node genesis init \
4
--chain.id test \
5
--entity /path/to/entity/entity_genesis.json \
6
--node /path/to/node/node_genesis.json \
7
--debug.dont_blame_oasis \
8
--debug.test_entity \
9
--debug.allow_test_keys \
10
--registry.debug.allow_unroutable_addresses \
11
--staking.token_symbol TEST
Copied!
WARNING
This enables unsafe debug-only flags which must never be used in a production setting as they may result in node compromise.

Running the Node

To run the single validator node, use the following command:
1
oasis-node \
2
--datadir /path/to/node \
3
--genesis.file /path/to/genesis/genesis.json \
4
--worker.registration.entity /path/to/entity/entity.json \
5
--consensus.validator \
6
--debug.dont_blame_oasis \
7
--debug.allow_test_keys \
8
--log.level debug
Copied!
WARNING
This enables unsafe debug-only flags which must never be used in a production setting as they may result in node compromise.

Using the Node CLI

The oasis-node exposes an RPC interface via a UNIX socket located in its data directory (e.g., under /path/to/node/internal.sock). To simplify the following instructions set up an ADDR environment variable pointing to it:
1
export ADDR=unix:/path/to/node/internal.sock
Copied!
This can then be used to execute CLI commands against the running node (in a separate terminal). For example to show all registered entities:
1
oasis-node registry entity list -a $ADDR -v
Copied!
Giving output similar to:
1
{"v":1,"id":"UcxpyD0kSo/5keRqv8pLypM/Mg5S5iULRbt7Uf73vKQ=","nodes":["jo+quvaFYAP4Chyf1PRqCZZObqpDeJCxfBzTyghiXxs="]}
2
{"v":1,"id":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","allow_entity_signed_nodes":true}
Copied!
Or getting a list of all staking accounts:
1
oasis-node stake list -a $ADDR
Copied!
Giving output similar to:
1
oasis1qzzd6khm3acqskpxlk9vd5044cmmcce78y5l6000
2
oasis1qz3xllj0kktskjzlk0qacadgwpfe8v7sy5kztvly
3
oasis1qrh4wqfknrlvv7whjm7mjsjlvka2h35ply289pp2
Copied!
Last modified 1yr ago