1

I have a multi-node private chain and recently had to switch the networkId and the ChainID in the Genesis block to match in order to obey Metamask's requirements.

Now that I have made those changes and redeployed, it worked fine for me locally, but my Dockerized Geth nodes are not able to "Successfully sealed a new block" but is able to "Commit new mining work". Below is the following Dockerfile:

FROM ethereum/client-go:v1.7.2

RUN mkdir -p /root/myChain/
WORKDIR /root/myChain

COPY Genesis.json /root/myChain/

RUN geth \
    --identity "myChainNode" \
    init \
    --datadir "/root/.ethereum/myChain/" \
    "/root/myChain/Genesis.json" \
    --ipcdisable \
    --mine --autodag --networkid 777 --nat "any" --gasprice "3000000"

EXPOSE 30303
EXPOSE 8545


ENTRYPOINT geth \
    --identity "myChainNode" \
    --datadir "/root/.ethereum/myChain/" \
    --ipcdisable \
    --networkid 777 \
    --rpcapi eth,web3,net,personal \
    --rpc --rpcaddr "0.0.0.0" --rpcport "8545" \
    --rpccorsdomain "*" \
    --nat "any" \
    --port "30303" \
    --etherbase "<myPublicAddress>" \
    --ws --wsport "8546" --wsaddr="0.0.0.0" --wsorigins "*" \
    --mine \
    console

When I miner.start() or miner.start(8) the response is null I am connected to peers in my private chain and my hashrate is still 0.

AWS has the appropriate 30303 and 8545 ports open for my EC2 running it.

My local node is mining beautifully and it's run script looks like the following:

sudo geth \
    --identity "myChainNode" \
    --datadir "~/Library/Ethereum/myChain" \
    --ipcdisable \
    --etherbase "<myPublicAddress>" \
    --networkid 777 \
    --rpcapi eth,web3,net,personal \
    --rpc --rpccorsdomain "*" \
    -rpcport "8545" \
    --verbosity 3 \
    --ws --wsport "8547" --wsorigins "*" \
    --mine \
    console

Any thoughts?

2 Answers 2

3

I found out the reason this happened is that of the following:

When I first created the Private chain, I had run the initialization with a different networkId. As I talked about in the comments, I ended up changing it because of metamask requirements for CustomRPCs to have the networkID and the chainID match.

If you decided to change your NetworkID after starting your chain, you need to make sure that Geth Init uses your original NetworkID and then when you run/open your Geth node you put your new NetworkID. The chain was initialized on all your other nodes and it will not mine correctly since it cannot seal without having the same init config.

1

A miner requires an unlocked account for sealing. It seems that you forgot to unlock account.

6
  • You don't need the account unlocked for it to seal them. I have verified it on other nodes. In fact, you don't need to even have any accounts loaded into the web3.personal, you only need to set the Etherbase/Coinbase to the address of your choosing...
    – aquamanSam
    Mar 24, 2018 at 22:35
  • But this answer and my own setup make me think otherwise :/ But still, I would get back after confirming myself.
    – Ayushya
    Mar 25, 2018 at 7:14
  • Interesting, I would think it isn't the case that you would need to unlock any account in order to mine. I would compare it to working at a company, you give the company your bank account number for them to airdrop money into but you do not need to login in order to do the work. In either case, I have proved through testing on my end to be true. I wish I could give you a Proof of Work hash haha.
    – aquamanSam
    Mar 26, 2018 at 22:02
  • I have confirmed by the following msg WARN [03-27|06:49:17] Block sealing failed err="authentication needed: password or unlock"
    – Ayushya
    Mar 27, 2018 at 7:01
  • 1
    Its probably the consensus. It might be required for POA. Did u use POA?
    – Ayushya
    Mar 28, 2018 at 4:12

Your Answer

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

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