banner
卡卡

卡卡

why so serious?

Titan Testnet Incentive Program

image

Official website: https://www.titannet.io/en/index.html
Official documentation: https://titannet.gitbook.io/titan-network-en

Machine configuration used in this article:
1 core 1GB
Linux Ubuntu 22.04 system

0x00: Download the official code repository and extract it#

# Download
wget https://github.com/Titannet-dao/titan-node/releases/download/v0.1.16/titan_v0.1.16_linux_amd64.tar.gz

# Extract
tar -xzvf titan_v0.1.16_linux_amd64.tar.gz

# Enter the project root directory
cd titan_v0.1.16_linux_amd64/

0x01: Start the node#

(Don't execute yet, read in conjunction with 0x02!)

# Since the project root directory is not added to the environment variable, need to specify with ./
./titan-edge daemon start --init --url https://test-locator.titannet.io:5000/rpc/v0

After executing this command, the program is already running. However, this runs directly in the terminal, and if you close the terminal or disconnect from the server, the program will stop. Therefore, you need to run the program in the background. Below is how to use the pm2 tool to daemonize this command and run it in the background.

0x02: Execute in the background#

To make it easier, write a shell script to execute the command mentioned in 0x01. Then use the pm2 tool to daemonize this shell script.

1. Write the shell script#

vi is a terminal text editing tool in Linux systems.
Execute vi run.sh to create the file. Press i to enter edit mode, and input or paste the script:

#!/bin/bash

./titan-edge daemon start --init --url https://test-locator.titannet.io:5000/rpc/v0

Press ESC to exit edit mode.
Then press :wq to save and exit.

Make the run.sh file executable: chmod +x run.sh

2. pm2 daemonize the process#

pm2 is a popular Node.js process management tool that can simplify the deployment, monitoring, and management of Node.js applications. It can also perform the same operation on shell files.

# Install pm2
sudo apt update
sudo apt install nodejs
sudo apt install npm
npm install -g pm2
# Daemonize run.sh and give it an alias:
pm2 start run.sh --name titan
# Other operations:
pm2 list  # List processes managed by pm2
pm2 stop titan  # Stop run.sh from running
pm2 start titan # Start

0x03: Apply for an identity code#

Follow the official tutorial for this step.
My invitation code: ZYkTSc 🤝

0x04: Bind the identity code#

# Replace "your-hash-here" with the identity code you applied for
./titan-edge bind --hash=your-hash-here https://api-test1.container1.titannet.io/api/v2/device/binding

Note:

  1. The identity code will change;
  2. After starting the node, you need to bind once;

After binding the identity code, you can check the console to see if the device is online. You may need to wait a bit as there may be a delay.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.