-
Notifications
You must be signed in to change notification settings - Fork 6
How to build HPB full nodes in a quick manner through docker
Switch to root and enter the root password for permissions as prompted.
root@iZ8vbgcelr86h0i2rbfshaZ:/# su root
Download the mirror image via docker pull hpbbc/go-hpb.
root@iZ8vbgcelr86h0i2rbfshaZ:~# docker pull hpbbc/go-hpb
Using default tag: latest
latest: Pulling from hpbbc/go-hpb
Digest: sha256:3ecb483ca70883c390c55ceada92f7c0726e13afaebea2029dfe1c208dbe0094
Status: Image is up to date for hpbbc/go-hpb:latest
root@iZ8vbgcelr86h0i2rbfshaZ:~#
Enter docker images
to check if the image file hpbbc/go-hpb is already installed.
root@iZ8vbgcelr86h0i2rbfshaZ:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hpbbc/go-hpb latest a3ebf0866f79 5 weeks ago 42MB
ghpb v1.0.2.3 a3ebf0866f79 5 weeks ago 42MB
Type in mkdir -p /home/ghpb-bin/node/
root@iZ8vbgcelr86h0i2rbfshaZ:/# mkdir -p /home/ghpb-bin/node/
root@iZ8vbgcelr86h0i2rbfshaZ:/#
root@iZ8vbgcelr86h0i2rbfshaZ:~# wget https://raw.githubusercontent.com/hpb-project/hpb-release/master/config/gensis.json -P /home/ghpb-bin/node/
Type in mkdir -p /home/ghpb-bin/node/datafull/keystore
to upload a keystore file to the directory (For any keystore file, the encrypted private key file is used to start the node without any usage, as a result, a new one can be created).
root@iZ8vbgcelr86h0i2rbfshaZ:/# mkdir -p /home/ghpb-bin/node/datafull/keystore
Type in docker run -it --rm --privileged=true -v /home/ghpb-bin/node/:/root/node/ --name ghpbinit hpbbc/go-hpb:latest --datadir /root/node/data init /root/node/gensis.json
to initialize the configuration.
root@iZ8vbgcelr86h0i2rbfshaZ:/# docker run -it --rm --privileged=true -v /home/ghpb-bin/node/:/root/node/ --name ghpbinit hpbbc/go-hpb:latest --datadir /root/node/data init /root/node/gensis.json
INFO [11-01|09:48:41] HPB : Create New HpbConfig object
INFO [11-01|09:48:41] HPB : Allocated cache and file handles database=/root/node/data/ghpb/chaindata cache=16 handles=16
INFO [11-01|09:48:41] HPB : Writing custom genesis block
INFO [11-01|09:48:41] HPB : Successfully wrote genesis state database=chaindata hash=9c3704…f39966
Type in docker run -itd --privileged=true --restart=always -v /home/ghpb-bin/node/:/root/node/ -p 8545:8545 -p 30303:30303 -p 8546:8546 --name ghpb1 hpbbc/go-hpb:latest --datadir /root/node/data --networkid 100 --verbosity 3 --rpc --rpcaddr 0.0.0.0 --rpcapi hpb,web3,admin,txpool,debug,personal,net,miner,prometheus --nodetype synnode console
to start the nodes.
root@iZ8vbgcelr86h0i2rbfshaZ:/# docker run -itd --privileged=true --restart=always -v /home/ghpb-bin/node/:/root/node/ -p 8545:8545 -p 30303:30303 -p 8546:8546 --name ghpb1 hpbbc/go-hpb:latest --datadir /root/node/data --networkid 100 --verbosity 3 --rpc --rpcaddr 0.0.0.0 --rpcapi hpb,web3,admin,txpool,debug,personal,net,miner,prometheus --nodetype synnode console
ccab756a76b13a720b41c0bb7dd35383d36169dc3074e22d0b220170da7826ff
Type in docker attach ghpb1
to enter the console.
root@iZ8vbgcelr86h0i2rbfshaZ:/# docker attach ghpb1
INFO [11-01|09:55:46] HPB : UDP listener up self=hnode://e25f1e2aafcec4525e6c65c5b7dc8fb6e683711aa9b58bee92ab1651f9fa6bbeb37de7b0a61b8b533eb19e2e57f2decfca6bb9eb338e9926dbf8f30e64f1c1b3@[::]:30303
INFO [11-01|09:55:46] HPB : Server start with type. NodeType=SynNode
INFO [11-01|09:55:46] HPB : Start server of bandwidth test. port=30403
INFO [11-01|09:55:46] HPB : IPC endpoint opened url=/root/node/data/ghpb.ipc
INFO [11-01|09:55:46] HPB : HTTP endpoint opened url=http://0.0.0.0:8545 cors= vhosts=localhost,localhost
Welcome to the GHPB JavaScript console!
instance:
coinbase: 0xaed85c944a8a96c2714532b00676337e0d986811
at block: 0 (Thu, 23 Aug 2018 13:45:41 UTC)
datadir: /root/node/data
modules: admin:1.0 debug:1.0 hpb:1.0 miner:1.0 net:1.0 personal:1.0 prometheus:1.0 rpc:1.0 txpool:1.0 web3:1.0
>
Press Ctrl+p+q
to exit the current docker container console.。
INFO [11-01|10:08:10] HPB : Inserted new block number=656094 hash=67a92f…8b7b1a
INFO [11-01|10:08:10] HPB : Imported new chain segment blocks=1 txs=0 mgas=0.000 elapsed=7.058ms mgasps=0.000 number=656094 hash=67a92f…8b7b1a
######### peers length is: 2
read escape sequence
Type in docker logs -f ghpb1
to view the node log
root@iZ8vbgcelr86h0i2rbfshaZ:/# docker logs -f ghpb1
|中文(简体)版本 | |English Version|
Basics
R&D
- HPB-Consensus-Algorithm-Election-Mechanism
- HPB-BOE-Introduction
- HPB-Consensus-Algorithm--Compare
- HPB-Gas-Mechanism
- HPB-P2P-NetWork
- HPB-JSON-RPC-API-Index
- RLP-Agreement-Extended-Reading
- Interface-of-HPB-hardware-random-number-generator
- HPB-hardware-random-number-service
HPB Dapp Development
- Quick-Start-For-HPB-Developer
- HPB-Dapps-Introductions
- HPB-EVM-Contracts-Introductions
- HPB-Extended-Reading-on-EVM-Development
- An-Introduction-to-EVM-Virtual-Machines
- HPB-Smart-Contracts-Extended-Doc
- Best-Practice-of-Accessing-HPB-Main-Network-in-JS-version
- Best-Practice-of-HPB-Main-Network-Access-Java-Version
- Best-Practice-of-HPB-Smart-Contract
- Case-of-Transmission-from-Ethereum-DAPP-to-HPB-blockchain
- How-to-Write-a-Contract-Extended-Reading
- Development-Tool--Remix-Extended-Reading
- Solidity-Language-Extended-Reading
- Token-issuance-on-HPB-MainNet
- Migrating-a-Ethereum-DApp-to-the-HPB-MainNet
HPB Wallet Development
- An-Introduction-to-HPB-Wallet
- HPB-Wallet-for-Xcode-Integration
- Creating-the-HPB-Wallet
- Generating-Mnemonics-for-HPB Wallet
- HPB-Wallet-and-Middleware-Interface
HPB Mainnet/TestNet Entry
- HPB-Development-Node-Construction-Guild
- Guide-to-Server-Security-Reinforcement
- Build Node With Docker
- HPB-Private-Chain-Building-Guide
Developer Community