I have started two nodes with same genesis.json
on same machine in a same directory. I followed the following steps:
./geth --datadir ./chaindata/ --port 30303 --networkid 15525 --rpc --rpcport 8545--rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "web3,eth,personal,net" console
and then the second node (ran this command on same machine in same directory):
./geth --datadir ./chaindata2/ --port 30304 --networkid 15525 --rpc --rpcport 8546 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "web3,eth,personal,net" console
PLESE NOTE THAT THE PORT, RPC PORT , AND DATA DIRECTORY ARE DIFFERENT IN THE TWO
Then, found the node id of the second one by admin.nodeInfo
and added it as a peer in the other console with admin.addpeer
admin.addPeer("enode://f583bdf4e0e56818b920041a0588ba415352fa155935f04fbe287f2e2d111047a2f7e7b15c156d160b2afbbdde46081cf6aa6a73dbdbefddb99a8ebb01e03de3@127.0.0.1:30303")
Now Unlocked an account (with pre-allocated balance) and sent transaction:
eth.sendTransaction({from:"39408873c54f3d8efe67c43532ac3b3b5db7fb7f", to: "11f53eb1649af91da0af06d84700a33919febe9e",value: "250",gasPrice:20 , gas: 21000, nonce: 150 )});
But txpool.status
shows the following:
{
pending: 0,
queued: 5
}
And when I call the eth.getTransaction("0x5aded5...")
, The block number field is null
.
Also txpool.status
on the second node shows
{
pending: 0,
queued: 0
}
However the blocks are succesfully synchronized, and the mining is successfully done. For Information : Here is my genesis.json
{
"config": {
"chainId": 1994,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0
},
"difficulty": "4", // PLEASE NOTE !!!
"gasLimit": "2000000",
"alloc": {
"39408873c54f5b8efe67c4353d4c3b3b5db7fb7f": {
"balance": "100000000000000000000000"
},
"ae13d41d66af2d380c7af6d825ab557eb271ffff": {
"balance": "120000000000000000000000"
}
}
}