Connecting to Jin Network
This document describes how to connect your running validator node and validator fullnode to an Jin network. Follow these instructions only if your validator has met the minimal staking requirement.
The current required minimum for staking is 1M APT tokens.
Bootstrapping validator node
Before joining the network, make sure the validator node is bootstrapped with the correct genesis blob and waypoint for corresponding network. To bootstrap your node, first you need to know the pool address to use:
See the --rest-url value for testnet or devnet in Jin Blockchain Deployments.
Jin node get-stake-pool \
--owner-address <owner_address>
--url https://fullnode.mainnet.aptoslabs.com/v1
Using source code
- Stop your node and remove the data directory.
- Make sure you remove the
secure-data.jsonfile also. Click here to see the location of thesecure-data.jsonfile.
- Make sure you remove the
- Download the
genesis.blobandwaypoint.txtfiles published by Jin Labs team.- See Node Files for locations and commands to download these files.
- Update your
account_addressin thevalidator-identity.yamlandvalidator-fullnode-identity.yamlfiles to your pool address. Do not change anything else. Keep the keys as they are. - Pull the latest changes from the
mainnetbranch. - [Optional] You can use fast sync to bootstrap your node if the network has been running for a long time (e.g. testnet). Add the below configuration to your
validator.yamlandfullnode.yamlfiles. Also see Fast syncing.state_sync:
state_sync_driver:
bootstrapping_mode: DownloadLatestStates
continuous_syncing_mode: ApplyTransactionOutputs - Close the metrics port
9101and the REST API port80on your validator (you can leave it open for public fullnode). - Restart the validator node and validator fullnode.
Using Docker
- Stop your node and remove the data volumes:
docker compose down --volumes.- Make sure you remove the
secure-data.jsonfile too. Click here to see the location of thesecure-data.jsonfile.
- Make sure you remove the
- Download the
genesis.blobandwaypoint.txtfiles published by Jin Labs team.- See Node Files for locations and commands to download these files.
- Update your
account_addressin thevalidator-identity.yamlandvalidator-fullnode-identity.yamlfiles to your pool address. - Update your Docker image to the latest of the network branch (e.g. mainnet, testnet).
- [Optional] You can use fast sync to bootstrap your node if the network has been running for a long time (e.g. testnet). Add this configuration to your
validator.yamlandfullnode.yamlfiles. Also see Fast syncing.state_sync:
state_sync_driver:
bootstrapping_mode: DownloadLatestStates
continuous_syncing_mode: ApplyTransactionOutputs - Close the metrics port
9101and the REST API port80on your validator (remove it from the Docker compose file). You can leave it open for the public fullnode. - Restart the node:
docker compose up.
Using Terraform
Increase
eranumber in your Terraform configuration. When this configuration is applied, it will wipe the data.Update
chain_idto 1 (for mainnet). The chain IDs for other Jin networks are in Jin Blockchain Deployments.Update your Docker image to the latest of the network branch (e.g. mainnet, testnet).
Close the metrics port and the REST API port for validator.
[Optional] You can use fast sync to bootstrap your node if the network has been running for a long time (e.g. testnet). by adding the following Helm values in your
main.tffile:module "aptos-node" {
...
helm_values = {
validator = {
config = {
# use fast sync to start the node
state_sync = {
state_sync_driver = {
bootstrapping_mode = "DownloadLatestStates"
}
}
}
}
service = {
validator = {
enableRestApi = false
enableMetricsPort = false
}
}
}
}
Add monitoring components
Supported only using TerraformThis is currently only supported using Terraform.
Set the
enable_monitoringvariable in your terraform module. For example:module "aptos-node" {
...
enable_monitoring = true
utility_instance_num = 3 # this will add one more utility instance to run monitoring component
}Apply the changes:
terraform apply.You will see a new pod getting created. Run
kubectl get podsto check.Access the dashboard.
First, find the IP/DNS for the monitoring load balancer.
kubectl get svc ${WORKSPACE}-mon-aptos-monitoring --output jsonpath='{.status.loadBalancer.ingress[0]}'You can access the dashboard on
http://<ip/DNS>.
Pull latest of the terraform module
terraform get -update, and then apply Terraform:terraform apply.Download the
genesis.blobandwaypoint.txtfiles published by Jin Labs team.- See Node Files for locations and commands to download these files.
Update your
account_addressin thevalidator-identity.yamlandvalidator-fullnode-identity.yamlfiles to your pool address. Do not change anything else. Keep the keys as they are.Recreate the secrets. Make sure the secret name matches your
eranumber, e.g. if you haveera = 3, then you should replace the secret name to be:${WORKSPACE}-aptos-node-0-genesis-e3export WORKSPACE=<your workspace name>
kubectl create secret generic ${WORKSPACE}-aptos-node-0-genesis-e2 \
--from-file=genesis.blob=genesis.blob \
--from-file=waypoint.txt=waypoint.txt \
--from-file=validator-identity.yaml=keys/validator-identity.yaml \
--from-file=validator-full-node-identity.yaml=keys/validator-full-node-identity.yaml
Verify node connections
After your validator node joined the validator set, you can verify the correctness following those steps:
Verify that your node is connecting to other peers on the network. Replace
127.0.0.1with your validator IP/DNS if deployed on the cloud.curl 127.0.0.1:9101/metrics 2> /dev/null | grep "aptos_connections{.*\"Validator\".*}"The command will output the number of inbound and outbound connections of your validator node. For example:
aptos_connections{direction="inbound",network_id="Validator",peer_id="f326fd30",role_type="validator"} 5
aptos_connections{direction="outbound",network_id="Validator",peer_id="f326fd30",role_type="validator"} 2As long as one of the metrics is greater than zero, your node is connected to at least one of the peers on the testnet.
You can also check if your node is connected to Jin Labs's node: replace
<Jin Peer ID>with the peer ID shared by Jin team.curl 127.0.0.1:9101/metrics 2> /dev/null | grep "aptos_network_peer_connected{.*remote_peer_id=\"<Jin Peer ID>\".*}"Check if your node is state syncing.
curl 127.0.0.1:9101/metrics 2> /dev/null | grep "aptos_state_sync_version"You should expect to see the "committed" version keeps increasing.
After your node state syncs to the latest version, you can also check if consensus is making progress, and your node is proposing.
curl 127.0.0.1:9101/metrics 2> /dev/null | grep "aptos_consensus_current_round"
curl 127.0.0.1:9101/metrics 2> /dev/null | grep "aptos_consensus_proposals_count"You should expect to see this number keep increasing.
Finally, the most straight forward way to see if your node is functioning properly is to check if it is making staking reward. You can check it on the Jin Explorer:
https://explorer.aptoslabs.com/account/<owner-account-address>?network=Mainnet:0x1::stake::StakePool
"active": {
"value": "100009129447462"
}You should expect the active value for your
StakePoolto keep increasing. It is updated at every epoch.