Skip to main content

Command-line Guide

There are menu related to node operations in the Transformers node program. The following is an introduction to the functions of each menu.

Run menu mode

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

./tfs_v1.x.x_xxxx_testnet -m 

1. Transaction

Enter your account address,the value of addr is the account address. right click to copy and paste the value of addr .

addr: 0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18

Don't copy and paste with [ctrl+c/v], because [ctrl+c] will exit the program.

Press 1 to enter the transaction interface.

Enter your own account address.

input FromAddr: 0x2A3526f605803526f7af2B268111897470BAe2F7

Input the address of the other account:

input ToAddress: 0xCA66A76E2a279050EF6b57797ac53199379abB9F 

Enter the amount of the transaction, which is any number within the range of your account balance. The input value is equal to the actual value, i.e. the number of coins:

input amount: 999 

Whether or not to search the whole network utxo status, 0 is not to search (default), 1 is to search

Whether to look for network-wide utxo status (1 means yes, 0 means no)
0

You can enter a description of the transaction, the description must not exceed 1kb, just enter means do not enter a description:

Enter a description of the transaction, no more than 1 kb

Enter,If successful, there are is below:

version:1
hash:0x5060e015d1bd3a405257281b0f983bc8261c392b88f8308ede9e73c4ebf40aae
prevhash:0x200af70947a42a56bad085c974a54f4aeebdabe53b2b8dd15435cfd8ea351d98
height:1654
merkleroot:be869fe3d2b116c4149e7882aeb71e5a7898e225a707ee4d688a19e2f8ca023d
========================================================================================================================
tx.version:1
tx.time:1705641787277056
sign_pre_hash.addr:0x6129C72769e37CEE31D11f6160FbF0A55ad4A000
sign_pre_hash.addr:0xa18b94231C58F24Ff45d756202063AA56900E2ca
sign_pre_hash.addr:0xa5818EdcBee321f479f8143ecddC28cceBf1c99D
sign_pre_hash.addr:0x6298D7a621bF8C37E74a51c6b3E9c788975d9cF1
sign_pre_hash.addr:0x2dfhD7a621bFhyK987HL51c6b3E9c788975d87GT
vin.sequence:0
prevout.hash:0xcccd0595b4d248aeacf45255231afd0672bd6e9ca53c8bd3eb11b1d23efcf19
prevout.n:0
prevout.hash:0xc7bb09cd5bb1a94833100121e5668798a2849381f056e03bca80b454c03c3b99
prevout.n:0
scriptSig.addr:0xd2e891144b5962E86f80c88Aa0faF53548a6849C
vout.scriptpubkey:0x7058dC8425224D48A5Ff08946a1BDa6D7D1BA881
vout.value:10000000000
vout.scriptpubkey:0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18
vout.value:6336851891307925
vout.scriptpubkey:VirtualBurnGas
vout.value:26600
tx.owner:0xd2e891144b5962E86f80c88Aa0faF53548a6849C,
tx.n:0
tx.identity:0xd2e891144b5962E86f80c88Aa0faF53548a6849C
tx.hash:0xbe869fe3d2b116c4149e7882aeb71e5a7898e225a707ee4d688a19e2f8ca023d
tx.data:
tx.info:
data:null
info:
time:1705641788018710
========================================================================================================================
block successfully packaged

2. Stake

Press 2 to enter the stake interface, and note that the staked account is your own native account,

Pledge amount [1000]:

stake addr: 0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18
Please enter the amount to stake:
1000

After filling in the stake amount, the validator sets the bonus percentage to be drawn.

Please input the bonus pumping percentage to stake (5 - 20):
10
0.20000000
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

There has been a pledge transaction before !
caution
  1. The minimum stake amount that the validator wants to participate in transaction verification is 10000
  2. Stake amount can be accumulated

The stake is completed,See changes in account balance.

3. Unstake

Press 3, Enter the Unstake interface.

Enter the Unstake account number.

Please enter unstake addr:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C

Then display the pledged utxo and paste the input to the console:

