Skip to main content

Installations

Run a Validator

This article will guide you on how to run the Transformers application on CentOS7, ubuntu-22.04-desktop-amd64 operation system to join in Transformers network.

  • CPU: Recommend for Intel Pentium CPU series and above, core number 8 core and above.
  • Memory: Recommend for 16G And above
  • Hard Disk: Recommend for 500G with NVME protocol
  • Bandwidth: 100 megabit upstream and downstream

Software requirements:

  • Operation system:ubuntu-22.04-desktop-amd64 system.

Install Update and Dependencies

1. Download Binary

If you do not want to compile the source code for installation, please proceed directly to package installation.

Getting source code

cd $HOME
mkdir tfsc
cd tfsc
wget https://fastcdn.tfsc.io/formal/tfs_v1.0.2_524b745_primarynet.zip
unzip tfs_v1.0.2_524b745_primarynet.zip
rm -rf tfs_v1.0.2_524b745_primarynet.zip

Create Config FIle

./tfs_v1.0.2_524b745_primarynet -c
edit config file

Ensure that the time of each node is the same and that the transaction is reliable when it is linked

nano config.json
{
    "http_callback": {
        "ip": "",
        "path": "",
        "port": 0
        },
    "http_port": 20620,
    "info": {
        "logo": "",
        "name": ""
        },
    "ip": "192.168.1.1",
    "log": {
        "console": false,
        "level": "OFF",
        "path": "./logs"
        },
    "rpc": false,
    "server": [
        "13.52.162.66",
        "52.52.118.136"
        ],
    "server_port": 20619,
    "version": "1.0"
}

Modify config.json file

"server" field: This field fills in any ip node in the Transformers network,Obtain IP information of other nodes through the http://yournode:http_port/pub interface.

"server_port" field: This field is the network connection port number (it does not need to be changed by default)

"Log" field: "Console" indicates whether the log is output on the screen;"Level" indicates the level of output log;"Path" indicates the path of the default log generation.

"Ip": the system will detect the local ip and automatically fill in this field when starting.

"Http_port": the port of the http service.

"Rpc": the switch of the access interface, the interface can be accessed when it is turned on, and it is turned off by default.Introduction of specific application scenarios in Developers

"Info": the logo and name of the node set by the user.

"Http_callback": http callback interface,Introduction to specific application scenarios in Callback interfaces.

"Version": the version of the config file.

To view the automatically generated directories and files under the current directory.

cd  tfs_v1.0.x_xxxx_testnet
Files or directories Type Description
cert folder Store the generated private key with the suffix ".private" as a private key file
data.db folder Store database file
logs folder Store log file
config.json json file configuration file
tips:

Protect your private key

  1. The private key in the cert must not be lost.

Open corresponding port shall be port 20619、port 20620.

Start The Node

Directly start the program

./tfs_v1.0.x_xxxx_testnet 

Add parameter[ -m ] to start the program to display menu

./tfs_v1.0.x_xxxx_testnet -m 

Time display box

UTC time and server time display:

UTC Time: 2024/01/19 02:00:24
Ntp Time: 2024/01/19 02:00:24
ThreadNumber:265
caution

The validator server must be consistent with UTC time, and not synchronizing will result in the inability to verify transactions

Account display box

Account information display:

*********************************************************************************
Version: 1_1.0.0_d
addr: 0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18
Balance: 0.00000000
Block top: 0
*********************************************************************************

illustrate

  • Version: Version number of the program
  • addr: addr is a public and private key string generated by the keccak256 encryption algorithm, used for the address of the wallet.
  • Balance: Balance for the corresponding Base58.
  • Block top: The height of the current block.

Menu display box

  • Menu function display:
1.Transaction
2.Stake
3.Unstake
4.Delegate
5.Withdraw
6.Get Bonus
7.PrintAccountInfo
8.Deploy contract
9.Call contract
10.Account Manager
0.Exit
Please input your choice: 

Explain the function of the menu.

Order Menu Items Function
1 Transaction Validator provides command line transfer function, and can complete TTOS transfer according to prompts
2 Stake Becoming a validator node requires staking a certain amount of TTOS
3 Unstake Revoke your stake operation. Please understand the stake rules before revoking
4 Delegate Delegate TTOS to validators to obtain revenue,is equivalent to investing
5 Withdraw Revoke your investment in validators
6 Get Bonus The validator needs to claim its own rewards every day in order for delegators to receive their investment dividends
7 PrintAccountInfo Print account information,View your own balance changes and block heights
8 Deploy contract deployment smart contract
9 Call contract Execute smart contract
10 Account Manager 0. Exit
1. Set Default Account
2. Add Account
3. Remove
4. Import PrivateKey
5. Export PrivateKey
0 Exit Exit the program

As an RPC node

If you want your validator to act as an RPC node, it only takes a few simple steps to complete.

  • Modify the config.json file and set rpc to true
 "rpc": true,
  • Configure the value of http_port as the HTTP access port.
 "http_port": 20620,

Complete configuration example:
Enable RPC node service and set callback interface

{
    "http_callback": {
        "ip": "192.168.1.123",
        "path": "/path/rollback_block",
        "port": 6071
    },
    "http_port": 20620,
    "info": {
        "logo": "",
        "name": ""
    },
    "ip": "192.168.1.119",
    "log": {
        "console": false,
        "level": "debug",
        "path": "./logs"
    },
    "rpc": true,
    "server": [
        "192.168.1.217",
        "192.168.1.126"
    ],
    "server_port": 20619,
    "sync_data": {
        "count": 50,
        "interval": 50
    },
    "version": "0.39"
}

  • Restart the tfs program after the settings are complete

To test whether the RPC node is enabled, you can query the node information for detection.