Sync Node Using State Sync
The State Sync is a way to quickly bootstrap a full Oasis node (either a validator node or a non-validator node) by using Tendermint's Light Client protocol. It allows one to initialize a node from a trusted height, its corresponding block's header and a trusted validator set (given in the genesis document). It does so by securely updating the node's trusted state by requesting and verifying a minimal set of data from the network's full nodes.
If you have access to an Oasis Node that is synced with the latest height, another option to speed bootstraping a new Oasis Node is to copy state from one node to the other.
Tendermint's Light Client protocol requires at least 1 full node to be correct to be able to detect and submit evidence for a light client attack.
To configure your node to use the state sync, amend your node's configuration (i.e. config.yml) with:
1
... trimmed ...
2
3
# Consensus.
4
consensus:
5
6
... trimmed ...
7
8
# Tendermint backend configuration.
9
tendermint:
10
11
... trimmed ...
12
13
# Enable consensus state sync (i.e. Tendermint light client sync).
14
state_sync:
15
enabled: true
16
trust_height: {{ trusted_height }}
17
trust_hash: "{{ trusted_height_hash }}"
18
# List of consensus nodes to use for syncing.
19
consensus_node:
20
- "{{ node1_grpc_endpoint }}"
21
- "{{ node2_grpc_endpoint }}"
22
23
.. trimmed ...
24
25
- "{{ noden_grpc_endpoint }}"
26
Copied!
and replace the following variables in the configuration snippet:
  • {{ trusted_height }}: Trusted height defines the height at which your node should trust the chain.
  • {{ trusted_height_hash }}: Trusted height hash defines the hash of the block header corresponding to the trusted height.
  • {{ node1_grpc_endpoint }}, {{ node2_grpc_endpoint }} , ...,
    {{ noden_grpc_endpoint }}: Addresses of a Oasis Nodes' publicly exposed gRPC endpoints of the form: [email protected]:9001.
You need to provide publicly exposed gRPC endpoints for at least 2 different consensus nodes for the state sync to work.
You need to delete any existing node state (if it exists), otherwise state sync will be skipped. To do that, follow the Wiping Node State instructions.
If existing node state is found and state sync is skipped, you will see something like the following in your node's logs:
1
{"caller":"full.go:1233","level":"info","module":"tendermint","msg":"state sync enabled","ts":"2021-06-21T14:40:55.033642763Z"}
2
{"caller":"node.go:692","level":"info","module":"tendermint:base","msg":"Found local state with non-zero height, skipping state sync","ts":"2021-06-21T14:40:55.838955955Z"}
Copied!

Obtaining Trusted Height and Hash

To obtain the trusted height and the corresponding block header's hash, use one of the following options.

Block Explorers

Browse to one of our block explorers (e.g. OASIS SCAN, Oasis Monitor) and obtain the trusted height and hash there:
  1. 1.
    Obtain the current block height from the main page, e.g. 4819139.
  2. 2.
    Click on block height's number to view the block's details and obtain its hash, e.g. 377520acaf7b8011b95686b548504a973aa414abba2db070b6a85725dec7bd21.

A Trusted Node

If you have an existing node that you trust, you can use its status output to retrieve the current block height and hash by running:
1
oasis-node control status -a unix:/srv/oasis/node/internal.sock
Copied!
replacing /srv/oasis/node/internal.sock with the path to your node's internal UNIX socket.
This will give you output like the following (non-relevant fields omitted):
1
{
2
"software_version": "21.3.1",
3
"identity": {
4
...
5
},
6
"consensus": {
7
...
8
"latest_height": 6388075,
9
"latest_hash": "d9f57b806917b6d3131925f7c987a785ea90f62b3a6987aedd1abdc371d84403",
10
"latest_time": "2021-10-19T12:01:55+02:00",
11
"latest_epoch": 10636,
12
...
13
},
14
...
15
}
Copied!
The values you need are latest_height and latest_hash .

Public Rosetta Gateway

Query our public Rosetta Gateway instance and obtain the trusted height and hash there:
  1. 1.
    TODO.

Oasis Node's gRPC Endpoint

Query our public Oasis Node's gRPC endpoint and obtain the trusted height and hash there:
  1. 1.
    TODO.

Obtaining Addresses of Oasis Nodes' Publicly Exposed gRPC Endpoints

To find the addresses of Oasis Node's publicly exposed gRPC endpoints, use one of the following options.

List Registered Nodes' Descriptors via Oasis CLI from the Local Oasis Node

Run the following:
1
oasis-node registry node list -v -a unix:/srv/oasis/node/internal.sock | jq
Copied!
replacing /srv/oasis/node/internal.sock with the path to your node's internal UNIX socket.
The publicly exposed gRPC endpoint addresses are found under the node descriptor's tls.addresses key.
For example, if a node has the following descriptor:
1
{
2
"v": 1,
3
"id": "+8Deo8sLL/YsP6IonNRsbmO1YonQuoAUYLjVQxZTgP8=",
4
"entity_id": "kupW3Pt0XMeERSkdDWyZMU4oZrk0wGysVXVyqX3rylc=",
5
"expiration": 8032,
6
"tls": {
7
"pub_key": "xqDPSoR2Pq7bJOhHG9ZlDpVKH9JKiVotVmOJHaLPR6g=",
8
"next_pub_key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
9
"addresses": [
11
]
12
},
13
"p2p": {
14
"id": "EE9EMKdzE6/1h8HPre1FKdeqYyRpUskNz28lsf0u/iM=",
15
"addresses": [
16
"217.160.95.75:9200"
17
]
18
},
19
"consensus": {
20
"id": "65SvYJ2OBwKr7cE+4tgKFvYqKI4jQIbPfnqah+cog+c=",
21
"addresses": null
22
},
23
"beacon": {
24
"point": "BKWYECVavUZd0+kG0ngi0McLhAivtt7jmDrG1LtPmIFQvxRTYUueMWUEqvMQL7CAdiQb6SaxgM2NU3HdypJhWhM="
25
},
26
"runtimes": [
27
{
28
"id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wQ=",
29
"version": {
30
"minor": 3
31
},
32
"capabilities": {},
33
"extra_info": null
34
}
35
],
36
"roles": "validator,consensus-rpc"
37
}
Copied!
Then its publicly exposed gRPC endpoint address is:
Copied!
Last modified 1mo ago