-- Current pledge amount: -- 
utxo: 7f8aefadd9c5fb8252935e9904cf8d52ccc2d8a4f40e77d345972e2b3160dabd value: 100000000000

utxo:7f8aefadd9c5fb8252935e9904cf8d52ccc2d8a4f40e77d345972e2b3160dabd
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

Complete the Unstake,See changes in account balance.

4. Delegate

Press 4 to enter the investment interface, (you can invest in other validator, or invest in yourself).

Enter the account address in which you participated in the investment.

AddrList:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C [default]
Please enter your addr:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C

Enter the validator account which you want delegate.

Please enter the addr you want to delegate to:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C

Enter the amount to be invested:

caution

The minimum investment amount is 55

Please enter the amount to delegate:
10000
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

Complete the investment,See changes in account balance.

5. Withdraw

Press 5 to enter the Withdraw investment.

Display the address list and enter the source address for the investment delegate.

Enter the investment account address:

AddrList : 
0xd2e891144b5962E86f80c88Aa0faF53548a6849C [default]
Please enter your addr:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C

Enter the validator address for the investment solution

Please enter the addr you want to withdraw from:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C

Input UTXO for investment resolution

======================================= Current delegate amount: =======================================
Utxo: 7a9d6cc6532b4246e6b9e8b3f832ca9701be872c13c0416a5df0367bee388418
======================================================================================================
Please enter the utxo you want to withdraw:7a9d6cc6532b4246e6b9e8b3f832ca9701be872c13c0416a5df0367bee388418
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

Enter return

Complete the Disinvest

6. Get Bonus

Press 6 to enter the UTXO for investment application.

The validator will automatically settle the rewards from the previous cycle, forming a dividend list:

Claim Addr : Claim Amount
0xa18b94231C58F24Ff45d756202063AA56900E2ca:296898287
0xa5818EdcBee321f479f8143ecddC28cceBf1c99D:14844914

Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

7. PrintAccountInfo

Press 7 to print the account information.

*********************************************************************************
Version: 1_1.0.0_d
addr: 0xd2e891144b5962E86f80c88Aa0faF53548a6849C
Balance: 8999.99940000
Block top: 70
*********************************************************************************

  • Version: Program version number.
  • Base58: The base 58 address of the program.
  • Balance: Balance for the corresponding Base 58.
  • Block top: Current validator block height.

This menu is used for querying changes in account balance after transfer, stake, unstake, delegate, and withdraw investments. Also used to check if the current validator height is synchronized with the Transformers network.

8. Deploy contract

Verifier deployment contracts require preparation of Remix tools and contract source code.

It is necessary to place the contract file in the current contract directory of the validator in advance. This includes the contract source code file(source.sol), contract ABI json file(abi.json), and the compiled contract file(contract).

Provide other documents according to your own needs, and the above three documents are necessary.

8

AddrList :
0xd2e891144b5962E86f80c88Aa0faF53548a6849C [default]
Please enter your addr:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0
Enter a description of the transaction, no more than 1 kb

Please enter contract path : (enter 0 use default path ./contract/contract)
0

After entering the above information, the command line box displays the encoded information of the contract after compilation.

Finally, input the input parameter, which usually context some basic information of the contract.


Please enter input data (enter 0 to skip):
0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000002797900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027979000000000000000000000000000000000000000000000000000000000000
packager: 0x7058dC8425224D48A5Ff08946a1BDa6D7D1BA881
**********VRF Generated the number end**********************

transaction:4cb93b5b624c9gedc6285f44ed3fdbffg27ed87b8fea27f4c6985c0f9385f0c4 successfully packaged
ContractAddress: 0x2ed6C5BAE92B86108914e75e16d3e66a46cA9109
EwnAddress: 0x2ed6C5BAE92B86108914e75e16d3e66a46cA9109

For more detailed contract related content, please read Deployment & Execution

9. Call contract

Press 9 to call contract.

Call contracts is generally used for transfer of contract tokens, mint, and other on chain operations, requiring input of [args] parameter values. The construction of args parameters needs to be generated through Remix tools or web3j code.

