# Home

Technical Document RoomIT Validator

## Descriptions

This document related about RoomIT System.

* Mainnet Validator Documents
* Testnet Validaor Documents
* DVPN
* Security
* Monitoring and Health Management
* Automated Configuration Management
* Patch and Update
* Backup and Restore
* Scalability
* Disaster Recovery


# Architecture

Architecture RoomIT

<figure><img src="https://server.gitopia.com/raw/roomit-xyz/stake.roomit.xyz/master/img/powered/RoomIT-Network.png" alt=""><figcaption><p>Architecture RoomIT</p></figcaption></figure>

## Overview

The Roomit architecture is built independently from scratch, utilizing robust hardware components. This architecture is designed to be isolated, secure, and reliable. Its purpose is to ensure the security of blockchain validation, VPN services, and decentralized infrastructure services. Additionally, there are other services such as web service endpoints (API, RPC, GRPC), snapshot services, data providers, and more. All services are designed with redundancy, automation, security, monitored and boast a strong SLA with an average uptime of 99.99%.

## Main Component

The Main Component Roomit provided is following:

**1. Validation Blockchain (Mainnet dan Testnet)**

Roomit has conducted extensive validations across various blockchains. These validations are carried out on both production and staging systems. In the blockchain ecosystem, the production system refers to the mainnet, which is the primary or production network of a blockchain project. This is the final version of the network released for public use and operates with cryptocurrency that holds real value. A testnet in blockchain is a trial network used for development, testing, and experimentation before features or changes are applied to the main network (mainnet). The details are as follows:

**Mainnet**

* Atomone
* Fuel Network
* Gitopia Blockchain
* Planq Network
* Source Protocol
* SGE Protocol
* Sentinel Network
* Selfchain
* Nibiru
* Entangle
* Gnosischain
* Etc

**Testnet**

* Aptos (AIT2-3)
* Celestia
* Neutron
* OKP4
* Masa Finance
* QGov
* Arkeo
* Taiko
* Alephzero
* Gitopia
* Planq
* SGE
* Namada
* Entangle
* Selfchain
* Initia
* Aleo
* Etc

**2. VPN Decentralized (DVPN)**

A type of virtual private network that is distributed and managed by many nodes or participants in the network, unlike traditional VPNs which are managed by a single central entity, is called a decentralized VPN. We also provide VPN services, which are connected to blockchain. The services we offer are as follows:

* Sentinel
* Mysterium
* NYM

## Flow

From the architecture diagram above, the following aspects can be concluded:

**Users**

Users can contribute and invest their tokens to decentralize the network or use the VPN services we provide over the internet. Additionally, users can perform transactions or monitor their investments through the web services we offer, such as:

* <https://stake.roomit.xyz>
* <https://explorer.tendermint.roomit.xyz>
* <https://stake.roomit.xyz/analytics>
* <https://health.roomit.xyz/status/roomit-mainnet>
* <https://monittoring.roomit.xyz>

**Administrator**

Since the system is well isolated, administrators need VPN access, SSH Public Key, and OTP Access to enter the system. Access is only possible through a single gateway. Roomit is truly designed with a baseline and isolated security system.

**System**

Our blockchain machines only have P2P connection access. The function of this P2P connection is used for the connection between validators to perform transactions. All request From internet for Endpoint Public Service or website service come through from proxy and did not touch validation server, we have provide service for each blockchain for Endpoint or Snapshots in other Machines.


# Tech Stack

Stack Technology RoomIT

**Spesification Server**

We are running virtual machine over hypervisor cluster with specsification server hypervisor following :

```
CPU  : AMD EPYC 4244P - 6 c / 12 t - 3.8 GHz / 5.1 GHz
RAM  : 64 GB
Disk : 2 TB
```

```
CPU  : AMD EPYC 4244P - 6 c / 12 t - 3.8 GHz / 5.1 GHz
RAM  : 64 GB
Disk : 2 TB
```

```
CPU  : AMD EPYC 4244P - 6 c / 12 t - 3.8 GHz / 5.1 GHz
RAM  : 64 GB
Disk : 2 TB
```

```
CPU  : AMD EPYC 4244P - 6 c / 12 t - 3.8 GHz / 5.1 GHz
RAM  : 64 GB
Disk : 2 TB
```

we manage all environment using provisioning and automated.

#### Virtualisation and Containering

* Proxmox
* Docker and LXC
* KVM

#### Networking

* vSwitch
* Wireguard
* Opnsense

#### DNS

* PowerDNS
* Dnsmasq
* Namecheap API

#### Remote Signer

* TMKMS

#### Security Tools

* Layer 3 and 4 (net filter) | Firewall
* Crowdsec | Firewall | WAF
* Audit and Accounting | auditd
* Filesystem Integrity | Aide
* Openvas | Scanner vulnearbility
* Hardening System
* ZAP
* Wazuh

#### Automation

* Ansible
* Terraform
* Jenkins

#### Monitoring System

* Grafana Stack (Prometehus, Alert Manager and Exporter)
* Uptime Kuma
* Monit
* Tenderduty

#### Alerting

* Gotify
* Telegram

#### Tools Blockchain

We build from scratch for manage operation our node and this close source

#### Source Code Repository

* gitopia.com
* github.com
* gitlab.com

For other details, you can contact us at *<admin@roomit.xyz>*


# Rest API

Rest API RoomIT

Roomit offers an API for seamless management and integration of blockchain services, enabling users to efficiently handle their investments and access network features and able integrating in our platform.

### Details

Host :

```
https://stake.roomit.xyz
```

#### Profile

* For Get details Our Validator Profiles

```
GET - /api/mainnet/profile
GET - /api/testnet/profile
```

Output :

```
........
[
  {
    "moniker": "Roomit",
    "valoper": "bandvaloper13tf84rkc9yflru6kty4xj8jtkuzl6fd66f3q3z",
    "wallet_address": "band13tf84rkc9yflru6kty4xj8jtkuzl6fd6kl4r5f",
    "blockchain_name": "band",
    "chain_id": "laozi-mainnet",
    "unit": "uband",
    "udecimal": 6,
    "coingeckoId": "band-protocol",
    "ibc": "not active",
    "ibc_wallet": null,
    "seeds": "08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40000",
    "persistent": "420994846f175d0413796be9caea49e07ad3a503@p2p.tendermint.roomit.xyz:16600"
  }
]
.........
```

#### System

* For get version blockchain what we used

```
GET - /api/mainnet/version?blockchain_name=planq
```

Output :

```
{"version":"1.1.0"}
```

* For get last block from blockchain

```
GET - /api/mainnet/lastblock?blockchain_name=planq
GET - /api/testnet/lastblock?blockchain_name=planq
```

Output :

```
{"latestBlockHeight":"9788147"}
```

* For Get Chain ID

```
GET - /api/mainnet/chainid?blockchain_name=planq
GET - /api/testnet/chainid?blockchain_name=planq
```

Output :

```
{"network":"planq_7070-2"}
```

* For Get Status Synchronize Block

```
GET - /api/mainnet/synced?blockchain_name=planq
GET - /api/testnet/synced?blockchain_name=planq
```

Output :

```
{"catchingUp":false}
```

#### Peers

* For Get Peers - Non Filtered from our RPC, this RPC no filtered only connected with our node will be show

```
GET - /api/mainnet/peers/nonfiltered?blockchain_name=planq
```

Output :

```
........
{"peers_nonfiltered":"6563c2409390cfea48623404812123315c5691df@undefined:26756,fb4cbb33179151e31311a498255f3194ced0c570@undefined:29656,3eb12284b7fb707490b8adfda6fa7d94e2fa5cd9@undefined:16603,76cc8a36e1ab54baef5dcb85663309daa494cee0@undefined:11156,97c53c39bb622da97a3aa4ab8cc6db32e67d6e8f@undefined:26656,89bd24ef4ccbd2425f127fd7822b4e55b0e09c36@undefined:26656,876b7a9b2b74ff7f6ba27028b24ca8aff5d9e9d9@undefined:61256,0e9387a4aa548998eda8f2bb4a5cd799345d5367@undefined:10756,b32cc55bf6382c9dbefb0c4ed5a615dbec1de41a@undefined:26656,fbf8a0d8dc3110f66e107752068346ecf8ef7eff@undefined:13656,6e6dd88c20bb7dc88caaefed5fa9bee59daa7a2c@undefined:20356,c8b05a87333041df65c0f61af47670e8811d8175@undefined:26656,97bf4b6f04f148edaa8c89d9033de470df9df5ca@undefined:26726,5086dee34ce6c69af7a6cf96d7d3a056d60c17ad@undefined:34656,f8bf62981f1c57b134a20e50d8afe016b1d0540b@undefined:26641,a3b8955aa523285d0aed51c7bfaf19eb20264ef5@undefined:10656,dd2f0ceaa0b21491ecae17413b242d69916550ae@undefined:26656,b039ad70d947e8b80b412310e7968eba370d5ffc@undefined:20356,e39dd27379e1a23760095a8f8d0943a30e264f5a@undefined:26726,8ad61ede4e3dc47b68b37f4c5309c11037d51b2f@undefined:26656,56f473a809cb87eaee37d9346a006e0b13077c50@undefined:26656,1efcb4b593bc4992ae413ac3c77f158a496908a4@undefined:26656,f0e3fa71a2eed651f0626fe913d9577a942f7e7a@undefined:33656,4d76396c180f8fab3abd34cc546f3c08c426905a@undefined:10656,fe5a38459191a00ad62e9f1913fc57581cef43a8@undefined:20356,5958a5508324f8bb1f7426c56937acd22e286577@undefined:30656,6e6415345f09527675e0d46d00c0a536c9c04f29@undefined:26656,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@undefined:20356,09ba537d6563018b97c502979c3478df4decf426@undefined:5656,bebfd590a2514520d158a2fce308e186e400f841@undefined:31656"}
.........
```

* For Get Peers - Filtered from our RPC, this RPC no filtered only connected with our node will be show

```
GET - /api/mainnet/peers/filtered?blockchain_name=planq
```

Output :

```
........
{"peers_filtered":"09ba537d6563018b97c502979c3478df4decf426@152.53.32.140:5656,0e9387a4aa548998eda8f2bb4a5cd799345d5367@65.21.198.100:10756,0facb3fba65c74a3f602a212b739d2db840a37d3@167.235.12.38:12156,106302ce8ae5c02dd16cc251f64950b03e58a96a@65.108.230.113:1176,17c83d5faba42f6a783684c67f94762b0809bbef@135.181.222.33:20356,1adb7bf1e2775981f20a6e7ae85d6c82d9c13ebc@65.109.104.72:20356,1efcb4b593bc4992ae413ac3c77f158a496908a4@49.13.209.160:26656,241c9414dd5654d7a5b39f438c4b4b70f4a93634@46.4.23.251:28656,29335bb56d235dc39e51d5a5e5f55717d81f00bd@34.215.64.62:26656,2daef0223a20a030076449e494397ef640a95c8e@5.189.136.141:26656,2f433bd6a566d32be7ec502699ccfefddd845c90@38.46.221.23:26656,30d0d17ec2c267bd3df6cb6e14cb9b0abee53054@65.109.62.179:46656,3374ff118b1f01b52ea6f52fe2914f11abfb2581@138.201.21.197:51656,3707bb058157f3a0fa7d97b481fbc8a3a9f8bdb9@65.109.94.250:26656,3eb12284b7fb707490b8adfda6fa7d94e2fa5cd9@65.109.99.157:16603,3fd002790baf7913921903b8c0b27f217088144f@185.190.140.93:14656,4ad2ca3628ec1bb5092fdef9fc31d763a9785093@31.220.75.198:26656,4d44b699af2c4b0a6b8dfdf266a8dc17765113db@85.239.238.23:11656,4d76396c180f8fab3abd34cc546f3c08c426905a@65.108.232.168:10656,5086dee34ce6c69af7a6cf96d7d3a056d60c17ad@94.130.138.48:34656,56e43c7abc96db9244dd5cc6292dc6bb5e2341c4@89.39.106.38:20356,56f473a809cb87eaee37d9346a006e0b13077c50@51.195.63.229:26656,5958a5508324f8bb1f7426c56937acd22e286577@46.4.23.225:30656,599baf73a8d8ae930e5ede9aa5bd92833fbd718c@51.159.213.195:26656,6354dd332572f8daf17f1a0b92e98120a0d5d91f@167.235.102.45:10656,6563c2409390cfea48623404812123315c5691df@65.109.93.152:26756,6e6415345f09527675e0d46d00c0a536c9c04f29@129.152.30.180:26656,6e6dd88c20bb7dc88caaefed5fa9bee59daa7a2c@147.135.31.22:20356,76cc8a36e1ab54baef5dcb85663309daa494cee0@65.108.196.251:11156,81e395d1305e609cf4dd47f07f70536cbccf8a2d@65.109.99.157:16603,876b7a9b2b74ff7f6ba27028b24ca8aff5d9e9d9@116.202.192.143:61256,880b6eacd765af80615517a59fec72788a4d7864@141.95.165.245:26656,88f3dafe5bf183be45836be03bb0e53b7c5ab4df@37.187.149.73:26706,89bd24ef4ccbd2425f127fd7822b4e55b0e09c36@194.163.150.181:26656,8ad61ede4e3dc47b68b37f4c5309c11037d51b2f@51.79.24.196:26656,9630583394c98c3495ec5752fa4c64952b2c0aa6@152.228.212.220:26656,97bf4b6f04f148edaa8c89d9033de470df9df5ca@147.135.138.180:26726,97c53c39bb622da97a3aa4ab8cc6db32e67d6e8f@146.59.110.50:26656,a1f6399349707fb752a4e23950861bf14569c843@167.235.9.223:26656,a3b8955aa523285d0aed51c7bfaf19eb20264ef5@152.53.18.245:10656,a8bbdc5c49cb5e2f7a7abb079332b2eeb0f2e182@104.37.185.178:26658,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@135.181.5.219:20356,b039ad70d947e8b80b412310e7968eba370d5ffc@148.113.1.83:20356,b32cc55bf6382c9dbefb0c4ed5a615dbec1de41a@93.81.241.55:26656,b62dca4c82918971ef12fcd25f0a2229e62595f6@213.246.39.138:28656,b95f231726d7ea85d7d000fa6a96b5118aa5f04a@46.165.204.15:27656,bebfd590a2514520d158a2fce308e186e400f841@65.108.66.174:31656,c8b05a87333041df65c0f61af47670e8811d8175@5.161.215.42:26656,c8b549e4982ec6ee75c4a2ff04c486aafd1d3722@5.78.114.77:26656,cfd0bf63d54ddb6222ae7a626c55b923529e8527@136.243.104.103:10756,dd2f0ceaa0b21491ecae17413b242d69916550ae@135.125.247.70:26656,e39dd27379e1a23760095a8f8d0943a30e264f5a@167.114.118.234:26726,e499c85df22319f64c2cea74ebd00d8ac2675844@167.235.14.83:14556,e7a2929fa8273d0aa0a83b2a25ad4fbdf4471558@212.227.73.190:29656,eb93bbbff168f16993da2c618c3ac6cebb09f9dd@184.174.35.79:26656,edf3c6acb49930a9b634bc609f601de0ebcbcf1a@81.0.221.144:36656,f0e3fa71a2eed651f0626fe913d9577a942f7e7a@65.108.237.188:33656,f7d55c947e3f9848d31b82a5562d9d2a3dd0e04c@65.109.24.78:41656,f8bf62981f1c57b134a20e50d8afe016b1d0540b@95.165.89.222:26641,fb4cbb33179151e31311a498255f3194ced0c570@65.108.127.231:29656,fbf8a0d8dc3110f66e107752068346ecf8ef7eff@65.108.226.120:13656,fdc59829040c6bcb20a76b44c2e4432cc2345c1e@45.55.135.162:10756,fe5a38459191a00ad62e9f1913fc57581cef43a8@65.108.238.29:20356,fe78937abf98c31f0ba3254146a5368412c78382@167.235.3.247:26636"}
.........
```

