ethermint-archive icon indicating copy to clipboard operation
ethermint-archive copied to clipboard

web3 & contracts usage

Open konstantinzolotarev opened this issue 9 years ago • 6 comments

I'm trying to deploy new contract to ethermint using web3.js library.

And faced with this issues:

  1. last docker image of tendermint/ethermint is working but does not allow me to unlock account.

Code:

web3.personal.unlockAccount(account, '1234', (err) => {})

Returns:

Could not unlock account:  Error: The method personal_unlockAccount does not exist/is not available

Without unlock Im getting message:

Error: authentication needed: password or unlock

konstantinzolotarev avatar Mar 30 '17 12:03 konstantinzolotarev

personal API is not enabled by default, start ethermint smth like

--rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi "db,eth,web3,personal,admin,txpool"

illya13 avatar Apr 13 '17 09:04 illya13

Shouldn't it be in default docker image ? Otherwise it's useless because you couldn't use almost anything from ethermint.

konstantinzolotarev avatar Apr 13 '17 11:04 konstantinzolotarev

@konstantinzolotarev The goal is to be as similar as go-ethereum in its behaviour. I don't know whether it is enabled by default in their client though.

adrianbrink avatar Apr 13 '17 11:04 adrianbrink

https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options --rpcapi value API's offered over the HTTP-RPC interface (default: "eth,net,web3")

illya13 avatar Apr 14 '17 11:04 illya13

... and you can pass this as additional params to a docker image as well

illya13 avatar Apr 14 '17 11:04 illya13

An update has been pushed. The docker container defaults to starting with --rpcapi "eth,net,web3,personal,admin"

ebuchman avatar Apr 21 '17 06:04 ebuchman