Please input your choice: 
9

AddrList :
0xd2e891144b5962E86f80c88Aa0faF53548a6849C [default]
Please enter your addr:
0xd2e891144b5962E86f80c88Aa0faF53548a6849C
=====================deployers=====================
deployer: 0xBAeFCEA23D55FB08539B702EF6537189B3F5fd93
deployer: 0x387C40c31D848695332e2742E419a8E75342CEff
=====================deployers=====================
Please enter to addr:
0x387C40c31D848695332e2742E419a8E75342CEff
=====================contract addresses=====================
contract address: 0x556BD73Ba62B3370838508113BDDee7546b46CFf
=====================contract addresses=====================
Please enter contract address:
0x556BD73Ba62B3370838508113BDDee7546b46CFf
Please enter args:
0xa9059cbb000000000000000000000000b9175950fa08b2fbd93ea1c836db70840c6cce6b000000000000000000000000000000000000000000000000000000000bebc200
input contract tip amount :
0
input contract transfer amount :
0
Whether to look for network-wide utxo status (1 means yes, 0 means no)
0

Example method for generating args:

Java code generation args

List<Type> inputList = new ArrayList<Type>();
String functionName ="transfer";
Address recipientAddress = new Address(toAddr);
Uint256 value = new Uint256(amount.toBigInteger());
inputList.add(recipientAddress);
inputList.add(value);
Function functions = new Function(functionName, inputList,
Arrays.asList(new org.web3j.abi.TypeReference<Address>() {
}, new org.web3j.abi.TypeReference<Uint256>() {
}));

String encodedFunction = FunctionEncoder.encode(functions);

Remix obtains args parameters:

After deploying the contract on Remix, the function list will appear. After entering the parameters value, click Calldata to copy args.

img

note

When constructing the args parameter, involves filling in the address all inputting the EVM address.

(The Address in remix and web3j is filled with the EVM address.)

10. Account Manager

Press 10 to display further menu list:

0xd2e891144b5962E86f80c88Aa0faF53548a6849C [default]

1. Set Default Account
2. Add Account
3. Remove
4. Import SeedKey
5. Export SeedKey
Please input your choice:
No.MenuFunction
1Set Default AccountSet the Default Account
2Add AccountAdd Account
3RemoveRemove Account
4Import SeedKeyImport seeds and generate accounts
5Export SeedKeyExport Seeds

1. Set Default Account

Press 1 to set default account

1
Please enter the address you want to set :
0xd2e891144b5962E86f80c88Aa0faF53548a6849C
Set Default account success

The account list is displayed on the menu option (one validator defaults to one address), and you can set the default account for the validator according to your needs.

2. Add Account

Press 2 to generate new accounts,validator support batch generation of multiple accounts.

2
Please enter the number of accounts to be generated: 1
Successfully generated account

After completion, you will find a newly generated account private key file in the cert file

ll cert

total 52
-rw-r--r--. 1 root root 119 Jan 19 14:28 0xa18b94231C58F24Ff45d756202063AA56900E2ca.private
-rw-r--r--. 1 root root 119 Dec 7 10:44 0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18.private

3. Remove

danger

This operation will delete the private key file. Do not operate unless necessary

Press 3 to delete account.

3
Please enter the address you want to remove :
0xf535227CCA5487776e666374c839de8b7005892B
Are you sure to delete (Y / N)
Y
0xf535227CCA5487776e666374c839de8b7005892B deleted successfully

After the operation is completed, the private key file of the address you entered will be deleted from the cert file.

4. Import SeedKey

Press 4 to import seed key.

4
Please input SeedKey string: 4e8979e347f18a6189299b8868209013

final pubStr 302a300506032b6570032100812d2f65796bf11858c4f93da3163a0fc3a3fef39f5757883d2f60258cc9535a
final priStr e47442732547417d33d2c764a78ecfd3f9c3af21ceeab09c272aae041ef83d90
bs58Addr repeat

After the import is completed, a private key file corresponding to the address will be generated in the cert file.

