以太坊问题

Error: The method eth_getCompilers does not exist/is not available

因为以太坊高版本中该API被废弃

 

TypeError: web3.eth.contract is not a function 

因为1.0以后API废弃

TypeError: web3.eth.contract is not a function · Issue #382 · trufflesuite/ganache-cli

 

Error: Returned error: authentication needed: password or unlock

用户被锁定

personal.unlockAccount("0x....", "password");

 

TypeError: web3.eth.accounts is not a function

web3.eth.getAccounts()

 

(node:30706) UnhandledPromiseRejectionWarning: Error: Returned error: unknown account

地址不存在。

 

Error: The contract code couldn't be stored, please check your gas limit.

参数中添加gas

send({
   from: '0x104847cdbaccb429d691145c19a5678353878e0c',
   gasPrice: '1490000',
   gas:3144658
})

 

(node:30475) UnhandledPromiseRejectionWarning: Error: Returned error: insufficient funds for gas * price + value
    at Object.ErrorResponse (/opt/workspace/web3/node_modules/web3-core-helpers/src/errors.js:29:16)
    at /opt/workspace/web3/node_modules/web3-core-requestmanager/src/index.js:140:36
    at XMLHttpRequest.request.onreadystatechange (/opt/workspace/web3/node_modules/web3-providers-http/src/index.js:77:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/opt/workspace/web3/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/opt/workspace/web3/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/opt/workspace/web3/node_modules/xhr2/lib/xhr2.js:509:12)
    at IncomingMessage.<anonymous> (/opt/workspace/web3/node_modules/xhr2/lib/xhr2.js:469:24)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

是因为chainId为0, 修改为其他值即可。

{
  "config": {
        "chainId": 100,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

转载于:https://my.oschina.net/kingwjb/blog/1861489

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值