β Kopi Protocol

Website: https://kopi.money
Discord: https://discord.gg/GvnwSwsCcs
Telegram: https://t.me/KopiProtocol
X: https://twitter.com/kopi_money
My SERVICES:
RPC: https://kopi-rpc.nodesync.top/
API: https://kopi-api.nodesync.top/
Explorer: https://explorer.nodesync.top/Kopi-Protocol
1. Minimum hardware requirement
4 Cores, 8G Ram, 160G SSD, Ubuntu 22.04
2. Server preparation
sudo apt update && sudo apt upgrade -y
sudo apt install make curl git wget -y
sudo apt install htop tmux build-essential jq make lz4 gcc unzip -y
3. Install GO
if ! which go ; then
#Install GO
ver="1.22.4"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
fi
4. Download and build binaries
cd $HOME
rm -rf kopi
git clone --quiet --depth 1 --branch v0.6.5.1 https://github.com/kopi-money/kopi.git
cd kopi
make install
kopid version --long | grep -e commit -e version
5. Initialize the node
kopid init NodeName --chain-id luwak-1
kopid config set client chain-id luwak-1
kopid config set client keyring-backend os
curl -O $HOME/.kopid/config/genesis.json https://files.nodesync.top/Kopi/genesis.json
curl -O $HOME/.kopid/config/addrbook.json https://files.nodesync.top/Kopi/addrbook.json
# Set indexing:
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.kopid/config/config.toml
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0001ukopi\"|" $HOME/.kopid/config/app.toml
# Set pruning
sed -i -e 's|^pruning *=.*|pruning = "custom"|' $HOME/.kopid/config/app.toml
sed -i -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' $HOME/.kopid/config/app.toml
sed -i -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' $HOME/.kopid/config/app.toml
sed -i -e 's|^pruning-interval *=.*|pruning-interval = "50"|' $HOME/.kopid/config/app.toml
sed -i -e 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $HOME/.kopid/config/config.toml
sed -i -e 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $HOME/.kopid/config/config.toml
# Add Peers
[email protected]:17656,[email protected]:16656,[email protected]:12656,[email protected]:45656,[email protected]:12656,[email protected]:16656
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.kopid/config/config.toml
# Download latest chain snapshot
curl -L https://files.nodesync.top/Kopi/snapshot-kopi.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.kopid
6. Custom Ports:
echo "export KOPI_PORT="19"" >> $HOME/.bash_profile
source $HOME/.bash_profile
sed -i.bak -e "s%:1317%:${KOPI_PORT}317%g;
s%:8080%:${KOPI_PORT}080%g;
s%:9090%:${KOPI_PORT}090%g;
s%:9091%:${KOPI_PORT}091%g;
s%:8545%:${KOPI_PORT}545%g;
s%:8546%:${KOPI_PORT}546%g;
s%:6065%:${KOPI_PORT}065%g" $HOME/.kopid/config/app.toml
sed -i.bak -e "s%:26658%:${KOPI_PORT}658%g;
s%:26657%:${KOPI_PORT}657%g;
s%:6060%:${KOPI_PORT}060%g;
s%:26656%:${KOPI_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${KOPI_PORT}656\"%;
s%:26660%:${KOPI_PORT}660%g" $HOME/.kopid/config/config.toml
7. Create Service and Start node
sudo tee /etc/systemd/system/kopid.service > /dev/null <<EOF
[Unit]
Description=Kopi Protocol
After=network-online.target
[Service]
User=root
ExecStart=$(which kopid) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable kopid
sudo systemctl restart kopid
sudo journalctl -u kopid -f --no-hostname -o cat
8. Wallet
Add New Wallet Key - Save seed
kopid keys add wallet
Recover existing key
kopid keys add wallet --recover
List All Keys
kopid keys list
8.1 Query Wallet Balance
kopid q bank balances $(kopid keys show wallet -a)
8.2 Check sync status
False is synced
kopid status 2>&1 | jq .sync_info.catching_up
8.3 Create Validator
Obtain your validator public key by running the following command:
kopid tendermint show-validator
The output will be similar to this (with a different key):
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="}
Then, create a file named validator.json
with the following content:
nano $HOME/validator.json
Change your info, from "pubkey" to "details" and Save them
{
"pubkey": {
"@type":"/cosmos.crypto.ed25519.PubKey",
"key":"<Paste Key here>"
},
"amount": "1000000ukopi",
"moniker": "Node39 Guide",
"identity": "",
"website": "https://services.node39.top",
"security": "[email protected]",
"details": "Node39.TOP Member",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
Finally, we're ready to submit the transaction to create the validator:
kopid tx staking create-validator $HOME/validator.json \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y
8.4 Delegate Token to your own validator
kopid tx staking delegate $(kopid keys show wallet --bech val -a) 1000000ukopi \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y
8.6 Withdraw rewards and commission from your validator
kopid tx distribution withdraw-rewards $(kopid keys show wallet --bech val -a) \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y
8.7 Unjail validator
kopid tx slashing unjail \
--from=wallet \
--chain-id=luwak-1 \
--fees 100ukopi \
--node=https://kopi-rpc.nodesync.top:443 \
-y
8.8 Services Management
# Reload Service
sudo systemctl daemon-reload
# Enable Service
sudo systemctl enable kopid
# Disable Service
sudo systemctl disable kopid
# Start Service
sudo systemctl start kopid
# Stop Service
sudo systemctl stop kopid
# Restart Service
sudo systemctl restart kopid
# Check Service Status
sudo systemctl status kopid
# Check Service Logs
sudo journalctl -u kopid -f --no-hostname -o cat
9. Snapshot
sudo systemctl stop kopid
cp $HOME/.kopid/data/priv_validator_state.json $HOME/.kopid/priv_validator_state.json.backup
kopid tendermint unsafe-reset-all --home $HOME/.kopid --keep-addr-book
# Download latest chain snapshot
curl -L https://files.nodesync.top/Kopi/snapshot-kopi.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.kopid
mv $HOME/.kopid/priv_validator_state.json.backup $HOME/.kopid/data/priv_validator_state.json
sudo systemctl restart kopid && sudo journalctl -u kopid -f --no-hostname -o cat
10. Backup Validator
Important
cat $HOME/.kopid/config/priv_validator_key.json
11. Remove node
cd $HOME
sudo systemctl stop kopid
sudo systemctl disable kopid
sudo rm /etc/systemd/system/kopid.service
sudo systemctl daemon-reload
rm -f $(which kopid)
rm -rf $HOME/.kopid
rm -rf $HOME/kopid
Last updated