BCOS组网流程

第一个节点根目录:/nodes/bc01

mkdir -p /nodes/bc01/data

mkdir -p /nodes/bc01/log

mkdir -p /nodes/bc01/keystore

bcoseth --gennetworkrlp /nodes/bc01/data/network.rlp

cat /nodes/bc01/data/network.rlp.pub

结果:

a14e8837a86b42bbdb7edd672d06af4850232f1b8f5a988043ed71cb01f113549221b8c9971f5b183d46645469e18d174696f96b4f38c01b8076a49eb3972041

第一个节点的config.json:

{

"sealEngine": "PBFT",

"systemproxyaddress":"0x0",

"listenip":"127.0.0.1",

"rpcport":      "8545",

"p2pport":      "30303",

"wallet":"/nodes/bc01/keys.info",

"keystoredir":"/nodes/bc01/keystore/",

"datadir":"/nodes/bc01/data/",

"vm":"interpreter",

"networkid":"100",

"logverbosity":"4",

"coverlog":"OFF",

"eventlog":"ON",

"logconf":"/nodes/bc01/log.conf",

"params": {

"accountStartNonce": "0x0",

"maximumExtraDataSize": "0x0",

"tieBreakingGas": false,

"blockReward": "0x0",

"networkID": "0x0"

},

"NodeextraInfo":[

{

"Nodeid":"a14e8837a86b42bbdb7edd672d06af4850232f1b8f5a988043ed71cb01f113549221b8c9971f5b183d46645469e18d174696f96b4f38c01b8076a49eb3972041",

"Nodedesc": "test1",

"Agencyinfo": "test1",

"Peerip": "127.0.0.1",

"Identitytype": 1,

"Port":30303,

"Idx":0

}

]

}

第一个节点的genesis.json:

{

"nonce": "0x0",

"difficulty": "0x0",

"mixhash": "0x0",

"coinbase": "0x0",

"timestamp": "0x0",

"parentHash": "0x0",

"extraData": "0x0",

"gasLimit": "0x13880000000000",

"god":"0xbc45a3b978f790b3da82a62b525cee499f451c5e",

"alloc": {},

"initMinerNodes":["a14e8837a86b42bbdb7edd672d06af4850232f1b8f5a988043ed71cb01f113549221b8c9971f5b183d46645469e18d174696f96b4f38c01b8076a49eb3972041"]

}

然后,启动第一个节点:

bcoseth --genesis /nodes/bc01/genesis.json --config /nodes/bc01/config.json

看日志,已经成功在出块了。

你可能感兴趣的:(BCOS组网流程)