首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么web3.db.putString会抛出错误?

为什么web3.db.putString会抛出错误?
EN

Ethereum用户
提问于 2017-06-14 12:39:40
回答 1查看 299关注 0票数 1

每当我从Geth控制台尝试web3.db.putString("user","name","jon_lobo")命令时,它就会抛出以下的错误

错误:方法db_putString不存在/不在web3.js:3119:20在web3.js:6023:15在web3.js:4995:36 at :1:1

EN

回答 1

Ethereum用户

回答已采纳

发布于 2017-09-13 06:22:09

好像web3.db是在geth 1.4中删除的,我以前也遇到过同样的问题

代码语言:javascript
复制
> web3.db
{
  getHex: function(),
  getString: function(),
  putHex: function(),
  putString: function()
}
> web3.db.putString('testDB', 'key', 'myString')
Error: The method db_putString does not exist/is not available
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1

> web3.db.putHex('testDB', 'key', web3.fromAscii('myString'))
Error: The method db_putHex does not exist/is not available
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1

> web3.db.getString('testDB', 'key')
Error: The method db_getString does not exist/is not available
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1

> web3.db.getHex('testDB', 'key')
Error: The method db_getHex does not exist/is not available
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1

> web3.version
{
  api: "0.18.1",
  ethereum: "0x3f",
  network: "65535",
  node: "Geth/v1.6.1-stable-021c3c28/linux-amd64/go1.8.1",
  whisper: undefined,
  getEthereum: function(callback),
  getNetwork: function(callback),
  getNode: function(callback),
  getWhisper: function(callback)
}

我找到了答案:删除web3.db

希望能帮上忙

票数 1
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/17959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档