0

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"
      }
   }
}
4
  • Did you start the miner?
    – ivicaa
    Feb 21, 2018 at 13:31
  • Yes.. Could it be a nonce issue... I am using random nonce for this Feb 21, 2018 at 16:52
  • For sending transactions* Feb 21, 2018 at 16:53
  • 2
    Your nonce has to be strictly sequential. Which means that your first nonce has to be 0 and next nonce has to be +1 of your last transaction.
    – ivicaa
    Feb 21, 2018 at 16:54

2 Answers 2

0

Maybe it's a bit old but I faced the same issue and resolved it by cleaning my transaction history of metamask. Following this thread : https://github.com/MetaMask/metamask-extension/issues/1999

0

The reason is that I'm supplying arbitrary nonce in the sendTransaction method. Instead, nonce is decided automatically by geth, and it should be in a sequence. Geth internally maintains the nonce sequence and automatically supplies the next number to it. So you can Omit the nonce in the sendTransaction Method.

eth.sendTransaction({from:"39408873c54f3d8efe67c43532ac3b3b5db7fb7f", to: "11f53eb1649af91da0af06d84700a33919febe9e",value: "250",gasPrice:20 , gas: 21000 )});

This should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.