Skip to main content

Artela

Endpoints

APIRPC
https://artela-testnet-api.kgnodes.xyzhttps://artela-testnet-rpc.kgnodes.xyz

Explorer: https://explorer.kgnodes.xyz/artela

Installation

You should update the MONIKER, WALLET, and PORT variables in the Setting up environment variables section. Make sure the port you specify is not already in use.

Check for ports already in use by visually inspecting the output of the lsof -i -P -n | grep LISTEN command. Almost all Cosmos chain nodes use ports xx317, xx656, xx657, and xx090. Therefore, avoid using ports starting with xx if they are already occupied.

Update OS

sudo apt update && sudo apt upgrade -y

Installation of required packages

sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Installation of go (if you need)

cd ~
VER="1.21.5" # Make sure that this version does not broke any other apps you run!
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
rm -rf /usr/local/go
tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Setting up environment variables

echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="your-moniker"" >> $HOME/.bash_profile
echo "export ARTELA_CHAIN_ID="artela_11822-1"" >> $HOME/.bash_profile
echo "export ARTELA_PORT="30"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Downloading and installing node

cd $HOME
rm -rf artela
git clone https://github.com/artela-network/artela
cd artela
git checkout v0.4.7-rc6
make install

Initializing the node

artelad config node tcp://localhost:${ARTELA_PORT}657
artelad config keyring-backend os
artelad config chain-id artela_11822-1
artelad init "moniker" --chain-id artela_11822-1

Downloading genesis and addressbook

cd $HOME
wget -O $HOME/.artelad/config/genesis.json https://snapshot.kgnodes.xyz/snapshot/artelad/genesis.json
wget -O $HOME/.artelad/config/addrbook.json https://snapshot.kgnodes.xyz/snapshot/artelad/addrbook.json

Setting seeds and peers

SEEDS="8d0c626443a970034dc12df960ae1b1012ccd96a@artela-testnet-seed.itrocket.net:30656"
PEERS="5c9b1bc492aad27a0197a6d3ea3ec9296504e6fd@artela-testnet-peer.itrocket.net:30656,2311ee135cc99667c6c8ec3cb3915bcff88ae244@84.247.182.209:3456,8b7197aef087a286bdb16ea576f193958dc60f6c@173.212.240.21:45656,1e756b284845382ebc093db5215e35a185cb8239@158.220.124.187:3456,c1857b8cda3be58baa56fd682f1e60d91fbc3bb4@109.199.105.124:25656,eb6fe7febc3995d3338fd9adb454ff24bed5dfcd@144.126.146.17:3456,bd342274c7f957d9a5c193242adf0d55bf7cd4cc@194.163.174.204:26656,adacfbd6f059e7fdce0aff120c2a275d78569215@2.58.82.7:3456,e0e8bb86b595283ef87bfb4c0e518572064cf0e3@173.249.40.47:25656,51f9fbb10f25dc50d7d2889ca822c927f7285b30@38.242.134.178:3456"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.artelad/config/config.toml

Setting custom ports

Updating ports in app.toml

sed -i.bak -e "s%:1317%:${ARTELA_PORT}317%g;
s%:8080%:${ARTELA_PORT}080%g;
s%:9090%:${ARTELA_PORT}090%g;
s%:9091%:${ARTELA_PORT}091%g;
s%:8545%:${ARTELA_PORT}545%g;
s%:8546%:${ARTELA_PORT}546%g;
s%:6065%:${ARTELA_PORT}065%g" $HOME/.artelad/config/app.toml

Updating ports in config.toml

