1

I have been having issues deploing any smart contract to my private network.

I'm using geth 1.9.15.

Here ALL the steps that I made to get the error:

//CustomGenesis.json
{
  "config": {
    "chainId": 48,
    "homesteadBlock": 0
  },
  "difficulty": "0x40",
  "gasLimit": "0x80000000",
  "alloc": {}
}

I have started two nodes:

geth --identity "node1" --datadir ./node1 init ./CustomGenesis.json
geth --identity "node2" --datadir ./node2  init ./CustomGenesis.json

nohup geth --identity "node1" --datadir ./node1 --networkid 48 &
nohup geth --identity "node2" --datadir ./node2 --networkid 48 --port 30305 --http &

Attached the peers:

# geth attach ./node1/geth.ipc
Welcome to the Geth JavaScript console!

> admin.addPeer("enode://[...]:30305")
true

Created the account:

> personal.newAccount()
Passphrase:
Repeat passphrase:
"0xdc[...]b5"

Started the miner on the second node:

# geth attach ./node2/geth.ipc
Welcome to the Geth JavaScript console!

> miner.setEtherbase("0xdc[...]b5")
true
> miner.start()
null

On the first node:

> personal.unlockAccount("0xdc[...]b5","Password")
true
> var contract = eth.contract([{...ABI DATA...}])
undefined
> var bin = "0x...BIN DATA..."
undefined
> var x = {from:eth.coinbase, data:bin, gas: 2000000}
undefined
> var instance = contract.new(x)
Error: invalid transaction v, r, s values
        at web3.js:6347:37(47)
        at web3.js:5081:62(37)
        at web3.js:3021:48(134)
        at <eval>:1:28(6)

I don't think the issues are related but I also tried with truffle without success.

Configuration file:

//truffle-config.js
module.exports = {
  rpc: {
      host:"127.0.0.1",
      port:8545
  },
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "48",
      from: "0xdc[...]b5",
      gasPrice: 100000000000,
      gas: 47123880
    }
  }
}

Deploy file:

//2_deploy_contracts.js
var contract = artifacts.require("contract");

module.exports = function(deployer) {
        deployer.deploy(contract,0,"TEST","TST");
};

But when it runs:

# truffle migrate --reset
Starting migrations...
======================
> Network name:    'development'
> Network id:      48
> Block gas limit: 1715282554 (0x663d227a)


1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- Returned error: unknown account.

What did I did wrong?
I haven't found any useful information elsewere as seems that all the related question are from 2016.

  • Can you try with a small chainId? – Ismael Jun 17 at 15:24
  • @Ismael I have tried replacing the chain id with 9867 but the error is still the same. Is 9867 small enough? – Giacomo Garabello Jun 17 at 16:25
  • Try something in the range 1 to 50. – Ismael Jun 18 at 2:52
  • @Ismael i have tried with 48 with geth and truffle but again, no luck. I've updated the question to reflect the new chainID – Giacomo Garabello Jun 18 at 9:45

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.