eos icon indicating copy to clipboard operation
eos copied to clipboard

Keosd not working via http rpc

Open aozertsov opened this issue 8 years ago • 6 comments

Run eosio as docker images. Set wallet to 8900 port. Try to see wallet_list via rpc, but there is error:

curl: (56) Recv failure: Connection reset by peer

This works fine via cleos, but via rpc this is an error. How can I solve this?

aozertsov avatar Aug 22 '18 12:08 aozertsov

any logs from the server side?

taokayan avatar Aug 23 '18 02:08 taokayan

Getting similar error with cleos. Can create wallets, but cannot list them.

dskvr avatar Aug 23 '18 07:08 dskvr

I start eosio as a docker container. keosd container show only standart logs:

2018-08-22T12:09:18.075 thread-0 http_plugin.cpp:344 plugin_initialize ] configured http to listen on 127.0.0.1:8900 2018-08-22T12:09:18.076 thread-0 wallet_plugin.cpp:42 plugin_initialize ] initializing wallet plugin 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/keosd/stop 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:401 plugin_startup ] start listening for http requests 2018-08-22T12:09:18.076 thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/create 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/create_key 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/get_public_keys 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/import_key 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/list_keys 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/list_wallets 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/lock 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/lock_all 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/open 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/remove_key 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/set_timeout 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/sign_digest 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/sign_transaction 2018-08-22T12:09:18.076 thread-0 http_plugin.cpp:447 add_handler ] add api url: /v1/wallet/unlock

@taokayan is it anough logs, or You need another?

aozertsov avatar Aug 23 '18 08:08 aozertsov

@dskvr No, I can list wallets via cleos, but with http rpc there is a problem

aozertsov avatar Aug 23 '18 08:08 aozertsov

Fix it by setting http-server-address = 0.0.0.0:8900. But as I know, this is unsafe. Can I use another ip, for example localhost?

aozertsov avatar Aug 23 '18 09:08 aozertsov

If you want to be able to access the HTTP RPC from outside the docker container, there are some changes you must make.

Retain the all-interfaces configuration change for keosd you now have.

Edit the docker-compose.yml and in the keosd: section, add:

    ports:
      - 8900:8900
    expose:
      - "8900"

In your docker command line, add --publish=127.0.0.1::8900. This should tell docker to create iptables rules for that container's port 8900 only on the host OS's localhost, preventing the worst of the unsafe exposure. You should inspect the host's iptables with iptables -L nat -L -n. Look for the Chain DOCKER sections and verify that docker has not exposed the container ports on 0.0.0.0/0.

jgiszczak avatar Aug 24 '18 19:08 jgiszczak