sed -i.bak -e "s%:26658%:${ARTELA_PORT}658%g;
s%:26657%:${ARTELA_PORT}657%g;
s%:6060%:${ARTELA_PORT}060%g;
s%:26656%:${ARTELA_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${ARTELA_PORT}656\"%;
s%:26660%:${ARTELA_PORT}660%g" $HOME/.artelad/config/config.toml

Configuring pruning settings

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.artelad/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.artelad/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.artelad/config/app.toml

Setting gas and other configurations

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.025art"|g' $HOME/.artelad/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.artelad/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.artelad/config/config.toml

Creating service file

sudo tee /etc/systemd/system/artelad.service > /dev/null <<EOF
[Unit]
Description=Artela node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.artelad
ExecStart=$(which artelad) start --home $HOME/.artelad
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Enabling and starting the service

sudo systemctl daemon-reload
sudo systemctl enable artelad
sudo systemctl restart artelad && sudo journalctl -u artelad -f

Snapshot

Make sure to back up your priv_validator_key.json file if you've already created a validator! Resetting your node without a backup will cause you to lose access and require creating a new validator from scratch. Be careful!

The following snippets create a copy of your priv_validator_state.json and priv_validator_key.json files. Then, it copies the old private files back after copying the snapshot files. However, you should execute these commands with caution to prevent any kind of failure!

# If you want to apply this snap after installing the node, first stop the node using following command
sudo systemctl stop artelad

cp $HOME/.artelad/data/priv_validator_state.json $HOME/.artelad/priv_validator_state.json.backup
cp $HOME/.artelad/config/priv_validator_key.json $HOME/.artelad/config/priv_validator_key.key.backup

artelad tendermint unsafe-reset-all --home $HOME/.artelad --keep-addr-book
curl https://snapshot.kgnodes.xyz/snapshot/artelad/snap_artelad.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.artelad


cp $HOME/.artelad/priv_validator_state.json.backup $HOME/.artelad/data/priv_validator_state.json
cp $HOME/.artelad/config/priv_validator_key.json.backup $HOME/.artelad/config/priv_validator_key.key

# If you applied this snap after installing the node, then you can restart your node using following command
# Also visually inspect your logs. Your node is started to work again.

systemctl start artelad && journalctl -u artelad -f --no-hostname -o cat

Creating a wallet

You need to create or import a wallet to request test tokens. If you dont have any tokens, you will not be able to create a validator.

# Following command creates a new wallet.
# Copy mnemonics to a safe place
# If you lost your mnemonics you will not be able to recover this wallet.
artelad keys add $WALLET

# If you want to import a wallet using mnemonics, execute following command and enter your mnemonics
artelad keys add $WALLET --recover

# Get your keys and their addresses to request faucet
artelad keys list

Creating a validator

Before you begin:

It's crucial to ensure your node is synchronized with the network before attempting to create a validator. This ensures your validator operates with the latest blockchain data.

Checking Synchronization Status:

Use the following snippet to check your node's synchronization status. If the snippet returns false, your node is in sync and ready to proceed. However, if it returns true, your node is still catching up. In that case, please wait until the synchronization completes before creating a validator.

artelad status | jq -r .sync_info.catching_up

Creating a Validator:

artelad tx staking create-validator \
--amount 1000000uart \
--from your-wallet \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(artelad tendermint show-validator) \
--moniker "your-moniker" \
--identity "" \
--website "" \
--details "" \
--chain-id artela_11822-1 \
--gas auto --gas-adjustment 1.5 \
-y

Edit Validator:

artelad tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "your-moniker" \
--identity "" \
--details "" \
--from your-wallet \
--chain-id artela_11822-1 \
--gas auto --gas-adjustment 1.5 \
-y

Delegate to yourself

You might need to update number of tokens before executing the following command.

artelad tx staking delegate $(artelad keys show $WALLET --bech val -a) 1000000uart --from $WALLET --chain-id artela_11822-1 --gas auto --gas-adjustment 1.5 -y 

Unjail Validator

artelad tx slashing unjail --from $WALLET --chain-id artela_11822-1 --gas auto --gas-adjustment 1.5 -y  

Deleting the node completely (if you need)

Make sure that you backed up any required files to setup later! Do not lost your validator or wallet!

sudo systemctl stop artelad
sudo systemctl disable artelad
sudo rm -rf /etc/systemd/system/artelad.service
sudo rm $(which artelad)
sudo rm -rf $HOME/.artelad
sed -i "/ARTELA_/d" $HOME/.bash_profile