* For Get Our Seeds Peers

```
GET - /api/mainnet/peers/seeds?blockchain_name=planq
GET - /api/testnet/peers/seeds?blockchain_name=planq
```

Output :

```
{"seeds":"08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40003"}
```

* For Get Our Persistent Peers

```
GET - /api/mainnet/peers/persistent?blockchain_name=planq
GET - /api/testnet/peers/persistent?blockchain_name=planq
```

Output :

```
{"persistent":"3eb12284b7fb707490b8adfda6fa7d94e2fa5cd9@p2p.tendermint.roomit.xyz:16603"}
```

#### Snapshot

* For Get Our Seeds Peers

```
GET - /api/mainnet/snapshot/fileinfo?blockchain_name=planq
GET - /api/testnet/snapshot/fileinfo?blockchain_name=planq
```

Output :

```
{"filename":"2024-07-10-planq-9773721.tar.lzma","size":465960750}
```

#### IBC

* For Get IBC Support

```
GET - /api/mainnet/ibc
```

Output :

```
["planq_7070-2","gitopia","source-1","sentinelhub-2","sgenet-1","osmosis-1"]
```


# About

About RoomIT

### Summary

Roomit is a Limited Liability Company (LLC), officially registered as PT Roomit Trimiko Digital. Established in Indonesia in 2022, Roomit is driven by a team of IT professionals dedicated to leveraging blockchain technology, with a primary focus on DePIN (Decentralized Physical Infrastructure) technology.

Roomit specializes in developing a decentralized virtual private network (VPN) service and facilitating transaction validation across multiple blockchains. The primary mission of Roomit is to provide reliable infrastructure and offer secure, private, and decentralized transaction services. Roomit is committed to delivering trusted technology solutions, with a primary focus on the development and implementation of blockchain technology.

### Services

**Validation**

Currently, We are validate in many blockcain mainnet/production on tendermint based and EVM. We are validating following :

* Gitopia Blockchain
* Planq Network
* Source Protocol
* SGE Protocol
* Sentinel Network
* Selfchain
* Nibiru
* Band Protocol
* Entangle
* Block Network
* Gnosischain
* Etc

**Decentralized VPN**

Besides that, we have provide infrastrcture VPN based on :

* Sentinel

  Location :

  * Chicago | US
  * Detroit | US
  * Las Vegas | US
  * Hongkong | Hongkong
  * Jakarta | Indonesia
  * Meung-sur-Loire | France
  * Boulogne-Billancourt | France
* NYM

  Location :

  * Indonesia
* Mysterium

  Location :

  * Indoneisa
  * Germany

**Infrastructures Services**

We provide infrastuctures service for support decentralized and strong network, following :

* State Sync
* Snapshot
* Endpoint Public
  * RPC
  * GRPC
  * API
* Network Scan
* Map Decentralization
* Guides Deployment
* Miscellaneous Node
  * addressbook
  * genesis
  * seed peers
  * persistent peers
  * cli cheatseets
  * pruning
  * Port changer
* Governance Participant List
* Validator List
* IBC Relaying
* Restake Your Investment

**Opensource Contribution**

* Maintainer Image dVPN Sentinel Image Docker multi architecture

