Installation
Install Dependencies:
sudo apt update && sudo apt upgarade -y
sudo apt-get install git curl build-essential make jq gcc snapd chrony lz4 tmux unzip make bc -y
Install GO: (amd64 - x86)
rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.22.4.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.bash_profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.bash_profile
go version
Set variables:
echo "export KIICHAIN_PORT="36"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Install binary:
cd $HOME
rm -rf kiichain
git clone https://github.com/KiiChain/kiichain
cd $HOME/kiichain
git checkout v3.0.0
make install
Init Daodiseo Chain:
kiichaind init Node39-Guide --chain-id=ithaca-1
Custom ports:
sed -i.bak -e "s%:1317%:${KIICHAIN_PORT}317%g;
s%:8080%:${KIICHAIN_PORT}080%g;
s%:9090%:${KIICHAIN_PORT}090%g;
s%:9091%:${KIICHAIN_PORT}091%g;
s%:8545%:${KIICHAIN_PORT}545%g;
s%:8546%:${KIICHAIN_PORT}546%g;
s%:6065%:${KIICHAIN_PORT}065%g" $HOME/.kiichain/config/app.toml
sed -i.bak -e "s%:26658%:${KIICHAIN_PORT}658%g;
s%:26657%:${KIICHAIN_PORT}657%g;
s%:6060%:${KIICHAIN_PORT}060%g;
s%:26656%:${KIICHAIN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${KIICHAIN_PORT}656\"%;
s%:26660%:${KIICHAIN_PORT}660%g" $HOME/.kiichain/config/config.toml
Set min gas:
sed -i -e 's|^minimum-gas-prices *=.*|minimum-gas-prices = "1000000000akii"|' $HOME/.kiichain/config/app.toml
Set indexer:
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.kiichain/config/config.toml
Pruning:
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.kiichain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.kiichain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.kiichain/config/app.toml
Download Genesis & addressbook:
curl -Ls https://file3.node39.top/Testnet/Kiichain/genesis.json > $HOME/.kiichain/config/genesis.json
curl -Ls https://file3.node39.top/Testnet/Kiichain/addrbook.json > $HOME/.kiichain/config/addrbook.json
Peers:
peers="89137ae052578557a6062557cc8c6cce6b08ab13@kiichain-testnet-peers.node39.top:62656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.kiichain/config/config.toml
Create Service:
sudo tee /etc/systemd/system/kiichaind.service > /dev/null <<EOF
[Unit]
Description=Kiichain Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which kiichaind) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable kiichaind
Download snapshot: Here.
Check sync:
(False -> Done)
kiichaind status 2>&1 | jq .SyncInfo
Install Oracle Price Feeder
cd $HOME
rm -rf price-feeder
git clone https://github.com/KiiChain/price-feeder
cd price-feeder
git checkout v1.3.3
make install
mv $HOME/go/bin/price-feeder $HOME/go/bin/kiichaind-oracle
Create wallet
kiichaind keys add price-feeder-delegate
- You should faucet into the "Oracle" wallet before proceeding with the next steps.
Set Feeder
kiichaind tx oracle set-feeder <price-feeder-delegate-address> --from wallet --fees 10000000000000000akii -b block -y --chain-id oro_1336-1
Create config.toml file
- Edit:
address = "kii.." validator = "kiivaloper..." backend = "test|os|file" dir = "<folder|user>/.kiichain" grpc_endpoint = "localhost:9090" tmrpc_endpoint = "http://localhost:26657"
sudo tee "$HOME/.kiichain/oracle/config.toml" > /dev/null <<EOF
#######################################################
### Price Feeder Config ###
#######################################################
# This is the main configuration for the price feeder module.
[main]
# Define if the price feeder should send votes to the chain
enable_voting = true
# Defines if the price feeder server is enabled
enable_server = true
# Defines the server configuration
[server]
# The address where the server will listen for HTTP requests
listen_addr = "0.0.0.0:7171"
# The timeout for read operations
read_timeout = "20s"
# The timeout for write operations
write_timeout = "20s"
# Define if cors is enabled
enable_cors = true
# The allowed origins for CORS requests
allowed_origins = ["*"]
#######################################################
### Gas configurations ###
#######################################################
# Note: The oracle module defines the first vote per voting window as feeless
[gas]
# Gas adjustment is a multiplier applied to the gas estimate
gas_adjustment = 1.5
# Gas prices are specified in the format "<amount><denom>", e.g., "500000akii"
gas_prices = "400000000000akii"
# Gas limit is the maximum amount of gas that can be used for a transaction
gas_limit = 200000
#######################################################
### Account ###
#######################################################
[account]
# The account name to use for signing transactions
# Can be the validator master account or a feeder account
address = "kii.."
# The validator who is voting
validator = "kiivaloper..."
# The prefix for the keys
prefix = "kii"
# The chain ID for signatures
chain_id = "oro_1336-1"
#######################################################
### Keyring ###
#######################################################
[keyring]
# The keyring backend to use for storing keys
backend = "test|os|file"
# The keyring directory where keys are stored
dir = "<folder|user>/.kiichain"
#######################################################
### RPC ###
#######################################################
[rpc]
# The RPC endpoint for the node that will send transactions
grpc_endpoint = "localhost:9090"
# The timeout for RPC calls
rpc_timeout = "500ms"
# The Tendermint RPC endpoint for querying the blockchain
tmrpc_endpoint = "http://localhost:26657"
#######################################################
### Pairs ###
#######################################################
# This defines all the pairs and their providers
[[currency_pairs]]
# Base is the asset being priced
base = "BTC"
# Chain denom is the denomination used on the chain
chain_denom = "ubtc"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"coinbase",
"kraken",
"okx"
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "ETH"
# Chain denom is the denomination used on the chain
chain_denom = "ueth"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"coinbase",
"kraken",
"okx"
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "SOL"
# Chain denom is the denomination used on the chain
chain_denom = "usol"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"kraken",
"coinbase",
"okx",
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "XRP"
# Chain denom is the denomination used on the chain
chain_denom = "uxrp"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"kraken",
"coinbase",
"okx",
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "BNB"
# Chain denom is the denomination used on the chain
chain_denom = "ubnb"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"kraken",
"okx",
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "USDT"
# Chain denom is the denomination used on the chain
chain_denom = "uusdt"
# Providers are the exchanges providing the price data
providers = [
"kraken",
"coinbase",
"crypto",
]
# Quote is the asset against which the base is priced
quote = "USD"
[[currency_pairs]]
# Base is the asset being priced
base = "USDC"
# Chain denom is the denomination used on the chain
chain_denom = "uusdc"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"kraken",
"okx",
"gate",
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "XAUT"
# Chain denom is the denomination used on the chain
chain_denom = "uxaut"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"okx",
"gate",
]
# Quote is the asset against which the base is priced
quote = "USDT"
[[currency_pairs]]
# Base is the asset being priced
base = "TRX"
# Chain denom is the denomination used on the chain
chain_denom = "utrx"
# Providers are the exchanges providing the price data
providers = [
"huobi",
"okx",
"binance",
"gate",
]
# Quote is the asset against which the base is priced
quote = "USDT"
#######################################################
### Pair deviation ###
#######################################################
# Deviation defines a maximum amount of standard deviations that a given asset can
# be from the median without being filtered out before voting.
[[deviation_thresholds]]
# Base is the asset being priced
base = "BTC"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "ETH"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "SOL"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "XRP"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "BNB"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "USDT"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "USDC"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "XAUT"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
[[deviation_thresholds]]
# Base is the asset being priced
base = "TRX"
# The threshold is the maximum number of standard deviations allowed
threshold = "2"
#######################################################
### Provider endpoints ###
#######################################################
# This can be used to override the default endpoints for each provider
[[provider_endpoints]]
# The name of the provider
name = "binance"
# The REST API endpoint for the provider
rest = "https://api1.binance.com"
# The WebSocket endpoint for the provider
websocket = "stream.binance.com:9443"
#######################################################
### Telemetry ###
#######################################################
[telemetry]
# Enable or disable telemetry
enabled = true
# The service name for telemetry
service_name = "price-feeder"
# Enable or disable telemetry hostname
enable_hostname = true
# Enable or disable telemetry hostname label
enable_hostname_label = true
# Enable or disable service label
enable_service_label = true
# Global labels for the telemetry
global_labels = [["chain_id", "oro_1336-1"]]
# How long prometheus should retain data
prometheus_retention = 60
EOF
Create service:
sudo tee /etc/systemd/system/kiichaind-oracle.service > /dev/null <<EOF
[Unit]
Description=KiiChaind Oracle Price Feeder
After=network-online.target
[Service]
User=testnet
ExecStart=$(which kiichaind-oracle) start $HOME/.kiichain/oracle/config.toml --skip-password
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && sudo systemctl enable kiichaind-oracle
sudo systemctl restart kiichaind-oracle && journalctl -fu kiichaind-oracle -o cat