ll cert

total 52
-rw-r--r--. 1 root root 119 Jan 19 14:28 0xa18b94231C58F24Ff45d756202063AA56900E2ca.private
-rw-r--r--. 1 root root 119 Dec 7 10:44 0x9B7723CdBaaa04Eb63efC14676030F21F76Cda18.private

5. Export SeedKey

Press 5 to export seed key, seed (hexadecimal string), QR code and 12-digit mnemonic.

5


please input the addr you want to export
0xd2e891144b5962E86f80c88Aa0faF53548a6849C
addr: 0xd2e891144b5962E86f80c88Aa0faF53548a6849C
testat
Mnemonic: excess envelope juice morning board cotton caution cricket mask donate catch chat
seed key: 4e8979e347f18a6189299b8868209013
QRCode:

?????????????? ?????? ?? ?? ???? ??????????????
?? ?? ?? ?? ?? ?? ?? ?????? ???? ?? ??
?? ?????? ?? ?? ?????? ?? ?? ???? ?? ?????? ??
?? ?????? ?? ?????? ???? ?? ?? ?? ???? ?? ?????? ??
?? ?????? ?? ?? ?? ???? ?????????????? ?? ?????? ??
?? ?? ?? ???????????? ?? ?? ???????? ?? ??
?????????????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??????????????
???? ???????????????????????? ???? ??
?? ?????????? ???????? ???? ?? ?? ?? ???? ??????????
?? ?? ???? ???? ???? ?? ?? ???? ???? ?????? ????
?? ?? ???? ???? ?? ???????? ?? ?? ???? ?????? ??
???? ???? ?????????? ?? ?? ?????????? ?? ?? ?????? ??????
?? ?? ?? ?? ???? ?? ?? ?? ???????? ????
?? ?? ?? ???? ???????? ?? ?????? ?? ?? ????????
?? ???????? ???????? ?? ?? ?? ?? ???? ???????? ??
?? ???????? ?? ?? ?? ?? ?? ?? ???? ???? ?? ????
?? ???? ?? ?? ?? ?????????? ???? ???? ?? ??
?? ???? ???? ?? ?? ???? ?? ?????? ???? ??
???????? ?? ???? ?? ?? ?? ???? ?????????? ????
?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??
?? ?? ?????? ?? ???? ?? ?? ?? ?? ?? ?? ???????? ????
?? ?? ?? ?????? ???? ?? ?? ???????????? ?? ???? ??
???? ?? ?? ?????? ???? ???????? ?? ?? ??
?? ?? ?? ???? ?? ???? ?????????? ?? ?? ??
???? ?????? ?? ???????? ???? ?? ?? ?? ????
?? ???? ?? ???? ?? ???? ?????? ?? ???? ?????? ????
?? ?? ?? ???? ???????? ?? ?? ?? ???? ?????? ??
?? ?? ???? ???? ?? ?????????? ?? ?? ???? ?? ??
?? ?? ?????? ???? ?? ???? ???? ???????????? ??
?? ?? ?????? ???? ???? ?? ?? ?? ????
?????????????? ???? ?? ?? ?? ?? ?? ?? ??
?? ?? ?????????????? ?? ?? ?????? ???? ????
?? ?????? ?? ?????? ?? ?? ?????????? ???????????? ?? ??
?? ?????? ?? ?? ?? ???????? ???? ?? ????
?? ?????? ?? ?? ?? ?? ???? ???? ?? ?? ?? ??
?? ?? ???? ?????? ?? ?????? ?? ???? ?? ??
?????????????? ???? ?????? ?? ?? ?? ?? ?? ?? ???? ?? ????






You can also view above in file:0xd2e891144b5962E86f80c88Aa0faF53548a6849C.txt of current directory.

The current path will generate addr.txt file related account. You can copy it out, save account information, or use it to import relevant wallet apps

0. Exit

Type 0 and press Enter to exit the system.

0
Exiting, bye!

Backup data

Just backup the data.db as follows.

tar -cvzf data.db.tar.gz data.db
``