[Link 1- General](https://docs.roomit.xyz/mainnet/sentinel-network/sentinel-dvpn/docker-image-arm-dvpn)

[Link 2 - Docker Image aarch64](https://hub.docker.com/r/wajatmaka/sentinel-aarch64-alpine)

[Link 3 - Docker Image arm7](https://hub.docker.com/r/wajatmaka/sentinel-arm7-debian)

```
- Architecure 
  🖥️ X86_64
     - Ubuntu 22.04
     - Rocky Linux
     - Fedora Server

  💻 ARMv7 
     - RaspberryPI 4 Debian
     
  💻 ARM64/aarch64 
     - Ubuntu
```

* Maintainer Script Automation Deployment for dVPN Sentinel

[Script Automation Deployment dVPN](https://gitopia.com/roomit-xyz/sentinel-node)

* Ansible Auto deployment for tendermint

[Ansible - Tendermint](https://gitopia.com/roomit-xyz/roomit-automation)

Overall we have valuations from our delegators around $ 300k USD.

Roomit is very grateful to the parties who have contributed to the development of Roomit. May health and happiness always be bestowed upon us all.

Best Regards, Roomit


# NYM

Decentralized privacy platform

<figure><img src="https://github.com/roomit-xyz/stake.roomit.xyz/raw/main/img/services/nym.png" alt=""><figcaption><p>NYM</p></figcaption></figure>

nym is decentralized privacy platform. It provides strong network-level privacy against sophisticated end-to-end attackers, and anonymous access control using blinded, re-randomizable, decentralized credentials. Different with VPN, dVPN, l2P, Facebook Connect and TOR. The Nym mixnet is an anonymous overlay network that provides strong network-level anonymity, even in the face of powerful systems capable of passively monitoring the entire network.

\\


# NYM Mixnode

Mixnode is machine mixing packet. The traffic Internet from user will be mixed for secure browsing


# How to Stake Your Token

How to stake your token $NYM

Download Wallet :

<https://nymtech.net/download-nym-wallet/>\
\
Import your seed key. We assume, you have $NYM Token.

Copy Our ID Node Mixnode :

```bash
AGaEw8kZuNAGZyQXYrtedaZcAYUE7aUzngeYGrBgHETo
```

1. Open NYM Wallet
2. Move to menu **Delegation** and Click Delegate Button on Right Top.

<figure><img src="https://2491908101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRzzRaBjAn4L4uV84FT3i%2Fuploads%2Fgit-blob-aeba6ee77386f8ce7a7f903ee9431fc196bbc7b3%2FNYM.png?alt=media" alt=""><figcaption><p>Delegate</p></figcaption></figure>

3\. Click Delgate Stake and Delegate.


# Installation

How to Installation NYM Mixnode


# Preparation

Setup Environment What we need

{% hint style="info" %}
Docker is Must
{% endhint %}

Setup User, Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

after that, let set up docker [Broken mention](broken://pages/CjFKeIOufPxh55wfGSbz)

{% hint style="info" %}
Run as user : *salinem*
{% endhint %}

### Create FHS

```
├── bin
├── data
│   └── mixnodes           
│           
├── monitoring
│   └── telegraf
└── systemd
```


# Setup Mixnode

Installation and Setup NYM Mixnode

{% hint style="info" %}
Running As User : *salinem*
{% endhint %}

Create file Dockerfile-Mixnode in /mainnet/salinem/

```bash
FROM bitnami/minideb:buster AS builder

RUN set -ex \
    && install_packages libssl1.1 ca-certificates curl python3 python3-pip \
    && useradd -U -m -s /sbin/nologin nym

WORKDIR /home/nym

COPY bin/mixnode.sh .
COPY .env_mixnode .
COPY bin/nym-mixnode .

# Change onwership and permissions
RUN chmod +x mixnode.sh && chown -R nym:nym ./
RUN pip3 install requests
RUN chmod +x nym-mixnode

USER nym

VOLUME [ "/home/nym/.nym" ]

EXPOSE 1789

CMD [ "./mixnode.sh" ]


```

And create file run.sh

```bash
#!/bin/bash
#
# RoomIT
# https://roomit.xyz
# If this script useful and you will visit cikarang indonesia,
# Let's drink coffee and talk about blockchain
#
# Script Automatic Build and Running Container NYM
# admin@roomit.xyz
# 
#

# Container Mode Host
OPTIONS="$1"
SERVICE="$2"
STORAGE="/mainnet/salinem/data"


function help(){
   echo "bash run.sh [ build | container | full-update ]   [ mixnode | client | requester ]"
}

function service(){
mkdir -p ${STORAGE}
if [ "${SERVICE}" == "mixnode" ]
then
    docker run -d --name nym-mixnode-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-mixnode-server/latest
    echo mixnode run container
elif [ "${SERVICE}" == "client" ]
then
    docker run -d --name nym-client-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-client-server/latest
    echo client run container
elif [ "${SERVICE}" == "requester" ]
then
    docker run -d --name nym-requester-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-requester-server/latest
    echo requester run container
else
   help;
fi
}

function build(){
if [ "${SERVICE}" == "mixnode" ]
then
    echo mixnode run build
    docker build -f Dockerfile-Mixnode -t nym-mixnode-server/latest .
elif [ "${SERVICE}" == "client" ]
then
    echo client run build
    docker build -f Dockerfile-Client -t nym-client-server/latest .
elif [ "${SERVICE}" == "requester" ]
then
    echo requester run build
    docker build -f Dockerfile-Requester -t nym-requester-server/latest .
else
   help;
fi
}


function full:update(){
build;
mkdir -p ${STORAGE}
if [ "${SERVICE}" == "mixnode" ]
then
    check_container=`docker ps -a | grep  "\bnym-${SERVICE}-server\b" | grep -v "\bnym-${SERVICE}-server\b"`
    docker stop nym-${SERVICE}-server nym-${SERVICE}-server-old 2> /dev/null
    docker rm nym-${SERVICE}-server-old
    docker rename nym-${SERVICE}-server nym-${SERVICE}-server-old
    docker run -d --name nym-mixnode-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-mixnode-server/latest
    if [ $? -eq 0 ]
    then
	 docker rm nym-${SERVICE}-server-old
	 echo "Container Removed ${SERVICE}"
    fi
    echo mixnode run container
elif [ "${SERVICE}" == "client" ]
then
    check_container=`docker ps -a | grep  "\bnym-${SERVICE}-server\b" | grep -v "\bnym-${SERVICE}-server\b"`
    docker stop nym-${SERVICE}-server
    docker rename nym-${SERVICE}-server nym-${SERVICE}-server-old > /dev/null
    docker run -d --name nym-client-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-client-server/latest
    if [ $? -eq 0 ]
    then
         docker rm nym-${SERVICE}-server-old
         echo "Container Removed ${SERVICE}"
    fi
    echo client run container
elif [ "${SERVICE}" == "requester" ]
then
    check_container=`docker ps -a | grep  "\bnym-${SERVICE}-server\b" | grep -v "\bnym-${SERVICE}-server\b"`
    docker stop nym-${SERVICE}-server
    docker rename nym-${SERVICE}-server nym-${SERVICE}-server-old 2> /dev/null
    docker run -d --name nym-requester-server --cap-add=NET_ADMIN --cap-add=NET_RAW --network host  -v ${STORAGE}:/home/nym/.nym nym-requester-server/latest
    if [ $? -eq 0 ]
    then
         docker rm nym-${SERVICE}-server-old
         echo "Container Removed ${SERVICE}"
    fi
    echo requester run container
else
   help;
fi
}

if [ "${OPTIONS}" == "build" ]
then 
    build;
elif [ "${OPTIONS}" ==  "container" ]
then
    service;
elif [ "${OPTIONS}" ==  "full-update" ]
then
   echo "Warning Systemd was not Active"
   full:update;
else
    help;
fi
```

Create File .env\_mixnode

```bash
#!/bin/bash

ID="Name Of Mixnode"
WALLET="Assign If was Running First Service"
```

Create File in mixnode.sh bin/

```bash
#!/bin/bash
set -x

source .env_mixnode

IP=`curl ifconfig.me`
HOME=/home/nym

function config_init () {
if [ ! -f $HOME/.nym/mixnodes/$ID/data/private_sphinx.pem ] || [ ! -f $HOME/.nym/mixnodes/$ID/data/public_sphinx.pem ]; then
    ./nym-mixnode init --id $ID --host 0.0.0.0 --wallet-address $WALLET --announce-host $IP  &&  ./nym-mixnode run --id $ID
elif [ -f $HOME/.nym/mixnodes/${ID}/data/private_sphinx.pem ] || [ -f $HOME/.nym/mixnodes/${ID}/data/public_sphinx.pem ]; then
    RUST_BACKTRACE=1 ./nym-mixnode run --id $ID
fi
}
```

Download Mixnode

```
wget -O bin/nym-mixnode \
-c https://github.com/nymtech/nym/releases/download/nym-binaries-v1.1.2/nym-mixnode

chmod +x bin/nym-mixnode
```


# Up And Running

First Running Container Mixnode

{% hint style="info" %}
Notes : Setup Mixnode must be Finish First
{% endhint %}

Build Images

```bash
bash run.sh build mixnode
```

Run Container

```bash
bash run.sh container mixnode
```

Check Container

```bash
docker ps
```

Stop Container

```bash
docker stop nym-mixnode-server 
```

Assign Wallet address in /mainnet/salinem/.env\_mixnode. For get Wallet Address

```bash
 cat /salinem/mainnet/data/mixnodes/"YOUR ID MIXNODE"/config/config.toml | grep wallet_address
```

Start again

```bash
docker start nym-mixnode-server 
```

Check Logs

```bash
docker logs -f nym-mixnode-server 
```


# Infrastructures


# Port Mapping

Port Mapping RoomIT Mixnode

<table><thead><tr><th width="321">Services</th><th width="107">Port</th><th width="108.33333333333331">Protocol</th><th>Status</th></tr></thead><tbody><tr><td>Mixnet</td><td>1789</td><td>TCP</td><td>Public</td></tr><tr><td>Verloc</td><td>1790</td><td>TCP</td><td>Public</td></tr><tr><td>Metrics</td><td>8000</td><td>TCP</td><td>Public</td></tr><tr><td>Telegraf (Metrics Custom)</td><td>9101</td><td>TCP</td><td>Private</td></tr></tbody></table>


# Monitoring View Mixnode

View Monitoring Private Mixnode

<figure><img src="https://2491908101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRzzRaBjAn4L4uV84FT3i%2Fuploads%2Fgit-blob-bb26a6132114ee3af4ed96e7ef9f121f4f3e93d6%2FNYM_Mixnode-Monitoring.png?alt=media" alt=""><figcaption><p>Grafana Monitoring For Mixnode</p></figcaption></figure>


# Firewall NYM


# PlanQ

Document Node PlanQ

<figure><img src="https://2491908101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRzzRaBjAn4L4uV84FT3i%2Fuploads%2Fgit-blob-242c6d6bea45464fcfdb33270c264af80dfc33c0%2Fplanq.png?alt=media" alt=""><figcaption><p>PlanQ</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>

The blockchain cosmos on your phone Planq network opens up the full blockchain potential of your phone with easy accessibility.


# Installation Node


# Installation Validator

Install Node Producer

**Chain ID**: planq\_7070-2 | **Latest Binary Version**: v1.0.8

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem*
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd

/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of PlanQ

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

#### Install PlanQ

```bash
cd ~
apt install jq -y
apt install unzip -y
wget https://github.com/planq-network/planq/releases/download/v1.0.2/planq_1.0.2_Linux_x86_64.tar.gz
tar xvf planq_1.0.2_Linux_x86_64.tar.gz
```

#### Environment

{% hint style="info" %}
In this case, RoomIT used zsh, if you used bash just direct to ${HOME}/.bashrc or ${HOME}/.profile
{% endhint %}

```
echo 'export PATH="${PATH}:${HOME}/bin"' >> ${HOME}/.zshrc
source ~/.zshrc
```

#### Intialize Node

```bash
planqd init <your_custom_moniker> --chain-id planq_7070-2
```

#### Add Genesis

```bash
wget https://raw.githubusercontent.com/planq-network/networks/main/mainnet/genesis.json
mv genesis.json ~/.planqd/config/
```

Validate Genesis

```
planqd validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/planq/installation-node/edit-configuration-node)

Apply State Sync, refer to [State Sync](/mainnet/planq/infrastructures/statesync)


# Up And Running

How to start running planq

{% hint style="info" %}
**Running in user** (Assume) : *salinem*
{% endhint %}

{% hint style="info" %}
Ensure you have add sudoers, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

#### Create Systemd

Create file in ${HOME}/systemd/planq-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/planqd-node.service  <<EOF
[Unit]
Description=planq node service
After=network-online.target

[Service]
User=planq
ExecStart=${HOME}/bin/planqd start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
ln -sf ${HOME}/systemd/planqd-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable planqd-node.service
```

Start Service

```bash
sudo systemctl start planqd-node.service
```

Check Service

```bash
sudo systemctl status planqd-node.service
sudo journalctl -fu planqd-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0aplanq\"/" $HOME/.planqd/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.planqd/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16503"
RPC="1673"
PROF_RPC="1103"
P2P="16603"
METRICS="16803"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.planqd/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.planqd/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.planqd/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.planqd/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.planqd/config/config.toml

```

#### Edit Port App

```bash
API="1203"
GRPC="1303"
WEBGRPC="1403"
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.planqd/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.planqd/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.planqd/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash"><strong>seeds="dd2f0ceaa0b21491ecae17413b242d69916550ae@135.125.247.70:26656,0525de7e7640008d2a2e01d1a7f6456f28f3324c@51.79.142.6:26656,21432722b67540f6b366806dff295849738d7865@139.99.223.241:26656"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.planqd/config/config.toml
</code></pre>

Peers Node

```bash
peers="3eb12284b7fb707490b8adfda6fa7d94e2fa5cd9@planq.p2p.roomit.xyz:16603,dd2f0ceaa0b21491ecae17413b242d69916550ae@135.125.247.70:26656,0525de7e7640008d2a2e01d1a7f6456f28f3324c@51.79.142.6:26656,21432722b67540f6b366806dff295849738d7865@139.99.223.241:26656,7c10b1a106a512976e8d71effe5c086327458eef@35.200.183.35:26656,b76abe67188be594e17d6e25c7231b027c8bd324@34.175.180.219:26656,60d86f728656b170956f826f54139b8bd6d16205@82.65.197.168:26656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.planqd/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.planqd/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command PlanQ

This is command about CLI Planq

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### Gas Fee

```
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15
```

#### **Add New Key**

```bash
planqd keys add mywallet --home ${HOME}/.planqd 
```

#### **Recover Key**

With Passphrase

```bash
planqd keys add mywallet --recover  --home ${HOME}/.planqd       
```

With Keyring

```bash
planqd keys add mywallet --recover --keyring-backend os --home ${HOME}/.planqd       
```

#### **List Key**

```bash
planqd keys list --home ${HOME}/.planqd    
```

#### **Delete Key**

```bash
planqd keys delete mywallet --home ${HOME}/.planqd
```

**Export Key**

```bash
 planqd keys export mywallet --home ${HOME}/.planqd
```

#### Import Key

```
planqd keys import mywallet mywallet_file.backup --home ${HOME}/.planqd
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `planqd keys list --home ${HOME}/.planqd--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="planq_7070-2"
   RPC="http://localhost:16703"
   planqd q bank balances ${mywallet} --home ${HOME}/.planqd --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
planqd q bank balances mywallet_public_address --home ${HOME}/.planqd --chain-id planq_7070-2 --node http://localhost:16703
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

planqd tx staking create-validator \
--amount=1000000000000000000aplanq \
--pubkey=$(planqd tendermint show-validator --home ${HOME}/.planqd) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=planq_7070-2 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16703 \
--home ${HOME}/.planqd\
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

planqd tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=planq_7070-2 \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16703 \
--home ${HOME}/.planqd \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y
```

#### Get Validator Info

```
planqd status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```bash
planqd status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(planqd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.planqd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```bash
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
planqd tx slashing unjail \
--from mywallet \
--chain-id planq_7070-2 \
 --home ${HOME}/.planqd\
 --node  http://localhost:16703 \
 --gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
 -y
```

#### Jail Reason

```bash
planqd query slashing signing-info $(planqd tendermint show-validator) \
 --node  http://localhost:16703 \
 --home ${HOME}/.planqd
```

#### List All Active Validator

```bash
planqd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
planqd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
planqd \
query staking validator \
$(planqd keys show \ 
                $(planqd keys list --home ${HOME}/.planqd--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id planq_7070-2 \
--node http://localhost:16703
```

### Token Management

#### Withdraw All Reward From Validator

```bash
planqd tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id planq_7070-2 \
--node http://localhost:16703 \
--home ${HOME}/.planqd\
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y
```

#### Withdraw Commision Reward From Validator

```bash
planqd tx distribution withdraw-rewards $(planqd keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id planq_7070-2 \
--node http://localhost:16703 \
--home ${HOME}/.planqd\
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 
```

#### Delegate My Token to Own Validator

```bash
planqd tx staking delegate $(planqd keys show wallet --bech val -a) 100000aplanq \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y
```

#### Delegate Your Token To Our Validator

```bash
planqd tx staking delegate prefixVALOPExxxxxx 100000aplanq \ 
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y
```

#### Redelegate Tokens to Another Validator

```bash
planqd tx staking redelegate $(planqd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000aplanq \
--from mywallet 
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
planqd tx staking unbond $(planqd keys show wallet --bech val -a) 1000000aplanq \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 
```

Send tokens to the wallet

```
planqd tx bank send wallet <TO_WALLET_ADDRESS> 1000000aplanq \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
planqd query gov proposals
```

#### How to Vote

```bash
### vote yes
planqd tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 

### vote no
planqd tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 

### vote abstain
planqd tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 

### vote No With Veto
planqd tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.planqd\
--node http://localhost:16703 \
--chain-id planq_7070-2 \
--gas=1000000 --gas-prices=30000000000aplanq --gas-adjustment=1.15 \
-y 
```


# Infrastructures


# Addresbook

AddressBook Planq From RoomIT

{% embed url="<https://roomit.xyz/addressbook/mainnet/planq/>" %}
Planq Addressbook
{% endembed %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop planq-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop planqd**

Download And Deploy

```
curl -Ls  https://roomit.xyz/addressbook/mainnet/planq/addrbook.json > $HOME/.planqd/config/addrbook.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start planq-node
```


# Endpoint Public

Endpoint Public Planq From RoomIT

## RPC

{% embed url="<https://rpc.planq.roomit.xyz>" %}
RoomIT RPC Planq
{% endembed %}

## API

{% embed url="<https://api.planq.roomit.xyz>" %}
RoomIT API planq
{% endembed %}

## gRPC

{% embed url="grpc.planq.roomit.xyz:8443" %}
RoomIT gRPC planq
{% endembed %}

Example Call :

{% hint style="info" %}
Assume, you have done install *grpcurl*
{% endhint %}

```bash
 grpcurl grpc.planq.roomit.xyz:8443  list
```


# Genesis

Genesis Public Planq From RoomIT

#### Genesis

{% embed url="<https://roomit.xyz/genesis/mainnet/planq/>" %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop planq-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop planqd**

Download And Deploy

```
curl -Ls  https://roomit.xyz/genesis/mainnet/planq/genesis.json > $HOME/.planqd/config/genesis.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start planq-node
```


# Peers

Peers Planq From RoomIT

## PERSISTENT PEERS

```bash
3eb12284b7fb707490b8adfda6fa7d94e2fa5cd9@p2p.tendermint.roomit.xyz:16603
```

## SEEDS PEERS

```bash
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40003
```


# Snapshot

Snapshot Planq From RoomIT

## How to Deploy Snapshot?

1. Install Compression/Decompression Tools

```bash
sudo apt install lzma -y
```

2. Download Snapshot

```bash
SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/mainnet/planq/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/mainnet/planq/${SNAPSHOT} --inet4-only
```

3. Stop Your Service Blockchain

```bash
sudo systemctl stop planq-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop planqd**

4. Backup State Validator

```bash
cp ${HOME}/.planqd/data/priv_validator_state.json ${HOME}/.planqd/priv_validator_state.json
```

4. Reset Node Blockchain

```bash
planqd tendermint unsafe-reset-all --home $HOME/.planqd --keep-addr-book
```

5. Extract Data Snapshot

```bash
lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.planqd 
```

6. Restore State Validator

```bash
cp ${HOME}/.planqd /priv_validator_state.json ${HOME}/.planqd/data/priv_validator_state.json
```

7. Start Node Blockchain

```bash
sudo systemctl start planq-node
```


# State Sync

StateSync Planq From RoomIT

Create Mini script, assume filename is statesync.sh

```bash
#!/bin/bash

SNAP_RPC="https://rpc.planq.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.planqd/config/config.toml
```

Stop Service

```bash
sudo systemctl stop planq-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop planqd**

Execute Script after Service Stopped

```bash
bash statesync.sh
```

Reset Node

```bash
# On some tendermint chains
planqd  unsafe-reset-all

# On other tendermint chains
planqd  tendermint unsafe-reset-all --home $HOME/.planqd --keep-addr-book
```

Start Services

```bash
sudo systemctl start planq-node
```


# Firewall and Port Mapping PlanQ

Port Mapping And Firewall Planq |  RoomIT Validator

## Port Mapping

#### EXAMPLE

| Services           | Port  | Protocol | Status          |
| ------------------ | ----- | -------- | --------------- |
| Proxy App          | 16503 | TCP      | Private         |
| RPC                | 16703 | TCP      | Private         |
| pProf              | 1103  | TCP      | Private         |
| P2P                | 16603 | TCP      | Public (Direct) |
| Prometheus Metrics | 16803 | TCP      | Private         |
| API                | 1203  | TCP      | Private         |
| gRPC               | 1303  | TCP      | Private         |
| gRPC Web           | 1403  | TCP      | Private         |
| TMKMS              | 5003  | TCP      | Private         |

## Firewall Planq

```
######## Planq Protocol VALIDATOR
# gRPC
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  1303  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Horcrux / tmkms
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  5003 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Consensus Metrics Exporter
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 1605 -j ACCEPT
# api
-A INPUT -s 10.xxx.xxx.xxx  -p tcp -m multiport --dports  1203  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# rpc
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16703 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# p2p
-A INPUT -p tcp -m multiport --dports 16603  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Metrics
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16803  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

```


# Gitopia

Document Node Gitopia

<figure><img src="https://github.com/roomit-xyz/stake.roomit.xyz/blob/main/img/services/gitopia.png?raw=true" alt=""><figcaption><p>Gitopia</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>

Gitopia is the next-generation Code Collaboration Platform fuelled by a decentralized network and interactive token economy. It is designed to optimize the open-source software development process through collaboration, transparency, and incentivization.


# Installation Node


# Installation Validator

Install Node Producer

**Chain ID**: gitopia | **Latest Binary Version**: v3.3.0

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd

/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of Gitopia

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

#### Install Gitopia

```bash
cd ~
apt install jq -y
apt install unzip -y
wget https://server.gitopia.com/releases/Gitopia/gitopia/v3.3.0/gitopiad_3.3.0_linux_amd64.tar.gz
tar xvf gitopiad_3.3.0_linux_amd64 -C ${HOME}/bin/
```

#### Environment

{% hint style="info" %}
In this case, RoomIT used zsh, if you used bash just direct to ${HOME}/.bashrc or ${HOME}/.profile
{% endhint %}

```
echo 'export PATH="${PATH}:${HOME}/bin"' >> ${HOME}/.zshrc
source ~/.zshrc
```

#### Intialize Node

```bash
gitopiad init <your_custom_moniker> --chain-id gitopia
```

#### Add Genesis

<pre class="language-bash"><code class="lang-bash"><strong>wget https://github.com/gitopia/mainnet/raw/master/genesis.tar.gz &#x26;&#x26; tar xvf genesis.tar.gz
</strong>mv genesis.json ~/.gitopia/config/
</code></pre>

Validate Genesis

```
gitopiad validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/gitopia/installation-node/edit-configuration-node)

Apply State Sync, refer to [State Sync](/mainnet/gitopia/infrastructures/statesync)


# Up And Running

How to start running gitopia

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

{% hint style="info" %}
Ensure you have add sudoers, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

#### Create Systemd

Create file in ${HOME}/systemd/gitopia-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/gitopia-node.service  <<EOF
[Unit]
Description=Gitopia node service
After=network-online.target

[Service]
User=gitopia
ExecStart=${HOME}/bin/gitopiad start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
ln -sf ${HOME}/systemd/gitopia-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable gitopia-node.service
```

Start Service

```bash
sudo systemctl start gitopia-node.service
```

Check Service

```bash
sudo systemctl status gitopia-node.service
sudo journalctl -fu gitopia-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0ulore\"/" $HOME/.gitopia/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.gitopia/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16501"
RPC="16701"
PROF_RPC="1101"
P2P="16601"
METRICS="16801"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.gitopia/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.gitopia/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.gitopia/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.gitopia/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.gitopia/config/config.toml

```

#### Edit Port App

```bash
API="1201"
GRPC="1301"
WEBGRPC="1401"
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.gitopia/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.gitopia/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.gitopia/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash">

<strong>seeds="babc3f3f7804933265ec9c40ad94f4da8e9e0017@seed.rhinostake.com:11356,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:11356,a4a69a62de7cb0feb96c239405aa247a5a258739@seeds.cros-nest.com:57656"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.gitopia/config/config.toml
</code></pre>

Peers Node

```bash
peers="4cf66531681c92f15c95c25bd1bff524f9dca35e@65.109.154.181:26656,b2f764694d52e09793d68259d584ece0c194b6fe@65.108.229.93:26656,082e95b5d5351e68dcfb24dff802f9064cfd5a4c@65.109.92.241:51056,a94aec7233f9fec2b2de4b5c9dab6ad979820b3d@65.109.104.118:60756,a0ebd1e5845148c47451452047c7c99621da195e@65.109.96.93:60556,4adfa5889675e1e91ea4459e15ff4a0ba53e7828@65.108.224.156:19656,12f6b84a23b054a6591c647c2a4456c40af65cce@5.9.147.22:24657,88497ab3bbbcc1e8545771f45020e738bcce590f@95.165.89.222:24136,abca18ed112719b4f0a23932797dba2733f0fd44@23.88.5.169:25656,976d95adec7f0d7fda4464df019fa538fa0bb4ce@144.76.97.251:44656,ffd761a9e0d86609de6dae5935f99451694051a9@34.28.130.17:26656,5b2df98ad73a0a81a5bd31da4489a9236a7d7a99@65.21.91.160:26867,712dd67b7abe08577d394e90a4930492c8f7d2ee@65.108.124.219:41656,dee34ce3265a8901b52edfef8914530e4a9d05af@gitopia.sergo.dev:12283,c35eb6124591bad21673e8d802898faa18e0352a@65.109.29.150:36656,f9b892ea2e8ed8aa83f7b98e7e47371c23b01924@213.239.207.175:36656,8105128854785c428cff7aeed4f8b44a0a478252@provider.boxedcloud.net:31527,8e42db619abe34afe8cb39d4a2d04ae5db5bdaaf@141.94.139.233:26656,de34c6491557c59bc5d73631fb73bf05cd726e3e@142.132.202.50:37656,50b42bb809f445eb59db844ef6550658ef51a391@79.143.179.196:43656,a5233e4359a39e09d7b261c200cdc014bbef76ad@65.108.8.247:11356,2330fa28b8613786c741778d057616e3b91a8ae9@95.217.192.230:21656,a0b6c89b4fe0f455a027080103bffd001f3b6248@65.21.134.202:26356,abd217aa49d5ee86c271d04feef2cf4c97ff8d55@gitopia.p2p.roomit.xyz:16601,0e9f303834a5d1f3be0babd5466725b3609ebc82@65.21.141.246:28656,cf721cc0ae7b6cf9c58784ccfc87f6f621a09ffb@65.109.99.68:26656,11879f38e16e1723ef70950f5222ec78dde7e62f@65.109.17.23:56240,fd6a538800c2acb937f9fc45268704361af1459f@65.109.116.204:12256,b35d46fcfc1e4cfa943a299fcb39853e15e94d8b@81.30.157.35:14656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.gitopia/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.gitopia/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command Gitopia

This is command about CLI Gitopia

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### Gas Fee

```
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2
```

#### **Add New Key**

```bash
gitopiad keys add mywallet --home ${HOME}/.gitopia 
```

#### **Recover Key**

With Passphrase

```bash
gitopiad keys add mywallet --recover  --home ${HOME}/.gitopia       
```

With Keyring

```bash
gitopiad keys add mywallet --recover --keyring-backend os --home ${HOME}/.gitopia       
```

#### **List Key**

```bash
gitopiad keys list --home ${HOME}/.gitopia    
```

#### **Delete Key**

```bash
gitopiad keys delete mywallet --home ${HOME}/.gitopia
```

**Export Key**

```bash
 gitopiad keys export mywallet --home ${HOME}/.gitopia
```

#### Import Key

```
gitopiad keys import mywallet mywallet_file.backup --home ${HOME}/.gitopia
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `gitopiad keys list --home ${HOME}/.gitopia--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="gitopia"
   RPC="http://localhost:16701"
   gitopiad q bank balances ${mywallet} --home ${HOME}/.gitopia --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
gitopiad q bank balances mywallet_public_address --home ${HOME}/.gitopia --chain-id gitopia --node http://localhost:16701
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

gitopiad tx staking create-validator \
--amount=1000000ulore \
--pubkey=$(gitopiad tendermint show-validator --home ${HOME}/.gitopia) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=gitopia \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16701 \
--home ${HOME}/.gitopia\
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

gitopiad tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=gitopia \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16701 \
--home ${HOME}/.gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y
```

#### Get Validator Info

```
gitopiad status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```bash
gitopiad status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(gitopiad tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.gitopia/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```bash
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
gitopiad tx slashing unjail \
--from mywallet \
--chain-id gitopia \
 --home ${HOME}/.gitopia\
 --node  http://localhost:16701 \
 --gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
 -y
```

#### Jail Reason

```bash
gitopiad query slashing signing-info $(gitopiad tendermint show-validator) \
 --node  http://localhost:16701 \
 --home ${HOME}/.gitopia
```

#### List All Active Validator

```bash
gitopiad q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
gitopiad q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
gitopiad \
query staking validator \
$(gitopiad keys show \ 
                $(gitopiad keys list --home ${HOME}/.gitopia--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id gitopia \
--node http://localhost:16701
```

### Token Management

#### Withdraw All Reward From Validator

```bash
gitopiad tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id gitopia \
--node http://localhost:16701 \
--home ${HOME}/.gitopia\
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y
```

#### Withdraw Commision Reward From Validator

```bash
gitopiad tx distribution withdraw-rewards $(gitopiad keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id gitopia \
--node http://localhost:16701 \
--home ${HOME}/.gitopia\
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 
```

#### Delegate My Token to Own Validator

```bash
gitopiad tx staking delegate $(gitopiad keys show wallet --bech val -a) 100000ulore \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y
```

#### Delegate Your Token To Our Validator

```bash
gitopiad tx staking delegate prefixVALOPExxxxxx 100000ulore \ 
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y
```

#### Redelegate Tokens to Another Validator

```bash
gitopiad tx staking redelegate $(gitopiad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000ulore \
--from mywallet 
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
gitopiad tx staking unbond $(gitopiad keys show wallet --bech val -a) 1000000ulore \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 
```

Send tokens to the wallet

```
gitopiad tx bank send wallet <TO_WALLET_ADDRESS> 1000000ulore \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
gitopiad query gov proposals
```

#### How to Vote

```bash
### vote yes
gitopiad tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 

### vote no
gitopiad tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 

### vote abstain
gitopiad tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 

### vote No With Veto
gitopiad tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.gitopia\
--node http://localhost:16701 \
--chain-id gitopia \
--gas=auto --gas-prices=0.5ulore --gas-adjustment=1.2 \
-y 
```


# Infrastructures


# Addresbook

AddressBook Gitopia From RoomIT

{% embed url="<https://roomit.xyz/addressbook/mainnet/gitopia/>" %}
Gitopia Addressbook
{% endembed %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop gitopia-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop gitopiad**

Download And Deploy

```
curl -Ls  https://roomit.xyz/addressbook/mainnet/gitopia/addrbook.json > $HOME/.gitopia/config/addrbook.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start gitopia-node
```


# Endpoint Public

Endpoint Public Gitopia From RoomIT

## RPC

{% embed url="<https://rpc.gitopia.roomit.xyz>" %}
RoomIT RPC Gitopia
{% endembed %}

## API

{% embed url="<https://api.gitopia.roomit.xyz>" %}
RoomIT API gitopia
{% endembed %}

## gRPC

{% embed url="grpc.gitopia.roomit.xyz:8443" %}
RoomIT gRPC gitopia
{% endembed %}

Example Call :

{% hint style="info" %}
Assume, you have done install *grpcurl*
{% endhint %}

```bash
 grpcurl grpc.gitopia.roomit.xyz:8443  list
```


# Genesis

Genesis Public Gitopia From RoomIT

#### Genesis

{% embed url="<https://roomit.xyz/genesis/mainnet/gitopia/>" %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop gitopia-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop gitopiad**

Download And Deploy

```
curl -Ls  https://roomit.xyz/genesis/mainnet/gitopia/genesis.json > $HOME/.gitopia/config/genesis.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start gitopia-node
```


# Peers

Peers Gitopia From RoomIT

## PERSISTENT PEERS

```bash
abd217aa49d5ee86c271d04feef2cf4c97ff8d55@p2p.tendermint.roomit.xyz:16601
```

## SEEDS PEERS

```bash
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40001
```


# Snapshot

Snapshot Gitopia From RoomIT

## How to Deploy Snapshot?

1. Install Compression/Decompression Tools

```bash
sudo apt install lzma -y
```

2. Download Snapshot

```bash
SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/mainnet/gitopia/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/mainnet/gitopia/${SNAPSHOT} --inet4-only
```

3. Stop Your Service Blockchain

```bash
sudo systemctl stop gitopia-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop gitopiad**

4. Backup State Validator

```bash
cp ${HOME}/.gitopia/data/priv_validator_state.json ${HOME}/.gitopia/priv_validator_state.json
```

4. Reset Node Blockchain

```bash
gitopiad tendermint unsafe-reset-all --home $HOME/.gitopia --keep-addr-book
```

5. Extract Data Snapshot

```bash
lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.gitopia 
```

6. Restore State Validator

```bash
cp ${HOME}/.gitopia /priv_validator_state.json ${HOME}/.gitopia/data/priv_validator_state.json
```

7. Start Node Blockchain

```bash
sudo systemctl start gitopia-node
```


# State Sync

StateSync Gitopia From RoomIT

Create Mini script, assume filename is statesync.sh

```bash
#!/bin/bash

SNAP_RPC="https://rpc.gitopia.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.gitopia/config/config.toml
```

Stop Service

```bash
sudo systemctl stop gitopia-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop gitopiad**

Execute Script after Service Stopped

```bash
bash statesync.sh
```

Reset Node

```bash
# On some tendermint chains
gitopiad  unsafe-reset-all

# On other tendermint chains
gitopiad  tendermint unsafe-reset-all --home $HOME/.gitopia --keep-addr-book
```

Start Services

```bash
sudo systemctl start gitopia-node
```


# Firewall and Port Mapping Gitopia

Port Mapping And Firewall Gitopia |  RoomIT Validator

## Port Mapping

#### EXAMPLE

| Services           | Port  | Protocol | Status          |
| ------------------ | ----- | -------- | --------------- |
| Proxy App          | 16501 | TCP      | Private         |
| RPC                | 16701 | TCP      | Private         |
| pProf              | 1101  | TCP      | Private         |
| P2P                | 16601 | TCP      | Public (Direct) |
| Prometheus Metrics | 16801 | TCP      | Private         |
| API                | 1201  | TCP      | Private         |
| gRPC               | 1301  | TCP      | Private         |
| gRPC Web           | 1401  | TCP      | Private         |
| TMKMS              | 5001  | TCP      | Private         |

## Firewall Gitopia

```
######## Gitopia Protocol VALIDATOR
# gRPC
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  1301  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Horcrux / tmkms
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  5001 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Consensus Metrics Exporter
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 1605 -j ACCEPT
# api
-A INPUT -s 10.xxx.xxx.xxx  -p tcp -m multiport --dports  1201  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# rpc
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16701 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# p2p
-A INPUT -p tcp -m multiport --dports 16601  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Metrics
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16801  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

```


# Band Protocol

Document Node Band Protocol

<figure><img src="https://explorer.tendermint.roomit.xyz/logos/band-protocol.png" alt=""><figcaption><p>Band Protocol</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>

Secure, Scalable Blockchain-Agnostic

Decentralized Oracle Band Protocol is a cross-chain data oracle platform that aggregates and connects real-world data and APIs to smart contracts.


# Installation Node


# Installation Validator

Install Node Producer

**Chain ID**: laozi-mainnet | **Latest Binary Version**: v2.5.4

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd

/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of Band

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

### Install Golang

```bash
# Install Go 1.19.1
wget https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
tar xf go1.19.1.linux-amd64.tar.gz
sudo mv go /usr/local/go

# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.zshrc
source ~/.zshrc
```

#### Install Band

```bash
cd ~
# Clone BandChain Laozi version v2.5.2
git clone https://github.com/bandprotocol/chain
cd chain
git fetch && git checkout v2.5.2

# Install binaries to $GOPATH/bin
export GOPATH="${HOME}/lib"
make install

cp ${HOME}/lib/bin/* ~/bin/
```

#### Environment

{% hint style="info" %}
In this case, RoomIT used zsh, if you used bash just direct to ${HOME}/.bashrc or ${HOME}/.profile
{% endhint %}

```
echo 'export PATH="${PATH}:${HOME}/bin"' >> ${HOME}/.zshrc
source ~/.zshrc
```

Set Variable

```bash
# Chain ID of Laozi Mainnet
export CHAIN_ID=laozi-mainnet
# Wallet name to be used as validator's account, please change this into your name (no whitespace).
export WALLET_NAME=<YOUR_WALLET_NAME>
# Name of your validator node, please change this into your name.
export MONIKER=<YOUR_MONIKER>
# URL of genesis file for Laozi Mainnet
export GENESIS_FILE_URL=https://raw.githubusercontent.com/bandprotocol/launch/master/laozi-mainnet/genesis.json
# Data sources/oracle scripts files
export BIN_FILES_URL=https://raw.githubusercontent.com/bandprotocol/launch/master/laozi-mainnet/files.tar.gz
```

#### Intialize Node

```bash
bandd init --chain-id $CHAIN_ID "$MONIKER"
```

**Replace genesis file with our genesis file**

```bash
wget $GENESIS_FILE_URL -O $HOME/.band/config/genesis.json
```

**Download data sources / oracle scripts files, and store in $HOME/.band/files**

```bash
wget -qO- $BIN_FILES_URL | tar xvz -C $HOME/.band/
```

**Create new account**

```bash
bandd keys add $WALLET_NAME
```

Validate Genesis

```
bandd validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/band/installation-node/edit-configuration-node)

Apply State Sync, refer to [State Sync](/mainnet/band/infrastructures/statesync)


# Up And Running

How to start running Band

{% hint style="info" %}
Ensure you have add sudoers, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

#### Create Systemd

Create file in ${HOME}/systemd/band-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/band-node.service  <<EOF
[Unit]
Description=band node service
After=network-online.target

[Service]
User=band
ExecStart=${HOME}/bin/bandd start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
ln -sf ${HOME}/systemd/band-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable band-node.service
```

Start Service

```bash
sudo systemctl start band-node.service
```

Check Service

```bash
sudo systemctl status band-node.service
sudo journalctl -fu band-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0uband\"/" $HOME/.band/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.band/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16500"
RPC="16700"
PROF_RPC="1100"
P2P="16600"
METRICS="16800"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.band/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.band/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.band/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.band/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.band/config/config.toml

```

#### Edit Port App

```bash
API="1200"
GRPC="1300"
WEBGRPC="1400"
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.band/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.band/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.band/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash">

<strong>seeds="8d42bdcb6cced03e0b67fa3957e4e9c8fd89015a@34.87.86.195:26656,543e0cab9c3016a0e99775443a17bcf163038912@34.150.156.78:26656,2c884e60a0944958a2a9389f07f2f66dcfc3add0@seeds-bandprotocol.activenodes.io:3665"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.band/config/config.toml
</code></pre>

Peers Node

```bash
peers="57135ca657de0637a1b583d4c86e9fc8dd8b744b@65.109.10.232:27013,2422bef180fe121b263cb29fa3e5b31f324c4d11@65.108.108.42:26656,8b3728153ef25bebb43d411d3e06ea1e6d825c21@15.235.53.219:26656,19f6299deac27e917d6356f411d400e2923d4c1e@23.88.91.115:22956,45082483812d7fbf6c1d7c73c2051b0720e32ec3@3.94.1.147:26656,d9a88b59f8b78aa1db43836e5d7438238faf5c8f@35.247.154.38:26656,15e48c03c6f08b1a0a35ea38626d27af4af43bb8@130.193.37.227:26656,f3788f34cea5faf9bcc41fd2d7c4be87181e4810@13.213.122.116:26656,bd4e49e8c1958ef865a9093ae8cbe06ae274fa1a@103.234.71.245:26656,499efe3e04d4d58247d4c91d6812cba5f0a2f291@51.91.67.48:30656,07b6bd70b28103bd4122080100843b2a83537681@15.235.119.114:26656,ebc272824924ea1a27ea3183dd0b9ba713494f83@195.3.220.21:26666,610030996212c634a2c895b4673fcfdfb062638b@185.208.206.162:26656,753f9d25a34a6f67325b42531f4f2e2368bc1d86@88.198.38.151:26656,c1b93580023f12891683431e25fb05d6e4372bef@188.34.207.243:26656,5e951952778848be4aaec8d35cdb188ba767b031@54.199.153.43:26656,8108575603594504341caef34f3d6f9ef55c453a@184.174.37.135:26656,14358a7f970cc0b790d9d8f24513aa11eaf6297f@65.108.238.166:22956,b01cda03ee639d8a01efd168be8952040be416f8@18.235.35.236:26656,1fa749ab7ec4ee0aef63a942493e7ce5e5c29d85@34.87.84.50:26656,9dc4a64e061b36854e33d75cdf045c1d2b273404@34.195.53.91:26656,2e53aad2649eab91d711b45fc2b83690b4156b11@162.19.138.20:26656,0471a19fceefdf595d28d9b0b7f020d0b4eb9e9b@85.237.193.113:26656,ba227966e96506acd5d0110af3a2d4462d96ad31@34.86.22.219:26656,1c0e70871b770938bea3ac2f60def7f5e62ffa2b@162.55.0.195:26656,98823087b61d442a4ab86998709c77b2e517ee78@35.240.152.216:26656,24f83d4c1e4b51fe00da352822a1cbcdea1149f4@65.108.225.126:26656,4ee15cd6f3dae625dbf410ff8aa9facd4b9e96c7@34.143.139.34:26656,3d922c62a5b8241573e83d4d79016f41c022b43b@34.126.163.60:26656,31942da60244c7cd7e05db5d85d82557859414d5@198.244.213.136:26656,53913a0606bcf686595b6e14eaca77fd39dc9fb3@23.109.158.236:26656,cdc98fc960ea41b74e33c0275ab0038937a91dfe@88.99.53.88:26656,79ba880b4da7f5528f0d4b79b378559cdc530307@62.171.165.6:26656,f6c5ff15414bdaaeff59f555eae5ca745c03b37e@77.68.30.186:26656,360c68f66b8e165a293af3ec7677728d4eaddea0@116.202.115.248:26656,4ce256640e5bd082746a696e3d71d8f626443a80@34.143.248.168:26656,7259c4b4efbc0471605959f47285085a7bfd4448@35.240.157.121:26656,f8a112617213052095c68a99fd6260040a235652@45.129.147.242:26657,b0cc97772a5d4e6c507843a16e6636f6be963000@199.247.13.12:26656,268c44707b65471851e70c26d00c8ec9261c15a4@65.108.122.246:26646,7ff95d67cb57b44eba11bed8f3a157eb42bf8311@153.139.245.107:26656,c60ac9d58b02e31b3eec6dfbb867f9336d072f6f@121.78.241.76:41656,38cc521c2cbcc936c2c42b6490c399d3ea4d551b@45.153.35.148:26656,c5e97eed504ced33f15ab231995a68c0eef94410@47.243.134.151:26656,5f1759898d100ef2bab61460449cf6696a1d2058@35.240.171.219:26656,68984b341fbf9809a991c72cfe32fbc87553583c@35.198.219.75:26656,0f2832ff193847e1403dfdd1290237cfb53b2431@34.138.126.238:26656,4a2b39fed2c8693efcba4f050313fc3a78ff3f13@157.90.34.111:16656,3ea84babead3d6bc488810a0f2cf0744cf5c68fe@34.86.22.251:26656,17248657c6a788456c337f4884401a831b1ea2d0@174.138.172.50:30656,807ff4d4429d45838548bab05cd60a695d8ea54c@51.83.140.142:26656,f2c3f4d676b4adce0b8f62582b3cb72ec6aead23@5.135.137.127:26656,8c2c6a7b1a93374e7cdb5484bb348d80b6751f16@162.55.129.170:10356,8ac8ab5741b286adc123799e20e961e86ed4342e@34.76.55.114:26656,714e6dd1dbae791d27518590a1237b97d6117bfc@54.38.46.124:30656,65663f9fb142fea25fa7ab55d13c980e8f698f37@57.128.133.1:26656,4eaaa1008f0487c04559331ddc47ad319aa98afc@98.157.122.100:26656,6425e146d32f3db3a067456a18e2ad012a17f3dc@34.64.245.112:26656,908cbdc5e5b71e716a93f1b7683c2dcd34ac70f1@65.108.229.93:28656,092357cf8057ff150179f2092e56a21dcf6309ee@15.235.14.28:26656,14df75ca29a74b670acd0908e4f50a4ee8eeba56@13.212.159.242:26656,7f4ee402bfaac7d5aa952343f985c222e95d203f@18.179.33.55:26656,cc4f5edc0d2482113338d8f232efaaad8f1b76c5@116.202.96.76:27008,8d72c28400f8e84f93c95fe533cdf89099e24c25@34.142.204.241:26656,5cda7f906ef08667c076cd9b2cc4eb4447d297a5@34.87.51.255:26656,9c5bf0ccbce110dd4162890c0a2c2c6d1f45330b@65.108.234.38:26656,45e438fe45d02dbcf1bea1954a9addd1104debf9@18.180.93.129:26656,e8c86f5ecd1f53899bb8ee2c5af986d3027c51c2@178.18.252.220:26656,5e694e1082f191add1fca6d26ad5e0e9c8fe51a3@95.214.55.227:26666,1f4ef8be39cdebc24e21a822d663028fc2cc2524@15.204.161.104:26656,f1180d35d3697d632bfc705fd5cb048fef2e9624@15.160.187.209:26656,f40730321bbadfbff1dc6235e32652de5cac97d2@65.109.97.249:22956,25f4369ac9cb31a0358c29bde9581fd717086b91@107.135.15.67:26676,f67fba23c4520344bc81fdafab8e86470bc5146f@185.163.64.143:26656,ee287b45460c04f7c9dd086133b8d57e4e381eb4@192.99.20.53:27656,7b6c00012f2411cbfc6f6ecde728d630325edd55@162.55.234.190:56656,f65720eaead72ff532887ec2ba50cace78f1de55@3.39.146.68:26656,d28e8ad7fb8bdcd9d109ac982b09f824acbec8e3@3.126.103.168:26656,caba7ea64b42c83c57b206e3668f6cd842023d8f@51.89.97.105:26002,115d01baed3907b6b939bb0c052548f9fd3e09eb@135.181.138.95:12070,c4254584ff19eb934e01efd485278cea1820da32@15.235.115.152:13100,e10272838a0a54bc08ae12f69fe6d5e33eccac42@15.235.53.30:26656,a8ab3d4507bbb8d0790b75c9c3a39e4f5ec5f0c2@162.19.138.239:11356,fcdfbac66f27552074e27c0124251e06af6b8fc1@54.244.131.5:25656,49f7fbb491faa0eb305feb322acd4d19481e7c96@15.204.163.197:26656,180f77081fa8d626d951b5369f92d4bab00c96b6@65.109.89.45:26656,9eb7da312fc9222cdb7a2ec3c7fe5f0d66109148@148.113.153.111:36656,0f996f16034612e156faf27d03361ec401a65d05@18.138.54.118:26656,2ed997bbf6933d533f27dbdb5ff8e17faf8a9d0b@136.243.67.189:22956,93a8607309c391a5afcb21ccc8a125dcb4791357@51.81.167.60:13100,8d42bdcb6cced03e0b67fa3957e4e9c8fd89015a@34.87.86.195:26656,d1994d6f850252c801e89f2f574e9bcdf5b06ac6@95.217.110.43:26656,0c0cf64205a83ab6e78e231a712ca8eec288ca13@91.194.30.204:21656,d9d1b3aac53a852497bb310f63972453decbce68@194.60.201.251:2656,283718d8ff80c017df6b416c2da7cff5280c5a82@167.235.180.97:22956,f6efd41fc097f270bbb9e38bee76c7c3d0b28134@38.242.234.216:26656,79cd5885ec1efbc68e7807a1546deae627a44a7a@173.212.240.62:26656,40bcbde8554480ca021f8841890b4f2b936b92f0@15.160.38.21:26656,3da0d2906c049a6813a61372103243ec439e1312@35.187.224.251:26656,da5df8a66ff704798982245d1e77b24a1f5ab02b@18.176.159.242:26656,b8d63d9869018c9b4e53e02bd579d6c173cd7d1f@65.109.94.221:43656,34959257a5baf0cd0b4b300975ccdede3167b909@34.126.152.67:26656,4eb232f0d77d7120bc6a11aa7983f065f1c655d9@52.194.8.37:26656,fad4c8e1ea71e4b621692b1637444811e967e5ee@13.230.237.195:26656,5aa1405d22312a6213b7cf82d0e0e03164340eaa@162.19.171.122:26656,0af8609c1dd97ef1a40e13c7e4553d830f8c451b@109.70.113.105:41656,dfb1dfc76ae0f3b465cafecb8b7efb02c7e8f432@65.21.139.155:39656,79740837251bfb6523bccc944c2e9be111c07e62@65.109.92.241:11026,6513473d41b9caadc2d442ea9312561469642c7e@129.151.47.26:26656,02b4be4ba1c055956877a43a0a3b045eef0ed8ae@5.9.99.172:22956,eaa945a2ae43431c419eed87b1ee36b9dff43e5b@45.13.59.97:26656,fc4db9b04408868f082a9886ba65e3a0c9a6cca4@89.149.218.44:26656,83ef515801107dc47728aa87b50f94c816e7be4d@176.9.147.146:46656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.band/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.band/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command Band

This is command about CLI Band Protocol

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### **Add New Key**

```bash
bandd keys add mywallet --home ${HOME}/.band     
```

#### **Recover Key**

With Passphrase

```bash
bandd keys add mywallet --recover  --home ${HOME}/.band           
```

With Keyring

```bash
bandd keys add mywallet --recover --keyring-backend os --home ${HOME}/.band           
```

#### **List Key**

```bash
bandd keys list --home ${HOME}/.band        
```

#### **Delete Key**

```bash
bandd keys delete mywallet --home ${HOME}/.band 
```

**Export Key**

```bash
 bandd keys export mywallet --home ${HOME}/.band 
```

#### Import Key

```
bandd keys import mywallet mywallet_file.backup --home ${HOME}/.band
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `bandd keys list --home ${HOME}/.band--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="laozi-mainnet"
   RPC="tcp://localhost:16700"
   bandd q bank balances ${mywallet} --home ${HOME}/.band --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
bandd q bank balances mywallet_public_address --home ${HOME}/.band --chain-id laozi-mainnet --node tcp://localhost:16700
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

bandd tx staking create-validator \
--amount=1000000uband \
--pubkey=$(bandd tendermint show-validator --home ${HOME}/.band) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=laozi-mainnet \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--gas-adjustment=1.4 \
--gas=auto \
--node tcp://localhost:16700 \
--home ${HOME}/.band\
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

bandd tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=laozi-mainnet \
--commission-rate=0.05 \
--from=mywallet \
--gas-adjustment=1.4 \
--gas=auto \
--node tcp://localhost:16700 \
--home ${HOME}/.band\
-y
```

#### Get Validator Info

```
bandd status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```
bandd status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(bandd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.band/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
bandd tx slashing unjail \
--from mywallet \
--chain-id laozi-mainnet \
 --home ${HOME}/.band\
 --node  tcp://localhost:16700 \
 --gas auto \
 --gas-adjustment 1.4 \
 -y
```

#### Jail Reason

```bash
bandd query slashing signing-info $(bandd tendermint show-validator) \
 --node  tcp://localhost:16700 \
 --home ${HOME}/.band
```

#### List All Active Validator

```bash
bandd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
bandd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
bandd \
query staking validator \
$(bandd keys show \ 
                $(bandd keys list --home ${HOME}/.band--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id laozi-mainnet \
--node tcp://localhost:16700
```

### Token Management

#### Withdraw All Reward From Validator

```bash
bandd tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id laozi-mainnet \
--node tcp://localhost:16700 \
--home ${HOME}/.band\
--gas-adjustment 1.4 \
--gas auto \
-y
```

#### Withdraw Commision Reward From Validator

```bash
bandd tx distribution withdraw-rewards $(bandd keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--chain-id laozi-mainnet \
--node tcp://localhost:16700 \
--home ${HOME}/.band\
-y 
```

#### Delegate My Token to Own Validator

```bash
bandd tx staking delegate $(bandd keys show wallet --bech val -a) 1000000uband \
--from mywallet \
--gas-adjustment 1.4 \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
--gas auto \
-y
```

#### Delegate Your Token To Our Validator

```bash
bandd tx staking delegate bandvaloper13tf84rkc9yflru6kty4xj8jtkuzl6fd66f3q3z 1000000uband \ 
--from mywallet \
--gas-adjustment 1.4 \ 
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y
```

#### Redelegate Tokens to Another Validator

```bash
bandd tx staking redelegate $(bandd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uband \
--from mywallet 
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
bandd tx staking unbond $(bandd keys show wallet --bech val -a) 1000000uband \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 
```

Send tokens to the wallet

```
bandd tx bank send wallet <TO_WALLET_ADDRESS> 1000000uband \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
bandd query gov proposals
```

#### How to Vote

```bash
### vote yes
bandd tx gov vote 1 yes \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 

### vote no
bandd tx gov vote 1 no \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 

### vote abstain
bandd tx gov vote 1 abstain \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 

### vote No With Veto
bandd tx gov vote 1 nowithveto \
--from mywallet \
--gas-adjustment 1.4 \
--gas auto \
--home ${HOME}/.band\
--node tcp://localhost:16700 \
--chain-id laozi-mainnet \
-y 
```

### Oracle

#### Send Band to Report Wallet

```bash
bandd tx multi-send 1uband $(yoda keys list -a) --gas=1000000 --gas-prices=0.0025uband --gas-adjustment=1.15 \
  --from mywallet --node http://localhost:16700 \
  --chain-id laozi-mainnet
```

#### Add Report wallet to oracle

```bash
bandcli tx oracle add-reporters $(yoda keys list -a) --gas=1000000 --gas-prices=0.0025uband --gas-adjustment=1.15 \
  --from mywallet \
  ---chain-id laozi-mainnet
```

#### Activing Oracle

```bash
bandd tx oracle activate --gas=1000000 --gas-prices=0.0025uband --gas-adjustment=1.15 \
  --from mywallet --node http://localhost:16700 \
  --chain-id laozi-mainnet
```

#### Check Oracle Active

```bash
bandd query oracle validator $(bandd keys show -a mywallet --bech val) --chain-id laozi-mainnet --node http://localhost:16700
```


# Infrastructures


# Addresbook

AddressBook Band From RoomIT

{% embed url="<https://roomit.xyz/addressbook/mainnet/band/>" %}
Band Addressbook
{% endembed %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop band-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop bandd**

Download And Deploy

```
curl -Ls  https://roomit.xyz/addressbook/mainnet/band/addrbook.json > $HOME/.band/config/addrbook.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start band-node
```


# Endpoint Public

Endpoint Public Band From RoomIT

## RPC

{% embed url="<https://rpc.band.roomit.xyz>" %}
RoomIT RPC Band
{% endembed %}

## API

{% embed url="<https://api.band.roomit.xyz>" %}
RoomIT API band
{% endembed %}

## gRPC

{% embed url="grpc.band.roomit.xyz:8443" %}
RoomIT gRPC band
{% endembed %}

Example Call :

{% hint style="info" %}
Assume, you have done install *grpcurl*
{% endhint %}

```bash
 grpcurl grpc.band.roomit.xyz:8443  list
```


# Genesis

Genesis Public Band From RoomIT

#### Genesis

{% embed url="<https://roomit.xyz/genesis/mainnet/band/>" %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop band-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop bandd**

Download And Deploy

```
curl -Ls  https://roomit.xyz/genesis/mainnet/band/genesis.json > $HOME/.band/config/genesis.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start band-node
```


# Peers

Peers Band From RoomIT

## PERSISTENT PEERS

```bash
420994846f175d0413796be9caea49e07ad3a503@p2p.tendermint.roomit.xyz:16600
```

## SEEDS PEERS

```bash
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40000
```


# Snapshot

Snapshot Band From RoomIT

## How to Deploy Snapshot?

1. Install Compression/Decompression Tools

```bash
sudo apt install lzma -y
```

2. Download Snapshot

```bash
SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/mainnet/band/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/mainnet/band/${SNAPSHOT} --inet4-only
```

3. Stop Your Service Blockchain

```bash
sudo systemctl stop band-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop bandd**

4. Backup State Validator

```bash
cp ${HOME}/.band/data/priv_validator_state.json ${HOME}/.band/priv_validator_state.json
```

4. Reset Node Blockchain

```bash
bandd tendermint unsafe-reset-all --home $HOME/.band --keep-addr-book
```

5. Extract Data Snapshot

```bash
lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.band 
```

6. Restore State Validator

```bash
cp ${HOME}/.band /priv_validator_state.json ${HOME}/.band/data/priv_validator_state.json
```

7. Start Node Blockchain

```bash
sudo systemctl start band-node
```


# State Sync

StateSync Band From RoomIT

Create Mini script, assume filename is statesync.sh

```bash
#!/bin/bash

SNAP_RPC="https://rpc.band.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.band/config/config.toml
```

Stop Service

```bash
sudo systemctl stop band-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop bandd**

Execute Script after Service Stopped

```bash
bash statesync.sh
```

Reset Node

```bash
# On some tendermint chains
bandd  unsafe-reset-all

# On other tendermint chains
bandd  tendermint unsafe-reset-all --home $HOME/.band --keep-addr-book
```

Start Services

```bash
sudo systemctl start band-node
```


# Firewall and Port Mapping Band

Port Mapping And Firewall Band |  RoomIT Validator

## Port Mapping

#### EXAMPLE

| Services           | Port  | Protocol | Status          |
| ------------------ | ----- | -------- | --------------- |
| Proxy App          | 16500 | TCP      | Private         |
| RPC                | 16700 | TCP      | Private         |
| pProf              | 1100  | TCP      | Private         |
| P2P                | 16600 | TCP      | Public (Direct) |
| Prometheus Metrics | 16800 | TCP      | Private         |
| API                | 1200  | TCP      | Private         |
| gRPC               | 1300  | TCP      | Private         |
| gRPC Web           | 1400  | TCP      | Private         |
| TMKMS              | 5000  | TCP      | Private         |

## Firewall Band

```
######## Band Protocol VALIDATOR
# gRPC
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  1300  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Horcrux / tmkms
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  5000 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Consensus Metrics Exporter
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 1605 -j ACCEPT
# api
-A INPUT -s 10.xxx.xxx.xxx  -p tcp -m multiport --dports  1200  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# rpc
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16700 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# p2p
-A INPUT -p tcp -m multiport --dports 16600  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Metrics
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16800  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

```


# Source Protocol

Document Node Source Protocol

<figure><img src="https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/source/source.png" alt=""><figcaption><p>Source Protocol</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>

Source Protocol is a comprehensive blockchain technology suite for individuals, enterprises and developers to easily use, integrate and build Web 3.0 applications. It is a broad-spectrum technology ecosystem that transforms centralized web tools and financial instruments into decentralized ones.


# Installation Node


# Installation Validator

Install Node Producer

**Chain ID**: source-1| **Latest Binary Version**: v3.0.0

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd

/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of Source

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

### Install Golang

```bash
# Install Go 1.19.1
wget https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
tar xf go1.19.1.linux-amd64.tar.gz
sudo mv go /usr/local/go

# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.zshrc
source ~/.zshrc
```

#### Install Source

```bash
cd ~
# Clone Source Protocol  version v3.0.0
git clone  https://github.com/Source-Protocol-Cosmos/source.git
cd chain
git fetch && git checkout v3.0.0

# Install binaries to $GOPATH/bin
export GOPATH="${HOME}/lib"
make install

cp ${HOME}/lib/bin/* ~/bin/
```

#### Environment

{% hint style="info" %}
In this case, RoomIT used zsh, if you used bash just direct to ${HOME}/.bashrc or ${HOME}/.profile
{% endhint %}

```
echo 'export PATH="${PATH}:${HOME}/bin"' >> ${HOME}/.zshrc
source ~/.zshrc
```

Set Variable

```bash
# Chain ID of Source Mainnet
export CHAIN_ID=source-1
# Wallet name to be used as validator's account, please change this into your name (no whitespace).
export WALLET_NAME=<YOUR_WALLET_NAME>
# Name of your validator node, please change this into your name.
export MONIKER=<YOUR_MONIKER>
# URL of genesis file for Source Mainnet
export GENESIS_FILE_URL= https://raw.githubusercontent.com/Source-Protocol-Cosmos/mainnet/master/source-1/genesis.json
# Data sources/oracle scripts files
export BIN_FILES_URL=
```

#### Intialize Node

```bash
sourced init --chain-id $CHAIN_ID "$MONIKER"
```

**Replace genesis file with our genesis file**

```bash
wget $GENESIS_FILE_URL -O $HOME/.source/config/genesis.json
```

**Download data sources / oracle scripts files, and store in $HOME/.source/files**

```bash
wget -qO- $BIN_FILES_URL | tar xvz -C $HOME/.source/
```

**Create new account**

```bash
sourced keys add $WALLET_NAME
```

Validate Genesis

```
sourced validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/source/installation-node/edit-configuration-node)

Apply State Sync, refer to [State Sync](/mainnet/source/infrastructures/statesync)


# Up And Running

How to start running Source

{% hint style="info" %}
Ensure you have add sudoers, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

#### Create Systemd

Create file in ${HOME}/systemd/source-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/source-node.service  <<EOF
[Unit]
Description=source node service
After=network-online.target

[Service]
User=source
ExecStart=${HOME}/bin/sourced start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
ln -sf ${HOME}/systemd/source-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable source-node.service
```

Start Service

```bash
sudo systemctl start source-node.service
```

Check Service

```bash
sudo systemctl status source-node.service
sudo journalctl -fu source-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.25usource\"/" $HOME/.source/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.source/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16502"
RPC="16702"
PROF_RPC="1102"
P2P="16602"
METRICS="16802"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.source/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.source/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.source/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.source/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.source/config/config.toml

```

#### Edit Port App

```bash
API="1202"
GRPC="1302"
WEBGRPC="1402"
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.source/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.source/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.source/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash">

<strong>seeds="96d63849a529a15f037a28c276ea6e3ac2449695@34.222.1.252:26656,0107ac60e43f3b3d395fea706cb54877a3241d21@35.87.85.162:26656"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.source/config/config.toml
</code></pre>

Peers Node

```bash
peers=""
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.source/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.source/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command Source

This is command about CLI Source

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### Gas Fee

```
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5
```

#### **Add New Key**

```bash
sourced keys add mywallet --home ${HOME}/.source 
```

#### **Recover Key**

With Passphrase

```bash
sourced keys add mywallet --recover  --home ${HOME}/.source       
```

With Keyring

```bash
sourced keys add mywallet --recover --keyring-backend os --home ${HOME}/.source       
```

#### **List Key**

```bash
sourced keys list --home ${HOME}/.source    
```

#### **Delete Key**

```bash
sourced keys delete mywallet --home ${HOME}/.source
```

**Export Key**

```bash
 sourced keys export mywallet --home ${HOME}/.source
```

#### Import Key

```
sourced keys import mywallet mywallet_file.backup --home ${HOME}/.source
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `sourced keys list --home ${HOME}/.source--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="source-1"
   RPC="http://localhost:16702"
   sourced q bank balances ${mywallet} --home ${HOME}/.source --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
sourced q bank balances mywallet_public_address --home ${HOME}/.source --chain-id source-1 --node http://localhost:16702
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sourced tx staking create-validator \
--amount=1000000usource \
--pubkey=$(sourced tendermint show-validator --home ${HOME}/.source) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=source-1 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sourced tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=source-1 \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16702 \
--home ${HOME}/.source \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y
```

#### Get Validator Info

```
sourced status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```bash
sourced status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(sourced tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.source/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```bash
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
sourced tx slashing unjail \
--from mywallet \
--chain-id source-1 \
 --home ${HOME}/.source\
 --node  http://localhost:16702 \
 --gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
 -y
```

#### Jail Reason

```bash
sourced query slashing signing-info $(sourced tendermint show-validator) \
 --node  http://localhost:16702 \
 --home ${HOME}/.source
```

#### List All Active Validator

```bash
sourced q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
sourced q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
sourced \
query staking validator \
$(sourced keys show \ 
                $(sourced keys list --home ${HOME}/.source--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id source-1 \
--node http://localhost:16702
```

### Token Management

#### Withdraw All Reward From Validator

```bash
sourced tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id source-1 \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y
```

#### Withdraw Commision Reward From Validator

```bash
sourced tx distribution withdraw-rewards $(sourced keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id source-1 \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 
```

#### Delegate My Token to Own Validator

```bash
sourced tx staking delegate $(sourced keys show wallet --bech val -a) 100000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y
```

#### Delegate Your Token To Our Validator

```bash
sourced tx staking delegate prefixVALOPExxxxxx 100000usource \ 
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y
```

#### Redelegate Tokens to Another Validator

```bash
sourced tx staking redelegate $(sourced keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000usource \
--from mywallet 
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
sourced tx staking unbond $(sourced keys show wallet --bech val -a) 1000000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 
```

Send tokens to the wallet

```
sourced tx bank send wallet <TO_WALLET_ADDRESS> 1000000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
sourced query gov proposals
```

#### How to Vote

```bash
### vote yes
sourced tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote no
sourced tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote abstain
sourced tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote No With Veto
sourced tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 
```


# Infrastructures


# Addresbook

AddressBook Source From RoomIT

{% embed url="<https://roomit.xyz/addressbook/mainnet/source/>" %}
Source Addressbook
{% endembed %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop source-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sourced**

Download And Deploy

```
curl -Ls  https://roomit.xyz/addressbook/mainnet/source/addrbook.json > $HOME/.source/config/addrbook.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start source-node
```


# Endpoint Public

Endpoint Public Source From RoomIT

## RPC

{% embed url="<https://rpc.source.roomit.xyz>" %}
RoomIT RPC Source
{% endembed %}

## API

{% embed url="<https://api.source.roomit.xyz>" %}
RoomIT API source
{% endembed %}

## gRPC

{% embed url="grpc.source.roomit.xyz:8443" %}
RoomIT gRPC source
{% endembed %}

Example Call :

{% hint style="info" %}
Assume, you have done install *grpcurl*
{% endhint %}

```bash
 grpcurl grpc.source.roomit.xyz:8443  list
```


# Genesis

Genesis Public Source From RoomIT

#### Genesis

{% embed url="<https://roomit.xyz/genesis/mainnet/source/>" %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop source-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sourced**

Download And Deploy

```
curl -Ls  https://roomit.xyz/genesis/mainnet/source/genesis.json > $HOME/.source/config/genesis.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start source-node
```


# Peers

Peers Source From RoomIT

## PERSISTENT PEERS

```bash
47b858cda8717aef908f2567b05ef312d18bb6f3@p2p.tendermint.roomit.xyz:16602
```

## SEEDS PEERS

```bash
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40002
```


# Snapshot

Snapshot Source From RoomIT

## How to Deploy Snapshot?

1. Install Compression/Decompression Tools

```bash
sudo apt install lzma -y
```

2. Download Snapshot

```bash
SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/mainnet/source/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/mainnet/source/${SNAPSHOT} --inet4-only
```

3. Stop Your Service Blockchain

```bash
sudo systemctl stop source-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sourced**

4. Backup State Validator

```bash
cp ${HOME}/.source/data/priv_validator_state.json ${HOME}/.source/priv_validator_state.json
```

4. Reset Node Blockchain

```bash
sourced tendermint unsafe-reset-all --home $HOME/.source --keep-addr-book
```

5. Extract Data Snapshot

```bash
lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.source 
```

6. Restore State Validator

```bash
cp ${HOME}/.source /priv_validator_state.json ${HOME}/.source/data/priv_validator_state.json
```

7. Start Node Blockchain

```bash
sudo systemctl start source-node
```


# State Sync

StateSync Source From RoomIT

Create Mini script, assume filename is statesync.sh

```bash
#!/bin/bash

SNAP_RPC="https://rpc.source.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.source/config/config.toml
```

Stop Service

```bash
sudo systemctl stop source-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sourced**

Execute Script after Service Stopped

```bash
bash statesync.sh
```

Reset Node

```bash
# On some tendermint chains
sourced  unsafe-reset-all

# On other tendermint chains
sourced  tendermint unsafe-reset-all --home $HOME/.source --keep-addr-book
```

Start Services

```bash
sudo systemctl start source-node
```


# Firewall and Port Mapping Source

Port Mapping And Firewall Source |  RoomIT Validator

## Port Mapping

#### EXAMPLE

| Services           | Port  | Protocol | Status          |
| ------------------ | ----- | -------- | --------------- |
| Proxy App          | 16502 | TCP      | Private         |
| RPC                | 16702 | TCP      | Private         |
| pProf              | 1102  | TCP      | Private         |
| P2P                | 16602 | TCP      | Public (Direct) |
| Prometheus Metrics | 16802 | TCP      | Private         |
| API                | 1202  | TCP      | Private         |
| gRPC               | 1302  | TCP      | Private         |
| gRPC Web           | 1402  | TCP      | Private         |
| TMKMS              | 5002  | TCP      | Private         |

## Firewall Source

```
######## Source Protocol VALIDATOR
# gRPC
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  1302  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Horcrux / tmkms
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  5002 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Consensus Metrics Exporter
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 1605 -j ACCEPT
# api
-A INPUT -s 10.xxx.xxx.xxx  -p tcp -m multiport --dports  1202  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# rpc
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16702 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# p2p
-A INPUT -p tcp -m multiport --dports 16602  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Metrics
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16802  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

```


# SGE Network

Document Node  Sge

<figure><img src="https://pbs.twimg.com/profile_images/1709161965971529728/X4uZ9qHz_200x200.jpg" alt=""><figcaption><p>Sge Network Blockchain</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>


# Installation Node


# Installation Validator

Install Node Producer/Validator Sge

**Chain ID**: sgenet-1 | **Latest Binary Version**: v1.1.1

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd
/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of SGE

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

### Install Golang

```bash
# Install Go 1.22.3
wget https://go.dev/dl/go1.22.3.linux-amd64.tar.gz
tar xf go1.22.3.linux-amd64.tar.gz
mv go ${HOME}/bin
```

### Environment and Variable

If Using ZSH

```
# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.zshrc
echo "export GOPATH="${HOME}/lib" >> $HOME/.zshrc
echo "export GOMAXPROCS=2" >> $HOME/.zshrc
echo "export CHAIN_ID=sgenet-1" >> $HOME/.zshrc
echo "export WALLET_NAME=mywallet" >> $HOME/.zshrc
echo "export MONIKER=MYNODE"  >> $HOME/.zshrc
source ~/.zshrc
```

If Using BASH

```
# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.bashrc
echo "export GOPATH="${HOME}/lib" >> >> $HOME/.bahsrc
echo "export GOMAXPROCS=2" >> $HOME/.bashrc
echo "export CHAIN_ID=sgenet-1" >> $HOME/.bashrc
echo "export WALLET_NAME=mywallet" >> $HOME/.bashrc
echo "export MONIKER=MYNODE"  >> $HOME/.bashrc
source ~/.bashrc
```

#### Install Sge

```bash
cd ${HOME}/source
# Clone SGE Protocol  version v1.1.1
git clone  https://github.com/sge-network/sge sge
cd ${HOME}/source/sge
git fetch && git checkout v{'changed': True, 'stdout': '', 'stderr': 'v1.7.0-tmfix', 'rc': 0, 'cmd': '/app/mainnet/sge/bin/sged version', 'start': '2024-06-11 06:40:56.196099', 'end': '2024-06-11 06:40:56.262733', 'delta': '0:00:00.066634', 'msg': '', 'stdout_lines': [], 'stderr_lines': ['v1.7.0-tmfix'], 'ansible_facts': {'discovered_interpreter_python': '/usr/bin/python3'}, 'failed': False}
make build
cp build/sged ${HOME}/bin/
```

#### Intialize Node

```bash
sged init --chain-id $CHAIN_ID "$MONIKER"
```

**Replace genesis file with our genesis file**

```bash
wget https://snapshots.indonode.net/sge/genesis.json -O $HOME/.sge/config/genesis.json
```

**Create new account**

```bash
sged keys add $WALLET_NAME
```

Validate Genesis

```
sged validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/sge/installation-node/edit-configuration-node)

Apply State Sync, refer to [State Sync](/mainnet/sge/infrastructures/statesync)


# Up And Running

How to start running Sge

{% hint style="info" %}
Ensure you have add sudoers to user salinem, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

#### Create Systemd

Create file in ${HOME}/systemd/sge-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/sge-node.service  <<EOF
[Unit]
Description=sge node service
After=network-online.target

[Service]
User=salinem
ExecStart=${HOME}/bin/sged start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
sudo cp ${HOME}/systemd/sge-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable sge-node.service
```

Start Service

```bash
sudo systemctl start sge-node.service
```

Check Service

```bash
sudo systemctl status sge-node.service
sudo journalctl -fu sge-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025usge \"/" $HOME/.sge/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.sge/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16505" #Example
RPC="16705" #Example
PROF_RPC="1105" #Example
P2P="16605" #Example
METRICS="16805" #Example
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.sge/config/config.toml

```

#### Edit Port App

```bash
API="1205" #Example
GRPC="1305" #Example
WEBGRPC="1405" #Example
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.sge/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash">

<strong>seeds="c2b06ac64284267dde6627db93eef6c87bf81162@65.108.232.168:19056,304535618b71c2fe217fe771c745443ea3d7815e@65.108.0.94:17756,88f341a9670494c3d529934dc578eec1b00f4aa1@141.94.168.85:26656,c298f3b9d90a5258d48a97ab0577de734a4052dc@65.108.204.209:17756,49d3176741019c4fa911183725981d44c6d51c44@3.34.129.58:26656,423b0dafd7a6b9ea5406d5a0fbae667d9d7ffc11@142.132.248.253:22656,62b3744b7b703de5d946301aa6ea092cda89e02f@213.239.207.175:13156,9d6916344cea096b7adc86b67faf65f2815f09d3@167.235.39.5:60956,ba0a167567c7e08f4bb1e25ec24e42a85b07a0c5@148.113.20.208:17756,053d96f525122d4e20c20b6722d38b367cb04210@65.109.88.254:32656,d91ff3e80de5e07303efb74c6daa02d981b624c4@213.190.31.82:17756,a51476d949df940e636f6d072b14b42aac3a16a8@213.246.45.16:5656,31fa7b0ac148384262dc56c5e90a23e7d48f471d@167.179.79.232:26656,3247b9d019bca2e86e864f5abe8c9b28c2064548@95.165.89.222:24136,3bea9b46a5b067ccc9208e8952e684d37e18e5b0@141.164.56.119:26656,401a4986e78fe74dd7ead9363463ba4c704d8759@38.146.3.183:17756,fd55622051218695a44e1b23aa4347287d70a26d@176.9.92.135:46656,2fd9042e02321cccf513731d6a9bb70c3b12b62d@3.39.25.1:26656,ff69cca1c97a20057c571862e242635e2c460097@141.164.61.145:26656,c902c5873ef611cda24bf4f2be2229171223afdd@3.39.223.174:26656,26238cbb6bf285816bd06ca946b190e7248c389c@46.38.232.86:22656,6619d41e0a1be47c4a79a5438b81793f06ffbc86@65.21.226.187:60556,17da9d2fea9d6d431d390c3b9575547d8881da2b@185.16.39.190:11156,7258d8c7880167fca502592b8d64110d60e99a6b@65.108.232.180:17756,fe527359b6b6c5ad9cc6e2f6ed3af46018b29e15@136.243.36.60:17756,13d370cf706e0cbcbed962f7f5585efead848132@158.69.125.73:10456,d45e4471ed399bfa21c3f5d49c8f9ec0dc1940a7@150.230.137.157:26656,3fc703341935b9356addfe7b3aad8991d9c8a923@148.113.20.207:17756,08db9d08ff534ed65a1c7078e2406d18ff1cc385@51.210.223.84:17756,fa5c3f970a30023c5793cade0fa449d5c8c8e6d5@89.168.24.105:26656"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.sge/config/config.toml
</code></pre>

Peers Node

```bash
peers=""
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.sge/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.sge/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command SGE

This is command about CLI Sge

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### Gas Fee

```
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5
```

#### **Add New Key**

```bash
sged keys add mywallet --home ${HOME}/.sge 
```

#### **Recover Key**

With Passphrase

```bash
sged keys add mywallet --recover  --home ${HOME}/.sge       
```

With Keyring

```bash
sged keys add mywallet --recover --keyring-backend os --home ${HOME}/.sge       
```

#### **List Key**

```bash
sged keys list --home ${HOME}/.sge    
```

#### **Delete Key**

```bash
sged keys delete mywallet --home ${HOME}/.sge
```

**Export Key**

```bash
 sged keys export mywallet --home ${HOME}/.sge
```

#### Import Key

```
sged keys import mywallet mywallet_file.backup --home ${HOME}/.sge
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `sged keys list --home ${HOME}/.sge--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="sgenet-1"
   RPC="http://localhost:16705"
   sged q bank balances ${mywallet} --home ${HOME}/.sge --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
sged q bank balances mywallet_public_address --home ${HOME}/.sge --chain-id sgenet-1 --node http://localhost:16705
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sged tx staking create-validator \
--amount=1000000usge \
--pubkey=$(sged tendermint show-validator --home ${HOME}/.sge) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=sgenet-1 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16705 \
--home ${HOME}/.sge\
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sged tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=sgenet-1 \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16705 \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
```

#### Get Validator Info

```
sged status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```bash
sged status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(sged tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.sge/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```bash
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
sged tx slashing unjail \
--from mywallet \
--chain-id sgenet-1 \
 --home ${HOME}/.sge\
 --node  http://localhost:16705 \
 --gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
 -y
```

#### Jail Reason

```bash
sged query slashing signing-info $(sged tendermint show-validator) \
 --node  http://localhost:16705 \
 --home ${HOME}/.sge
```

#### List All Active Validator

```bash
sged q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
sged q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
sged \
query staking validator \
$(sged keys show \ 
                $(sged keys list --home ${HOME}/.sge--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id sgenet-1 \
--node http://localhost:16705
```

### Token Management

#### Withdraw All Reward From Validator

```bash
sged tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id sgenet-1 \
--node http://localhost:16705 \
--home ${HOME}/.sge\
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
```

#### Withdraw Commision Reward From Validator

```bash
sged tx distribution withdraw-rewards $(sged keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id sgenet-1 \
--node http://localhost:16705 \
--home ${HOME}/.sge\
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
```

#### Delegate My Token to Own Validator

```bash
sged tx staking delegate $(sged keys show wallet --bech val -a) 100000usge \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
```

#### Delegate Your Token To Our Validator

```bash
sged tx staking delegate prefixVALOPExxxxxx 100000usge \ 
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
```

#### Redelegate Tokens to Another Validator

```bash
sged tx staking redelegate $(sged keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000usge \
--from mywallet 
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
sged tx staking unbond $(sged keys show wallet --bech val -a) 1000000usge \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
```

Send tokens to the wallet

```
sged tx bank send wallet <TO_WALLET_ADDRESS> 1000000usge \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
sged query gov proposals
```

#### How to Vote

```bash
### vote yes
sged tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote no
sged tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote abstain
sged tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote No With Veto
sged tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.sge\
--node http://localhost:16705 \
--chain-id sgenet-1 \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
```


# Infrastructures


# Addresbook

AddressBook Sge From RoomIT

{% embed url="<https://roomit.xyz/addressbook/mainnet/sge/>" %}
Sge Addressbook
{% endembed %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop sge-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sged**

Download And Deploy

```
curl -Ls  https://roomit.xyz/addressbook/mainnet/sge/addrbook.json > $HOME/.sge/config/addrbook.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start sge-node
```


# Endpoint Public

Endpoint Public Sge From RoomIT

## RPC

{% embed url="<https://rpc.sge.roomit.xyz>" %}
RoomIT RPC Sge
{% endembed %}

## API

{% embed url="<https://api.sge.roomit.xyz>" %}
RoomIT API sge
{% endembed %}

## gRPC

{% embed url="grpc.sge.roomit.xyz:8443" %}
RoomIT gRPC sge
{% endembed %}

Example Call :

{% hint style="info" %}
Assume, you have done install *grpcurl*
{% endhint %}

```bash
 grpcurl grpc.sge.roomit.xyz:8443  list
```


# Genesis

Genesis Public Sge From RoomIT

#### Genesis

{% embed url="<https://roomit.xyz/genesis/mainnet/sge/>" %}

#### How to Deploy

Stop Your Service Blockchain

```bash
sudo systemctl stop sge-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sged**

Download And Deploy

```
curl -Ls  https://roomit.xyz/genesis/mainnet/sge/genesis.json > $HOME/.sge/config/genesis.json 
```

Start Your Service Blockchain

```bash
sudo systemctl start sge-node
```


# Peers

Peers Sge From RoomIT

## PERSISTENT PEERS

```bash
b7f6da1a8aea371206b4d234398c4888c0564066@p2p.tendermint.roomit.xyz:16605
```

## SEEDS PEERS

```bash
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.xyz:40005
```


# Snapshot

Snapshot Sge From RoomIT

## How to Deploy Snapshot?

1. Install Compression/Decompression Tools

```bash
sudo apt install lzma -y
```

2. Download Snapshot

```bash
SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/mainnet/sge/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/mainnet/sge/${SNAPSHOT} --inet4-only
```

3. Stop Your Service Blockchain

```bash
sudo systemctl stop sge-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sged**

4. Backup State Validator

```bash
cp ${HOME}/.sge/data/priv_validator_state.json ${HOME}/.sge/priv_validator_state.json
```

4. Reset Node Blockchain

```bash
sged tendermint unsafe-reset-all --home $HOME/.sge --keep-addr-book
```

5. Extract Data Snapshot

```bash
lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.sge 
```

6. Restore State Validator

```bash
cp ${HOME}/.sge /priv_validator_state.json ${HOME}/.sge/data/priv_validator_state.json
```

7. Start Node Blockchain

```bash
sudo systemctl start sge-node
```


# State Sync

StateSync Sge From RoomIT

Create Mini script, assume filename is statesync.sh

```bash
#!/bin/bash

SNAP_RPC="https://rpc.sge.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.sge/config/config.toml
```

Stop Service

```bash
sudo systemctl stop sge-node
```

> > Notes : for systemd init blockchain, adjust with your name of service. **systemctl stop sged**

Execute Script after Service Stopped

```bash
bash statesync.sh
```

Reset Node

```bash
# On some tendermint chains
sged  unsafe-reset-all

# On other tendermint chains
sged  tendermint unsafe-reset-all --home $HOME/.sge --keep-addr-book
```

Start Services

```bash
sudo systemctl start sge-node
```


# Firewall and Port Mapping SGE

Port Mapping And Firewall Sge |  RoomIT Validator

## Port Mapping

#### EXAMPLE

| Services           | Port  | Protocol | Status          |
| ------------------ | ----- | -------- | --------------- |
| Proxy App          | 16505 | TCP      | Private         |
| RPC                | 16705 | TCP      | Private         |
| pProf              | 1105  | TCP      | Private         |
| P2P                | 16605 | TCP      | Public (Direct) |
| Prometheus Metrics | 16805 | TCP      | Private         |
| API                | 1205  | TCP      | Private         |
| gRPC               | 1305  | TCP      | Private         |
| gRPC Web           | 1405  | TCP      | Private         |
| TMKMS              | 5005  | TCP      | Private         |

## Firewall Sge

```
######## Sge Protocol VALIDATOR
# gRPC
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  1305  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Horcrux / tmkms
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports  5005 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Consensus Metrics Exporter
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 1605 -j ACCEPT
# api
-A INPUT -s 10.xxx.xxx.xxx  -p tcp -m multiport --dports  1205  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# rpc
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16705 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# p2p
-A INPUT -p tcp -m multiport --dports 16605  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
# Metrics
-A INPUT -s 10.xxx.xxx.xxx -p tcp -m multiport --dports 16805  -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

```


# Sentinel Network


# Sentinel Validator

Document Node dVPN Sentinel Network

<figure><img src="https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/sentinelhub/udvpn.png" alt=""><figcaption><p>dVPN Sentinel Network</p></figcaption></figure>

<figure><img src="https://health.roomit.xyz/api/badge/120/status?style=for-the-badge" alt=""><figcaption></figcaption></figure>

Decentralized Virtual Private Network

The Sentinel ecosystem is a global network of autonomous dVPN applications that enable private and censorship resistant internet access


# Installation Node


# Installation Validator

Install Node Producer

**Chain ID**: sentinelhub-2| **Latest Binary Version**: v0.11.3

Update and install packages for compiling

```
sudo apt update
sudo apt install curl git jq lz4 build-essential zsh -y
```

#### User Management

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

Create User, Please Refer to [Broken mention](broken://pages/ymV0m2TBiK3EBy7fI1X9)

Login as User salinem

```bash
su - salinem
```

or

```bash
sudo su - salinem
```

and make sure we are in directory

```bash
pwd

/mainnet/salinem
```

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### FHS of dVPN

Create FHS for application

```bash
echo "Install FHS"
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/systemd
```

### Install Golang

```bash
# Install Go 1.19.1
wget https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
tar xf go1.19.1.linux-amd64.tar.gz
sudo mv go /usr/local/go

# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.zshrc
source ~/.zshrc
```

#### Install dVPN

```bash
cd ~
git clone https://github.com/sentinel-official/hub.git "${HOME}/sentinelhub"
cd "${HOME}/sentinelhub"
git checkout v0.11.3 # always make sure it's the latest version


# Install binaries to $GOPATH/bin
export GOPATH="${HOME}/lib"
make install

cp ${HOME}/lib/bin/* ~/bin/
```

#### Environment

{% hint style="info" %}
In this case, RoomIT used zsh, if you used bash just direct to ${HOME}/.bashrc or ${HOME}/.profile
{% endhint %}

```
echo 'export PATH="${PATH}:${HOME}/bin"' >> ${HOME}/.zshrc
source ~/.zshrc
```

Set Variable

```bash
# Chain ID of dVPN Mainnet
export CHAIN_ID=sentinelhub-2
# Wallet name to be used as validator's account, please change this into your name (no whitespace).
export WALLET_NAME=<YOUR_WALLET_NAME>
# Name of your validator node, please change this into your name.
export MONIKER=<YOUR_MONIKER>
# URL of genesis file for dVPN Mainnet
export GENESIS_FILE_URL= https://github.com/sentinel-official/networks/raw/main/sentinelhub-2/genesis.zip
# Data dVPN binary scripts files
export BIN_FILES_URL = 
```

#### Intialize Node

```bash
sentinelhub init --chain-id $CHAIN_ID "$MONIKER"
```

**Replace genesis file with our genesis file**

```bash
wget $GENESIS_FILE_URL -O $HOME/.sentinelhub/config/genesis.json
```

**Create new account**

```bash
sentinelhub keys add $WALLET_NAME
```

Validate Genesis

```
sentinelhub validate-genesis
```

Edit config, You can refer to [Edit Configuration Node](/mainnet/sentinel-network/dvpn/installation-node/edit-configuration-node)

Apply State Sync, refer to [https://github.com/roomit-xyz/docs.roomit.xyz/blob/master/mainnet/sentinel-network/dvpn/infrastructures/statesync.md](https://github.com/roomit-xyz/docs.roomit.xyz/blob/master/mainnet/sentinel-network/dvpn/infrastructures/statesync.md "mention")


# Up And Running

How to start running dVPN Sentinel

{% hint style="info" %}
Ensure you have add sudoers, refer [Broken mention](broken://pages/5bYWaTbeErtLtOa9FvrG)
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem* We never used this username in our production !
{% endhint %}

#### Create Systemd

Create file in ${HOME}/system/dvpn-node.service

```bash
export HOME="/mainnet/salinem"
cat > ${HOME}/systemd/dvpn-node.service  <<EOF
[Unit]
Description=dvpn node service
After=network-online.target

[Service]
User=salinem
ExecStart=${HOME}/bin/sentinelhub start 
Restart=on-failure
RestartSec=3
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=${HOME}"


[Install]
WantedBy=multi-user.target

EOF
```

Linking to Systemd

```bash
ln -sf ${HOME}/systemd/dvpn-node.service /etc/systemd/system/
```

Reload Daemon

```bash
sudo systemctl daemon-reload
```

Enable Service when booting

```bash
sudo systemctl enable dvpn-node.service
```

Start Service

```bash
sudo systemctl start dvpn-node.service
```

Check Service

```bash
sudo systemctl status dvpn-node.service
sudo journalctl -fu dvpn-node.service
```


# Edit Configuration Node

Edit Configuration Blockchain

{% hint style="info" %}
**Running in user** : *salinem*
{% endhint %}

#### Set Minimum Gas Price

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001udvpn\"/" $HOME/.sentinelhub/config/app.toml
```

#### **Enable Prometheus Matrics**

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.sentinelhub/config/config.toml
```

#### Edit Port Node

```bash
PROXY_APP="16504"
RPC="16704"
PROF_RPC="1104"
P2P="16604"
METRICS="16804"
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.sentinelhub/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.sentinelhub/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.sentinelhub/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.sentinelhub/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.sentinelhub/config/config.toml

```

#### Edit Port App

```bash
API="12004"
GRPC="13004"
WEBGRPC="14004"
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.sentinelhub/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.sentinelhub/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.sentinelhub/config/app.toml
```

#### Edit Peers

Peers Seed

<pre class="language-bash"><code class="lang-bash">

<strong>seeds="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:23956,89757803f40da51678451735445ad40d5b15e059@169.155.169.176:26656,ee49aa4d21783178781ab7b08922e3a4e288d977@178.63.93.41:50656,182c428b5ff02dc44bdc20a782b28f0cea204bd4@170.39.193.124:26656,4c011a64e66a38df4139ad2af5e8fe0798d00624@65.109.97.249:23956,abc27c91439681b1e7fa4b08b54ebbcc42855973@51.79.80.156:26656,ef48f35580cf0034e12ca05eafd202a0cc0b577b@75.119.148.134:26656,2a426a8a0070a6830bad32b96cd3da1b7b6a2faa@65.108.11.250:29656,207b4b7471e2a5268af8d8bb4d6c5f9cdeb2483d@135.181.5.164:26656,807ad7b69c6500693b599f3c1050bb5e93efad20@65.109.86.249:26656,90ba2861eec3821fd6cf5b38c04eb064e8f13e76@87.20.12.119:26656,39ebd409f6d7bf68276955ded8f44bb3703a3273@65.108.199.42:26656,89757803f40da51678451735445ad40d5b15e059@169.155.169.176:26656,dc8f68628bf86052fc12223abb9c258b95d677de@95.217.198.248:26656,9743903cd8bc169fe2a1fd6649ebd96b3a343141@167.172.111.114:26656,9045af707b492d02d05a7865a126d80d15627d91@65.109.97.51:26656,207a60cfbb81efe375754d6bd81c2bd2c9940d21@85.76.37.97:26656,ca2c8aa924b7b74e86eac5fe06c61d9cceb55cb1@65.21.106.116:26656,5cff17208836ff4290086f43e3c72d9a7248e51d@194.163.161.194:16646,8ebf4283512f708c2aee9d52e37aa694a5ec597a@49.12.165.122:26103,ee49aa4d21783178781ab7b08922e3a4e288d977@178.63.93.41:50656,dd51ff321f29b59b51eedb8682acb3a9f07d44a6@138.201.131.133:26656,11dd817e50479f928a52cf16e07dfb0e207a4772@45.77.62.130:26656,493c4bee520125dea7b93bbe054b0e3918130f3f@46.38.251.243:26656,26422b225939a310fe1022730b38149a69d7d97e@38.242.200.201:26656,b4461589996ccec4eb39cdfa69cacbb57433324e@37.143.9.75:26656,aac50c78fcafc5d87c8cfb8fe25d476b3db6182e@66.172.36.134:26656,e7b825983d15eef809e929b44b2085dcec9d27b6@51.68.44.219:26556,356e02cf1bb1df0e34e5c9f0470c0ad677bee6d6@185.150.26.184:26656,8b505a3c417852b0fb00b4e82a7c10d76501ff66@135.135.158.183:56656,3bbf71ce33504686947d0138405c673a25555738@188.34.151.176:26656,233592737772cf4e8aca29623cb54d53e978bf84@51.159.185.51:26656,d7883818b535db4d889d55c503384973d1370057@66.172.36.133:26656,34d05f43ce549e411a92caf46385d03746f4e1fe@167.86.71.15:26656,58467dfb5a35a9b7cb48fdec2ea1719b028d8d74@102.223.5.249:26656,4c011a64e66a38df4139ad2af5e8fe0798d00624@65.109.97.249:23956,464d1b0650ee82c975e1e7f40ae737f4f688ae32@178.154.212.189:26656,578993078e27b2b5f0c205becd3ad263fb9c366b@192.99.4.66:26796,bbed952face3a6b37a15634c7ef547461d05c96b@95.217.196.54:19999,7b59a0d40ce7d64459d1858c5b5c453e2f59f05c@38.109.200.33:26656,442e7d3d100a91ed2d16c15879b36a8beef7faca@89.58.26.9:26656,7a13027588da83f557a176608c785f79ede84564@66.172.36.135:26656,e726816f42831689eab9378d5d577f1d06d25716@169.155.170.219:26656,c5315e5e43e8e718c7c926c75b651e398750a4f8@155.138.252.9:26656,d44c7d6cf3202faaadf8caa4aa81180201b92fd6@194.233.70.56:26656,4506adc06a18029f5620570cfe8cf0144a550125@135.181.216.151:50656,cb6ae22e1e89d029c55f2cb400b0caa19cbe5523@38.132.56.20:32670,182c428b5ff02dc44bdc20a782b28f0cea204bd4@170.39.193.124:26656,6198aba1915d01d0e2306bb9b0c502e4d0f788c2@65.109.106.169:26656,8ad3670e4e2b086570eb75d3f4a7de7ac53b4139@85.215.101.214:23656,00673903c9a12081c7713b6757f62a8c7d7ffcbf@51.159.110.196:26656,694324d39f53d6e6a0f79d33f535d0ee4a96f74a@37.120.245.177:26656,662ccbd8c9885ddff6800a707da3dc6b0c4ed49d@15.235.115.148:10001,d90df66ac0bb4a364ccfa0b091b4ffd967ef0090@149.102.157.182:26656,45ed1c0498e1ba7894e1362d533583b8c0fa1ae7@136.243.67.189:23956,ffa0ec6801c91858bb1204ae5da54167ace3b6a6@65.21.20.7:26656,0d9f4ae53eb69d4790e9633094b19e0ff18c6e82@5.10.24.84:26656,09423cc26d5490db197f944908eb2a13ec1c1288@65.108.103.184:25656,270cc047a5653b15c4c21d62c622b94f00ab5046@65.108.140.132:26656,dfd4db1ad111c62c83fa300af0092b253773aecc@65.108.106.135:26686,99f7fe677d2b5262fe95fb21e3edc5b9fc16fc4f@219.77.8.110:26706,b212d5740b2e11e54f56b072dc13b6134650cfb5@169.155.45.136:26656,4398bd773ac885b7365de3604eb487be10c54563@95.214.55.227:26706,1fe8fddc8a63641774e50ff4518e022c1529fc20@51.210.240.201:10356,66d0d22dc5e1e542c200da1fc097dae5ea1f3b4e@195.201.175.156:17256,5ace0e57784e34930360bf6cc00dd5265278f708@65.108.238.166:23956,ada37df88e50dd6b04571f8aa010a700d953e89a@138.201.60.188:26656,9c42bcb0d931b6387b4f808f540139bcd5bda968@131.153.174.14:53656,2d786027097ca30c5843cf9f11c14a270499d305@3.85.203.113:26656,d1f02ec2c3447e7a218ece5a2aab8f114dece309@167.114.118.234:26796,1154ef380c350885aef8a2fae6dc308f6844594a@65.108.6.54:50656,e1f3c666366bd464bfd15ed354c9282efdacb560@159.89.27.119:31981,6de4634676e4940ed31bd3e4fde4476e153e466e@95.216.102.124:26656,3499b0a7145dc28c0a5afa4e780a995c363d9e6b@95.216.228.231:26656,677f3be450b746ad530ce02d61ec560ee7430a04@51.15.20.23:26656,ebc272824924ea1a27ea3183dd0b9ba713494f83@195.3.223.168:26706,d2d9596df39d9b57ab1f01b8dea1b346178bf6e4@63.33.136.84:26656,4e1c2471efb89239fb04a4b75f9f87177fd91d00@169.155.171.37:26656,1f95bc704608d6f3d42bfce58e0fefbaef818891@89.149.218.78:26656,abc27c91439681b1e7fa4b08b54ebbcc42855973@51.79.80.156:26656,74a7668894864d5b848037c4ab0d7c3204a1cc97@51.222.41.188:36656,a77f6a094578dad899e2f40e0626b4c6d4705311@3.36.165.232:15100,708b2d5edee8b1f8cb9fcb0dd3cb5b794aeb34d6@135.181.211.184:46656,72f1eb93ac325ebd26209e4f640ee5b759f6ebad@54.150.227.110:26656,adad660c3110c10ca0e2f5e434c2f54b9dcb4e60@212.95.53.148:26656,6c277d3d25cecb8aa3659cf564f896436b372257@103.180.28.108:26656,c462db7a9b0d0ac8d26bddf55ed3ebff13219e51@185.215.166.90:26656,f369be4fb67bbdf6e5542bde352df35b7d4bfd61@208.88.251.50:26656,1c3409fde1bfe7719df8c60c56284ee36b4940e5@212.6.182.242:26656,e407ce1485c5c5abe86d4c4b04f21bc04c321edc@89.58.31.128:36656,062847a82a69469c582429235c1b86365b92294d@65.21.201.244:26706,e46ba943d251e353bfc1571a168affff30e420fa@65.108.235.36:21656,ae9242d78fc004e1c437c5749eb3c0cbab7e879d@159.65.228.219:26656,c1aa31a747bb2497e45656b6b7d972225c9a439c@207.148.27.252:26656"
</strong>sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" ${HOME}/.sentinelhub/config/config.toml
</code></pre>

Peers Node

```bash
peers=""
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' ${HOME}/.sentinelhub/config/config.toml
```

#### Fast Sync

Make sure you have parameter in $HOME/.sentinelhub/config/config.toml

```
fast_sync = true
version = "v0"
```


# Command Sentinel

This is command about CLI Dvpn

### **Key Management**

{% hint style="info" %}
we assume, variable name\_your\_wallet is name of your own wallet.

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

{% hint style="info" %}
**Running in user** (Assume) : *salinem*

We never use this username in our production!
{% endhint %}

#### Gas Fee

```
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4
```

#### **Add New Key**

```bash
sentinelhub keys add mywallet --home ${HOME}/.sentinelhub 
```

#### **Recover Key**

With Passphrase

```bash
sentinelhub keys add mywallet --recover  --home ${HOME}/.sentinelhub       
```

With Keyring

```bash
sentinelhub keys add mywallet --recover --keyring-backend os --home ${HOME}/.sentinelhub       
```

#### **List Key**

```bash
sentinelhub keys list --home ${HOME}/.sentinelhub    
```

#### **Delete Key**

```bash
sentinelhub keys delete mywallet --home ${HOME}/.sentinelhub
```

**Export Key**

```bash
 sentinelhub keys export mywallet --home ${HOME}/.sentinelhub
```

#### Import Key

```
sentinelhub keys import mywallet mywallet_file.backup --home ${HOME}/.sentinelhub
```

#### Show All Balances Address

<pre class="language-bash"><code class="lang-bash"><strong>for mywallet in `sentinelhub keys list --home ${HOME}/.sentinelhub--output json| jq -r ".[] .address"`
</strong>do
   CHAIN_ID="sentinelhub-2"
   RPC="http://localhost:16704"
   sentinelhub q bank balances ${mywallet} --home ${HOME}/.sentinelhub --chain-id ${CHAIN_ID} --node ${RPC}
done
</code></pre>

#### Show Balance Address

```bash
sentinelhub q bank balances mywallet_public_address --home ${HOME}/.sentinelhub --chain-id sentinelhub-2 --node http://localhost:16704
```

### Validator Management

{% hint style="info" %}
We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### Create New Validator

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sentinelhub tx staking create-validator \
--amount=1000000udvpn \
--pubkey=$(sentinelhub tendermint show-validator --home ${HOME}/.sentinelhub) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=sentinelhub-2 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16704 \
--home ${HOME}/.sentinelhub\
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y
```

#### Edit Validator Identities Informations

```bash
MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sentinelhub tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=sentinelhub-2 \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16704 \
--home ${HOME}/.sentinelhub \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y
```

#### Get Validator Info

```
sentinelhub status 2>&1 | jq .ValidatorInfo
```

#### Get Syncing Block

```bash
sentinelhub status 2>&1 | jq .SyncInfo
```

#### Get Peer Own Node

```bash
echo $(sentinelhub tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.sentinelhub/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

#### Get Peer Node

```bash
curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Unjail Validator

```bash
sentinelhub tx slashing unjail \
--from mywallet \
--chain-id sentinelhub-2 \
 --home ${HOME}/.sentinelhub\
 --node  http://localhost:16704 \
 --gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
 -y
```

#### Jail Reason

```bash
sentinelhub query slashing signing-info $(sentinelhub tendermint show-validator) \
 --node  http://localhost:16704 \
 --home ${HOME}/.sentinelhub
```

#### List All Active Validator

```bash
sentinelhub q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### List All Inactive Validator

```bash
sentinelhub q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

#### Show Validator Details

```
sentinelhub \
query staking validator \
$(sentinelhub keys show \ 
                $(sentinelhub keys list --home ${HOME}/.sentinelhub--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id sentinelhub-2 \
--node http://localhost:16704
```

### Token Management

#### Withdraw All Reward From Validator

```bash
sentinelhub tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id sentinelhub-2 \
--node http://localhost:16704 \
--home ${HOME}/.sentinelhub\
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y
```

#### Withdraw Commision Reward From Validator

```bash
sentinelhub tx distribution withdraw-rewards $(sentinelhub keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id sentinelhub-2 \
--node http://localhost:16704 \
--home ${HOME}/.sentinelhub\
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 
```

#### Delegate My Token to Own Validator

```bash
sentinelhub tx staking delegate $(sentinelhub keys show wallet --bech val -a) 100000udvpn \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y
```

#### Delegate Your Token To Our Validator

```bash
sentinelhub tx staking delegate prefixVALOPExxxxxx 100000udvpn \ 
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y
```

#### Redelegate Tokens to Another Validator

```bash
sentinelhub tx staking redelegate $(sentinelhub keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000udvpn \
--from mywallet 
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 
```

#### Unbound or Unstake Your Tokens

```bash
sentinelhub tx staking unbond $(sentinelhub keys show wallet --bech val -a) 1000000udvpn \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 
```

Send tokens to the wallet

```
sentinelhub tx bank send wallet <TO_WALLET_ADDRESS> 1000000udvpn \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 
```

### Governance

{% hint style="info" %}
Install jq package for management json format

**Ubuntu**

`apt install jq`

**`CentOS`**

`yum install jq`

**Arch Linux**

`pacman -S jq`
{% endhint %}

#### List All Proposal

```bash
sentinelhub query gov proposals
```

#### How to Vote

```bash
### vote yes
sentinelhub tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 

### vote no
sentinelhub tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 

### vote abstain
sentinelhub tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 

### vote No With Veto
sentinelhub tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.sentinelhub\
--node http://localhost:16704 \
--chain-id sentinelhub-2 \
--gas=500000 --gas-prices=0.1udvpn --gas-adjustment=1.4 \
-y 
```


# Infrastructures


# Addresbook


# Endpoint Public

Endpoint Public dVPN Sentinel From RoomIT


# Genesis


# Peers


# Snapshot


# State Sync




---

[Next Page](/llms-full.txt/1)

