I have 2 contracts that i want to deploy them on the rinkeby network on geth.


Operting System: Windows 10

Truffle: v5.0.6

Node v10.13.0

Geth: 1.9.0-unstable

Network id: 1

Commands used to start geth ( with syncmode = light):

  1. geth --rinkeby --rpc --rpcapi="personal,eth,network,net,web3" --rpcport 8545 --rpcaddr --syncmode=light
  2. geth attach ipc:\.\pipe\geth.ipc

I have created an account on the rinkeby network and I unlock it before trying to use truffle migrate command.

  1. truffle migrate --reset --compile-all --network rinkeby
  2. personal.unlockAccount(eth.accounts[0], null,1200)

Checking the syncing status:

  1. eth.syncing -> returns "false"
  2. eth.getBlock('latest") -> returns the good value, very close to the one from the rinkeby network site: https://www.rinkeby.io/#explorer

Truffle configuration file: truffle-config.js

module.exports = {

  networks: {
      rinkeby: {
        host: "localhost",
        port: 8545,
        network_id: 1,
        gas: 470000

I have managed to deploy the same contracts using ganache, but I cannot deploy with geth.

The error:

After the command:

truffle migrate --reset --compile-all --network rinkeby

In the cmd console I only get the information about the contracts being compiled. The json files are generated and places in the build/contracts folder.

> Compiled successfully using:
   - solc: 0.5.0+commit.1d4f565a.Emscripten.clang

In the command line where geth continuously runs: ERROR:

INFO [03-04|10:51:22.715] Served eth_getBlockByNumber              conn= reqid=4 t=0s      err="context canceled"


I have started first the geth (initial download of blocks) using syncmode = fast and because it would never finish syncing I did it again with syncmode = light. Might this be an issue?

  • My advice would be to use the HDWallet provider in the truffle configuration, specify a seed and bypass the whole geth node requirement, and post your transactions already signed using a rinkeby node like infura or other public ones, Example config or use a fully synchronised node ( should take around 12 hours to complete and you'll know when you're close once eth.syncing returns knownStates: >= 85177882 ) – Micky Socaci Mar 4 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.