Full node build

Set profile

Different people use different profiles in there environments. It's likely that by default you use .profile. You may also use something like .bashrc, or .zshrc. In your HOME directory type "ls -la" and look for one of these two. To see which shell you are running when the shell is opened you can add an echo statement to these files and see which one prints when you open your terminal.

In ~/.bashrc:

echo "This is .bashrc"

In ~/.zshrc:

echo "This is .zshrc"

In ~/.profile:

echo "This is .profile"

Set your profile variable here with whatever itialization file is printed upon opening your terminal shell:

export PROFILE_FILE=".profile"

Install Go

VERSION=1.21.7
wget -O go.tar.gz https://go.dev/dl/go$VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
echo 'export GOROOT=/usr/local/go' >> "$PROFILE_FILE"
echo 'export GOPATH=$HOME/go' >> "$PROFILE_FILE"
echo 'export GO111MODULE=on' >> "$PROFILE_FILE"
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> "$PROFILE_FILE"
source "$PROFILE_FILE"
go version

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 
source $HOME/.cargo/env

Install CometBFT

cd $HOME
mkdir cometbft
wget https://github.com/cometbft/cometbft/releases/download/v0.37.2/cometbft_0.37.2_linux_amd64.tar.gz
tar xvf cometbft_0.37.2_linux_amd64.tar.gz -C ./cometbft
chmod +x cometbft/cometbft
sudo mv cometbft/cometbft /usr/local/bin/
rm -rf cometbft*

In order to check that the installation was successful, you can run the following command

cometbft version

Which should output something like:

0.37.2

Install pcli

Install the current version of node binary.

USER="YOURUSER"

curl -O -L https://github.com/penumbra-zone/penumbra/releases/download/v0.67.1/pcli-x86_64-unknown-linux-gnu.tar.xz
unxz pcli-x86_64-unknown-linux-gnu.tar.xz
tar -xf pcli-x86_64-unknown-linux-gnu.tar
sudo mv pcli-x86_64-unknown-linux-gnu/pcli /usr/local/bin/

# confirm the pcli binary is installed by running:
pcli --version

# Move binary to your go bin
sudo mv /usr/local/bin/pcli /home/$USER/go/bin

Install pd

curl -O -L https://github.com/penumbra-zone/penumbra/releases/download/v0.67.1/pd-x86_64-unknown-linux-gnu.tar.xz
unxz pd-x86_64-unknown-linux-gnu.tar.xz
tar -xf pd-x86_64-unknown-linux-gnu.tar
sudo mv pd-x86_64-unknown-linux-gnu/pd /usr/local/bin/

# confirm the pd binary is installed by running:
pd --version

# Move binary to your go bin
sudo mv /usr/local/bin/pd /home/$USER/go/bin

Join the testnet:

pd testnet unsafe-reset-all
pd testnet join --external-address IP_ADDRESS:21956 --moniker $(openssl rand -hex 16)

where IP_ADDRESS (like 1.2.3.4) is the public IP address of the node you’re running, and MY_NODE_NAME is a moniker identifying your node. Other peers will try to connect to your node over port 26656/TCP.

If your node is behind a firewall or not publicly routable for some other reason, skip the --external-address flag, so that other peers won’t try to connect to it. You can also skip the --moniker flag to use a randomized moniker instead of selecting one.

This command fetches the genesis file for the current testnet, and writes configs to a testnet data directory (by default, ~/.penumbra/testnet_data). If any data exists in the testnet data directory, this command will fail. See the section above on resetting node state.

***********IMPORTANT NOTE**************

: /home/$USER/.penumbra/testnet_data/node0/cometbft/config

Set Your Chain and Port Prefix

Your chain in this case is Dymension. For Dymension, we want to set the port prefix as 205. The port prefix will be used to replace the first 2 or 3 digits of the original ports.

# Set the prefix 
export PREFIX=219

Update config.toml to use custom port 219

Next, we will update the Cometbft config.toml file. For 5-digit ports, the first 3 digits will be replaced. Here is how to calculate the new port values and update the config.toml file located at /home/$USER/.penumbra/testnet_data/node0/cometbft/config:

proxy_app = "tcp://127.0.0.1:21958"

[rpc]
laddr = "tcp://0.0.0.0:21957"

[p2p]
laddr = "tcp://0.0.0.0:21956"
external_address = "tcp://162.55.94.142:21956"

[instrumentation]
prometheus = true
prometheus_listen_addr = ":21960"

Running penumbra as a systemd service

The below makes a service file for systemd, which will run penumbra as a service. This is useful for running a node in the background, and also for auto-restarting the node if it crashes.

sudo nano /etc/systemd/system/penumbra.service
[Unit]
Description=Penumbra pd
Wants=cometbft.service

[Service]
# If both 1) running pd as non-root; and 2) using auto-https logic, then
# uncomment the capability declarations below to permit binding to 443/TCP for HTTPS.
# CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/home/$USER/go/bin/pd start --home /home/$USER/.penumbra/testnet_data/node0/pd --grpc-bind 0.0.0.0:21981 --abci-bind 127.0.0.1:21958 --metrics-bind 0.0.0.0:21900 --tendermint-addr http://127.0.0.1:21957
# Consider overriding the home directory, e.g.
# ExecStart=/usr/local/bin/pd start --home /var/www/.penumbra/testnet_data/node0/pd
WorkingDirectory=/home/$USER
User=$USER
# Raise filehandle limit for tower-abci.
# Consider configuring logrotate if using debug logs
# Environment=RUST_LOG=info,pd=debug,penumbra=debug,jmt=debug
Restart=always
RestartSec=3
LimitNOFILE=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=20
IOSchedulingClass=best-effort
IOSchedulingPriority=0
#LogNamespace=noisy
Nice=-10

[Install]
WantedBy=default.target

Running cometbft as a systemd service

The below makes a service file for systemd, which will run penumbra as a service. This is useful for running a node in the background, and also for auto-restarting the node if it crashes.

sudo nano /etc/systemd/system/cometbft.service
[Unit]
Description=CometBFT Penumbra

[Service]
ExecStart=/usr/local/bin/cometbft start --home /home/$USER/.penumbra/testnet_data/node0/cometbft
User=$USER
Restart=always
RestartSec=3
LimitNOFILE=infinity
Environment="DAEMON_NAME=penumbra_cometbft"
Environment="DAEMON_HOME=/home/$USER/.penumbra/testnet_data/node0/cometbft"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="UNSAFE_SKIP_BACKUP=true"
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=20
IOSchedulingClass=best-effort
IOSchedulingPriority=0
#LogNamespace=noisy
Nice=-10

[Install]
WantedBy=default.target

Enable the service with the below commands:

sudo systemctl daemon-reload
sudo systemctl enable penumbra.service
sudo systemctl enable cometbft.service

Now you can manage the node through systemd commands:

  • Run the node

sudo systemctl start penumbra
sudo systemctl start cometbft
  • Stop the node

sudo systemctl stop penumbra
sudo systemctl stop cometbft
  • Restart the node

sudo systemctl restart penumbra
sudo systemctl restart cometbft
  • Show node logs

sudo journalctl -u penumbra -f -o cat
sudo journalctl -u cometbft -f -o cat

Initiate Validator

Last updated

Logo

Made with ❤️ by WhisperNode // © 2024.