0

I am starting geth like the below command

geth --testnet --rpc --rpccorsdomain http://localhost:8089

and get the error db_putHex does not exist/is not available on this line:

web3.db.putHex(db, key, value);

What am I doing wrong?

0

You need to start Geth with the appropriate RPC APIs (as well as the flags you're already passing).

--rpcapi "db"

Though you'll probably also want others, for example:

--rpcapi "db,eth,net,web3"

Edit:

It's also worth noting that for db_putHex():

Note this function is deprecated and will be removed in the future.

So perhaps don't rely on it too much.

| improve this answer | |
  • I tried to run Geth with:geth --testnet --rpc --rpccorsdomain localhost:8089 --rpcapi "db,eth,net,web3", But the error still appears – Nomi Jul 20 '17 at 19:46
  • Do any of the DB commands work? It could be that it's already been deprecated/removed, but the documentation hasn't been updated... – Richard Horrocks Jul 20 '17 at 19:48
  • I see that I have a problem with the connection to the DB ,I'll check it out... thanks for the help! – Nomi Jul 21 '17 at 14:17

Your Answer

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

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