-
Notifications
You must be signed in to change notification settings - Fork 33
Deploy private chain
- clone efsn source code
git clone https://github.com/FUSIONFoundation/efsn.git
cd efsn
- modify efsn source code (to get ticket and balance in genesis block)
core/genesis.go : line 400
core/genesis_alloc.go : line 23
replace address `0x0122bf3930c1201a21133937ad5c83eb4ded1b08` to your address
- build the source code
make efsn bootnode
binaries will be in generated in `./build/bin` directory
- generate bootnode key
./build/bin/bootnode -genkey bootnode.key
- start bootnode
# bootnode.key is the file generated in the above step (step 4).
# you can change port number 40407 to others if conflict with other program
./build/bin/bootnode -nodekey bootnode.key -addr :40407 > bootnode.address 2>&1 &
- get the running bootnode's address
# bootnode.address is the file generated in the above step (step 5)
cat bootnode.address
bootnode.address
content is something like this:
INFO [11-07|17:05:37.719] UDP listener up self=enode://9237f5d9144f170817dc01a236fc31340e9b793fe62760aae89c9b1d91cb4033988dfca75642453399ed751f3dec2accff489540b26486e2633019b0cbdd5593@[::]:40407
the bootnode's address is enode://...@[::]:40407, you should replace [::]
with 127.0.0.1
.
for the above example, the final bootnode's address is
enode://9237f5d9144f170817dc01a236fc31340e9b793fe62760aae89c9b1d91cb4033988dfca75642453399ed751f3dec2accff489540b26486e2633019b0cbdd5593@127.0.0.1:40407
bootnode's address is required for multiple nodes to communicate with each other through bootnode.
- start fusion node
- start mining node
./build/bin/efsn --devnet --datadir node1 --port 12341 --bootnodes enode://9237f5d9144f170817dc01a236fc31340e9b793fe62760aae89c9b1d91cb4033988dfca75642453399ed751f3dec2accff489540b26486e2633019b0cbdd5593@127.0.0.1:40407 --rpc --rpcport 12001 --rpcapi web3,eth,net,db,personal,fsn,fsntx --rpcaddr 0.0.0.0 --rpccorsdomain \* --ws --wsport 13001 --wsapi web3,eth,net,db,personal,fsn,fsntx --wsaddr 0.0.0.0 --wsorigins \* --unlock 0x0122bf3930c1201a21133937ad5c83eb4ded1b08 --password passwd --networkid 55555 --mine --autobt 2>&1 |tee -a node1.log
- start syncing node
./build/bin/efsn --devnet --datadir node2 --port 12342 --bootnodes enode://9237f5d9144f170817dc01a236fc31340e9b793fe62760aae89c9b1d91cb4033988dfca75642453399ed751f3dec2accff489540b26486e2633019b0cbdd5593@127.0.0.1:40407 --rpc --rpcport 12002 --rpcapi web3,eth,net,db,personal,fsn,fsntx --rpcaddr 0.0.0.0 --rpccorsdomain \* --ws --wsport 13002 --wsapi web3,eth,net,db,personal,fsn,fsntx --wsaddr 0.0.0.0 --wsorigins \* --networkid 55555 2>&1 |tee -a node2.log
Note for options:
- you should use your own bootnode address in option
--bootnodes <YOUR-BOOTNODE-ADDRESS>
- you can change
--port --rpcport --wsport
these port numbers if it conflicts with other program. - you can also change your datadir name in option
--datadir <YOUR-DATA-DIR>
, block chain data will store in this directory. - you should specify your own account address to unlock option
--unlock <YOUR-ACCOUNT-ADDRSS>
- you should specify you own password file path to password option
--password <YOUR_PASSWORD-FILE>
- if you want to mining, you should specify
--mine
option - if you want to auto buy ticket, you should specify
--autobt
option
- check your node state you can attach to any running node, and execute commands in the concole
./build/bin/efsn attach node1/efsn.ipc
then input commads in the console,
(double press tab keyboard to completes command)
eg.,
eth.blockNumber
admin.nodeInfo
fsn.getStakeInfo()
fsn.getAllBalances(eth.coinbase)
personal.unlockAccount(eth.coinbase, null, 0)
miner.start()
additinal:
- generate new account
./efsn account new --datadir node2
it will generate a new keystore file in your specified datadir
(node2 in the above example)