Installation
Chain ID: initiation-1 | Latest Version Tag: v0.2.14 |
Setup validator name
MONIKER="YOUR_MONIKER_GOES_HERE"
Install dependencies
Update system and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.9.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Download and build binaries
# Clone project repository
cd $HOME
rm -rf initia
git clone https://github.com/initia-labs/initia
cd initia
git checkout v0.2.14
# Build and install binaries
make install
# Create service
sudo tee /etc/systemd/system/initiad.service > /dev/null <<EOF
[Unit]
Description=initiad
After=network-online.target
[Service]
User=$USER
ExecStart=$(which initiad) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Initialize the node
# Set node configuration
initiad config chain-id initiation-1
initiad config keyring-backend file
# Initialize the node
initiad init $MONIKER --chain-id initiation-1
# Download genesis and addrbook
curl -Ls https://github.com/dvjromashkin/guides/raw/main/initia/genesis.json > $HOME/.initia/config/genesis.json
curl -Ls https://github.com/dvjromashkin/guides/raw/main/initia/addrbook.json > $HOME/.initia/config/addrbook.json
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.025uinit\"|" $HOME/.initia/config/app.toml
# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.initia/config/app.toml
Start service and check the logs
sudo systemctl start initiad && sudo journalctl -u initiad -f -o cat
Set up validator
Official documentation: https://docs.initia.xyz/run-initia-node/running-initia-node/becoming-a-validator
Create a wallet
First of all we will need to create wallet for our validator. You have two options for that.
OPTION 1 - CREATE NEW WALLET
initiad keys add wallet
OPTION 2 - RECOVER EXISTING WALLET
initiad keys add wallet --recover
To list your wallets use command below
initiad keys list
Fund a wallet
To create validator you have to fund the previously created wallet using https://faucet.testnet.initia.xyz/
To check wallet balance use command below
initiad q bank balances $(initiad keys show wallet -a)
Create validator
initiad tx mstaking create-validator \
--amount 1000000uinit \
--pubkey $(initiad tendermint show-validator) \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id initiation-1 \
--commission-rate 0.05 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.05 \
--from wallet \
--fees 5000uinit \
-y
Save the ~/.initia/config/priv_validator_key.json file as this is the only way to recover your validator signing key in case you lose it!
Set up Oracle
This guide is only for validator nodes
Official documentation: (https://docs.initia.xyz/run-initia-node/running-initia-node/oracle)[https://docs.initia.xyz/run-initia-node/running-initia-node/oracle]
The Slinky Oracle consists of two main elements:
An on-chain component that retrieves price data from the sidecar with each block, forwards these prices to the blockchain through vote extensions, and compiles prices from all validators involved.
A sidecar process dedicated to polling price information from various providers and delivering this data to the on-chain component.
Step 1: Clone the Repository and build binaries
# Clone repository
cd $HOME
rm -rf slinky
git clone https://github.com/skip-mev/slinky.git
cd slinky
git checkout v0.4.3
# Build binaries
make build
# Move binary to local bin
mv build/slinky /usr/local/bin/
rm -rf build
Step 2: Run oracle
CREATE SYSTEMD SERVICE
sudo tee /etc/systemd/system/slinky.service > /dev/null <<EOF
[Unit]
Description=Initia Slinky Oracle
After=network-online.target
[Service]
User=$USER
ExecStart=$(which slinky) --oracle-config-path $HOME/slinky/config/core/oracle.json --market-map-endpoint 127.0.0.1:17990
Restart=on-failure
RestartSec=30
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
ENABLE AND START SYSTEMD SERVICE
sudo systemctl daemon-reload
sudo systemctl enable slinky.service
sudo systemctl start slinky.service
Step 3: Validating Prices
Upon launching the oracle, you should observe successful price retrieval from the provider sources. Additionally, you have the option to execute the test client script available in the Slinky repository by using the command:
make run-oracle-client
Step 4: Enable Oracle Vote Extension
In order to utilize the Slinky oracle data in the Initia node, the Oracle setting should be enabled in the config/app.toml file.
###############################################################################
### Oracle ###
###############################################################################
[oracle]
# Enabled indicates whether the oracle is enabled.
enabled = "true"
# Oracle Address is the URL of the out of process oracle sidecar. This is used to
# connect to the oracle sidecar when the application boots up. Note that the address
# can be modified at any point, but will only take effect after the application is
# restarted. This can be the address of an oracle container running on the same
# machine or a remote machine.
oracle_address = "127.0.0.1:8080"
# Client Timeout is the time that the client is willing to wait for responses from
# the oracle before timing out.
client_timeout = "500ms"
# MetricsEnabled determines whether oracle metrics are enabled. Specifically
# this enables instrumentation of the oracle client and the interaction between
# the oracle and the app.
metrics_enabled = "false"
Step 5: Check the systemd logs
To check service logs use command below:
journalctl -fu slinky --no-hostname
Successfull Log examples:
{"level":"info","ts":"2024-05-20T15:13:17.811Z","caller":"oracle/oracle.go:163","msg":"oracle updated prices","pid":2065974,"process":"oracle","last_sync":"2024-05-20T15:13:17.811Z","num_prices":65}
{"level":"info","ts":"2024-05-20T15:13:18.061Z","caller":"oracle/oracle.go:163","msg":"oracle updated prices","pid":2065974,"process":"oracle","last_sync":"2024-05-20T15:13:18.061Z","num_prices":65}
{"level":"info","ts":"2024-05-20T15:13:18.313Z","caller":"oracle/oracle.go:163","msg":"oracle updated prices","pid":2065974,"process":"oracle","last_sync":"2024-05-20T15:13:18.313Z","num_prices":65}
{"level":"info","ts":"2024-05-20T15:13:18.555Z","caller":"marketmap/fetcher.go:116","msg":"successfully fetched market map data from module; checking if market map has changed","pid":2065974,"process":"provider_orchestrator"}