本客服平台由提供产品服务

HPB Lightnode Public Testing Operation Manual

HPB小秘书发表于:2018年04月03日 21:47:12更新于:2018年04月03日 22:23:11

Our Operation is based on Ubuntu 16.04 x64


I. Setup HPB nodes:

1. Download the latest version of the code at your working environment 

cd /home/gopath/src

git clone https://github.com/hpb-project/ghpb-testnet

After completion, as shown in the figure:

0015ac339345a7bf98f15db3abe372b

0015ac3394b7ba0195cb2c5b60c172e

 

2. Build Project (targets: bootnode, promfile and ghpb)

cd ghpb-testnet/

make all (or respectively make ghpb, make bootnode, make ghpb)

cd build/bin

0015ac33960b90eacf35fe28afc5f4c

After completion, there should be three executable files (The directory: /home/gopath/src/ghpb-testnet/build/bin).


3. Create an account

./ghpb --datadir node/data account new

(Creating an account requires a password, e.g.“123”,  which finally outputs an address)

0015ac33982bf3df4e26813e47fc2b9

Record the address:

addr1: 0x 4b101015e998e040f361686e58089197e1f5dff4

 

4. Initialize Genesis file

Move Genesis document to the specified path:

mv /home/gopath/src/ghpb-testnet/gensis.json /home/gopath/src/ghpb-testnet/build/bin/

0015ac339a73eb8e09f3da8414f577f

Initialize Genesis file

./ghpb --datadir node/data init gensis.json

0015ac339cfb9d3b960d431d1b2dce3

5. Set a random number,

Method1:

Set the random number by self, e.g. “123”(Random number is originated from the new consensus algorithm, in order to improve privacy)

./ghpb -datadir node/data initrand 123

0015ac339e82939b39bdc6677a991f1

Method 2:

Use the default random number, that is to enter the console to get the random number.

./ghpb -datadir node1/data console  (Enter the console of the first node)

prometheus.getPrivateRandom()  (Take a random number)

Now the random numder is:

e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

0015ac339f8e28e6f8b53e7509a78d0

exit   (Exit console)

 

6. Enter the console

./ghpb -datadir node/data --networkid 66500 console

0015ac33a29a12d97b47b78ab5f90ea

Please wait a brief moment to see the synchronizing information 

0015ac33a3e0f9c941ff2b31c1b9058

II. Common commands of the console

1.   Common instructions

 Create a new account

      personal.newAccount

Get the account

      personal.unlockAccount("0x...")

Account unlock           

      personal.unlockAccount("0x...")

Send transaction (need to unlock)

      hpb.sendTransaction({from:"0x...", to:"0x...", value: web3.toWei(100, "ether")})

Get account balances

      hpb.getBalance("0x...")

Get account random number

      prometheus.getPrivateRandom()

 

2. Instruction Summary

If you want the “hpb” sub command, enter ‘hpb’ under the console . Command as follows:

(‘hpb’ contains the general commands for HPB chain)

 0015ac33a7e682debbc52bbb42bb019

If you want the ‘personal’ sub command, enter ‘hpb’ under the console. Command as follows:

(‘personal’ contains the node account related commands)

0015ac33a9a8311bdfc8162fe9a585b

If you want the  ‘promethues’ sub command, enter ‘hpb’ under the console. Command as follows:

 

(‘promethues’ contains the consensus algorithm related commands)

 

Note:

The public testing nodes are designated as the type of light nodes (Lightnode). The node in the public testing process does not have any amount.

Please claim HPB testnet tokens here

(First send test node account address). We will recharge a certain amount of tokens to make your test smooth. Thank you for your participation. Have fun with HPB Testnet! 


HPB(芯链)