# update the local package list and install any available upgradessudoapt-getupdate&&sudoaptupgrade-y# install toolchain and ensure accurate time synchronizationsudoapt-getinstallmakebuild-essentialgccgitjqchrony-y
# find location of existing GO (if any)whichgogoversion# remove old GO if existingsudorm-rf/usr/local/go# install updated GOwgethttps://golang.org/dl/go1.20.3.linux-amd64.tar.gzsudotar-C/usr/local-xzfgo1.20.3.linux-amd64.tar.gzrm-rfgo1.20.3.linux-amd64.tar.gz
Unless you want to configure in a non standard way, then set these in the .zshrc in the user's home (i.e. ~/) folder.
nano~/.zshrc
Add the "export Pathing" rules at the bottom, and then save the file:
To confirm that the installation has succeeded, you can run:
secretdversion--long
Configuration of Shell Variables
For this guide, we will be using shell variables. This will enable the use of the client commands verbatim. It is important to remember that shell commands are only valid for the current shell session, and if the shell session is closed, the shell variables will need to be re-defined.
If you want variables to persist for multiple sessions, then set them explicitly in your shell .profile, as you did for the Go environment variables.
To clear a variable binding, use unset $VARIABLE_NAME. Shell variables should be named with ALL CAPS.
CHAIN_ID="secret-4"
MONIKER_NAME=<moniker-name>
Setting Up the Node
These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.
Initialize the chain
Please replace YOUR_MONIKER with your own moniker.
secretd init YOUR_MONIKER --chain-id CHAIN_ID
This will generate the following files in ~/.osmosis/config/
We'll use a powerful tool called sed for this process. sed is a stream editor that can perform operations, like substitutions, on a text file.
We will specifically focus on updating the ports to use a standardized prefix for your chain. This ensures consistency and improves overall system organization. It will also allow you to run multiple chains on a single server.
Let's start by understanding what we're updating:
proxy_app: This is the address used for inter-process communication between the ABCI application and the consensus engine.
laddr: This is the address that your node listens on for incoming connections.
pprof_laddr: This is the address for the profiling server to listen on.
prometheus_listen_addr: This is the address for the Prometheus metrics server to listen on.
address: These are various addresses that your node may use to listen for different types of connections.
Set Your Chain and Port Prefix
Your chain in this case is Secret Network. For Secret Network, we want to set the port prefix as 171. The port prefix will be used to replace the first 2 or 3 digits of the original ports.
# Set the prefix export PREFIX=171
Update config.toml
Next, we will update the config.toml file. For 5-digit ports, the first 3 digits will be replaced. Here is how to calculate the new port values and update the config.toml file:
Either create a new key pair or restore an existing wallet for your validator:
# Create new keypairsecretdkeysaddYOURKEY# Restore existing juno wallet with mnemonic seed phrase.# You will be prompted to enter mnemonic seed.secretdkeysaddYOURKEY--recover# Query the keystore for your public addresssecretdkeysshowYOURKEY-a
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
The above transaction is just an example. There are many more flags that can be set to customize your validator, such as your validator website, or keybase.io id, etc. To see a full list:
secretdtxstakingcreate-validator--help
Backup critical files
There are certain files that you need to back up to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.secretd/config/:
priv_validator_key.json
node_key.json
It is recommended that you encrypt and backup of these files.