# Kopi Protocol

<figure><img src="/files/qiYdxyyBWKK6nATNd6lI" alt=""><figcaption><p>Kopi Protocol</p></figcaption></figure>

Website: [https://kopi.money](https://kopi.money/)&#x20;

Discord: <https://discord.gg/GvnwSwsCcs>&#x20;

Telegram: <https://t.me/KopiProtocol>&#x20;

X: [https://twitter.com/kopi\_money](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
PEERS=9aff60b8a0580e17e6e01bcfc55e7b827966ba0d@144.76.109.19:17656,7c687ce87652e17da7c57907df11b43519577a09@58.187.175.101:16656,6641dc16eb6b1aa04a892b83e82871b7d30b44bf@168.119.11.176:12656,5b4abd9b20628943a9b2efec7dc0bb062bb4dac7@65.21.234.111:45656,a96649c75f8837d5269077ccf6d34c551fe1a577@88.99.137.138:12656,5407aff45e8c4597dc8b362d1726fcb0e0eff53e@209.126.83.93:16656
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.kopid/config/config.toml

```

<pre><code><strong># Download latest chain snapshot
</strong>curl -L https://files.nodesync.top/Kopi/snapshot-kopi.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.kopid
</code></pre>

## **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

<pre><code><strong>kopid keys add wallet --recover
</strong></code></pre>

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

<mark style="color:red;">**False is synced**</mark>

```
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": "contact@node39.top",
  "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 <a href="#snap" id="snap"></a>

```
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

<mark style="color:red;">**Important**</mark>

```
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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.nodesync.top/mainnet-running/kopi-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
