This document details how to join the Secret Network secret-4
mainnet as a full node. Once your full node is running and synced to the last block, you can use it
{% hint style="danger" %} Secret Network has strict Hardware Requirements, see hardware-compliance.md. If your machine does not meet them, it will *NOT* work as a node. {% endhint %}
- Ubuntu/Debian host, recommended is Ubuntu 20.04 LTS or 22.04 LTS.
- A public IP address, so that other nodes can connect to you.
- Open ports
TCP 26656 & 26657
Note: If you're behind a router or firewall then you'll need to port forward on the network device. - Reading Tendermint: Running in production
- RPC address of an already active node. You can use any node that exposes RPC services, please see mainnet-secret-4.md.
{% hint style="danger" %} This guide assumes you've already installed the latest version of secretd and SGX. {% endhint %}
For more information on how to install SGX, see instructions here.
If you need help with installing secretd, please take a look at install-secretd.md.
Choose a moniker for yourself, and replace <MONIKER>
with whatever name you like (could be some random string, or just how you like to name to node) below. This moniker is your public nickname of the node in the network.
secretd init <MONIKER> --chain-id secret-4
This will generate the following files in ~/.secretd/config/
genesis.json
node_key.json
priv_validator_key.json
wget -O ~/.secretd/config/genesis.json "https://github.com/scrtlabs/SecretNetwork/releases/download/v1.2.0/genesis.json"
# verify genesis.json checksum
echo "759e1b6761c14fb448bf4b515ca297ab382855b20bae2af88a7bdd82eb1f44b9 $HOME/.secretd/config/genesis.json" | sha256sum --check
Initialize /opt/secret/.sgx_secrets
:
mkdir -p /opt/secret/.sgx_secrets
You can choose between two methods, automatic or manual:
{% hint style="danger" %} WARNING: This method is experimental, and may not work. If it doesn't work, skip to manual registration. {% endhint %}
The following commands will create the necessary environment variables and attempt to automatically register the node.
export SCRT_ENCLAVE_DIR=/usr/lib
export SCRT_SGX_STORAGE=/opt/secret/.sgx_secrets
secretd auto-register
If this step was successful, you can skip straight to Optimization.
secretd init-enclave
The attestation certificate should have been created by the previous step
ls -lh /opt/secret/.sgx_secrets/attestation_combined.bin
Verify the certificate is valid. A 64-character registration key will be printed if it was successful.
PUBLIC_KEY=$(secretd dump /opt/secret/.sgx_secrets/pubkey.bin)
echo $PUBLIC_KEY
{% hint style="danger" %} If registration was NOT succesfull consider checking out the Registration troubleshoot help or contact a fellow validator on our discord. {% endhint %}
{% hint style="info" %}
The following steps should use secretd
be ran on the full node itself. To run the steps with secretd
on a local machine, set up the CLI there.
{% endhint %}
Configure secretd
. Initially you'll be using the bootstrap node, as you'll need to connect to a running node and your own node is not running yet.
secretd config set client chain-id secret-4
secretd config set client node https://rpc.mainnet.secretsaturn.net
secretd config set client output json
If you already have a wallet funded with SCRT
, you can import the wallet by doing the following:
secretd keys add <key-alias> --recover
Otherwise, you will need to set up a key. Make sure you back up the mnemonic and the keyring password.
secretd keys add <key-alias>
This will output your address, a 45 character-string starting with secret1...
.
- Register your node on-chain
secretd tx register auth /opt/secret/.sgx_secrets/attestation_combined.bin -y --gas 700000 --from <key-alias>
2. Pull & check your node's encrypted seed from the network
SEED=$(secretd query register seed $PUBLIC_KEY | cut -c 3-)
echo $SEED
3. Get additional network parameters
These are necessary to configure the node before it starts.
secretd query register secret-network-params
ls -lh ./io-master-key.txt ./node-master-key.txt
{% hint style="info" %} From here on, commands must be ran on the full node. {% endhint %}
mkdir -p ~/.secretd/.node
secretd configure-secret node-master-key.txt $SEED
In order to be able to handle NFT minting and other Secret Contract-heavy operations, it's recommended to update your SGX memory enclave cache:
sed -i.bak -e "s/^contract-memory-enclave-cache-size *=.*/contract-memory-enclave-cache-size = \"15\"/" ~/.secretd/config/app.toml
Also checkout this document by block pane
for fine tuning your machine for better uptime.
We recommend 0.1uscrt
per gas unit:
perl -i -pe 's/^minimum-gas-prices = .+?$/minimum-gas-prices = "0.1uscrt"/' ~/.secretd/config/app.toml
Your node will not accept transactions that specify --fees
lower than the minimun-gas-price
you set here.
IAVL fast node must be disabled, otherwise the daemon will attempt to upgrade the database whil state sync is occuring.
sed -i.bak -e "s/^iavl-disable-fastnode *=.*/iavl-disable-fastnode = true/" $HOME/.secretd/config/app.toml
{% hint style="info" %}
Note that the secret-node
system file is created when installing sgx.
{% endhint %}
sudo systemctl enable secret-node
You are now a now ready to finally sync the full node. 🎉.
Go to state-sync.md or snapshot.md to continue.
To sync to head quickly, please see snapshot.md.
You can skip syncing from scratch or download a snapshot by state-sync.md to the current block.
secretd tendermint show-node-id
And publish yourself as a node with this ID:
<your-node-id>@<your-public-ip>:26656
Be sure to point your CLI to your running node instead of the bootstrap node
secretcli config node tcp://localhost:26657
If someone wants to add you as a peer, have them add the above address to their persistent_peers in their ~/.secretd/config/config.toml.
And if someone wants to use your node from their secretcli then have them run:
secretcli config set client chain-id secret-4
secretcli config set client output json
secretcli config set client indent true
secretcli config set client node tcp://<your-public-ip>:26657
To turn your full node into a validator, see Joining Mainnet as a Validator.