Pactus
Run the node using Docker or SystemD
Recommended Hardware Requirements
SPEC | Recommend |
---|---|
CPU | 4 Cores |
RAM | 4GB RAM |
SSD | 100 GB |
- 🖼️ Docker
- 🖼️ SystemD
Install Docker
sudo apt update && sudo apt upgrade -y
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
1/ Pull image Pactus
docker pull pactus/pactus
2/ Create new wallet
docker run -it --rm -v ~/pactus:/root/pactus pactus/pactus pactus-daemon init
- Select: Y
- Save wallet seed
- Number of Validators: 1
- Save Validator Address and Reward Address
3/ Fill password
- Change passwd_wallet
passpactus=passwd_wallet
4/ Run node
docker run -it -d -v ~/pactus:/root/pactus --network host --name pactus pactus/pactus pactus-daemon start --password $passpactus
5/ Check version
docker exec -it pactus pactus-daemon version
6/ Check log node
docker logs pactus -f
7. Change Config.toml
nano $HOME/pactus/config.toml
Before
[sync]
moniker = ""
session_timeout = "10s"
node_network = true
[logger.levels]
_consensus = "warn"
_grpc = "info"
_http = "info"
_network = "error"
_nonomsg = "info"
_pool = "error"
_state = "info"
_sync = "error"
default = "info"
After
- Edit moniker = "" --> "Node name of you"
[sync]
moniker = ""
session_timeout = "10s"
node_network = true
- Edit network = "error" --> "info"
[logger.levels]
_consensus = "warn"
_grpc = "info"
_http = "info"
_network = "info"
_nonomsg = "info"
_pool = "error"
_state = "info"
_sync = "error"
default = "info"
8/ Restart node
docker restart pactus
9/ Check Peers ID.
docker logs -f pactus
1. Update system and install build tools
sudo apt update && sudo apt list --upgradable && sudo apt upgrade -y
2. Additional package:
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu net-tools -y
3. Install go
ver="1.21" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
4. Install binary & build binary
cd $Home
git clone https://github.com/pactus-project/pactus.git .pactus
cd .pactus
make build
cd build
For new wallet
./pactus-daemon init
For recover wallet
./pactus-daemon init --restore "Your seed phrase"
5. Create & start service
tee /etc/systemd/system/pactusd.service > /dev/null << EOF
[Unit]
Description=pactus Node
After=network-online.target
StartLimitIntervalSec=0
[Service]
User=root
ExecStart= /root/.pactus/build/pactus-daemon start --password "Your pass"
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable pactusd
sudo systemctl restart pactusd && journalctl -f -u pactusd
6. Change Config.toml
nano $HOME/pactus/config.toml
Before
[http]
enable = false
listen = "127.0.0.1:80"
After
[http]
enable = true
listen = "0.0.0.0:80"
sudo systemctl stop pactusd
sudo systemctl restart pactusd
Check node ID.
http://your_ip_node:80/node