_alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -H nodeosd'
cleos get info_
After i run above commands, got this error:
_Host and port options (-H, --wallet-host, etc.) have been replaced with -u/--url and --wallet-url
Use for example -u http://localhost:8888 or --url https://example.invalid/_
As the error tells, i changed command to :
_alias cleos='docker-compose exec keosd /opt/eosio/bin/cleos -u http://localhost:8888/'
cleos get info_
and get this new error:
Error 3130001: Missing Chain API Plugin
Ensure that you have eosio::chain_api_plugin added to your node's configuration!
Error Details:
Chain API plugin is not enabled
I went back and check config.ini, it does enable chain_api_plugin. and from nodeos output logs, it shows chain_api_plugin is loaded.
chenxuechengdeMacBook-Pro:Docker rogershen$ docker-compose logs nodeosd | more
Attaching to docker_nodeosd_1
ESC[36mnodeosd_1 |ESC[0m 3491044ms thread-0 chain_plugin.cpp:103 plugin_initialize ] initializing chain plugin
ESC[36mnodeosd_1 |ESC[0m 3491044ms thread-0 chain_plugin.cpp:144 plugin_initialize ] Resync requested: wiping database and blocks
ESC[36mnodeosd_1 |ESC[0m 3491044ms thread-0 http_plugin.cpp:247 plugin_initialize ] configured http to listen on 0.0.0.0:8888
ESC[36mnodeosd_1 |ESC[0m 3491044ms thread-0 wallet_plugin.cpp:41 plugin_initialize ] initializing wallet plugin
ESC[36mnodeosd_1 |ESC[0m 3491045ms thread-0 wallet_api_plugin.cpp:112 plugin_initialize ]
I am trying to change command to this: _docker-compose exec nodeosd /opt/eosio/bin/cleos -u http://localhost:8888/ get info_ , and it works.
Could some body help update the document: https://github.com/EOSIO/eos/blob/master/Docker/README.md
It's because nodeosd is not located in the same container as keosd. The above command will work for read-only command, however, it won't work for a command that requires signing.
docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888/ <your cleos subcommand here> will solve the problem. The docker documentation has also reflected the change. Hope this helps :)
Great job
@andriantolie's alias works on my end, the wiki may be out of date: https://github.com/EOSIO/eos/wiki/Local-Environment#execute-cleos-commands
Most helpful comment
It's because nodeosd is not located in the same container as keosd. The above command will work for read-only command, however, it won't work for a command that requires signing.
docker-compose exec keosd /opt/eosio/bin/cleos -u http://nodeosd:8888/ <your cleos subcommand here>will solve the problem. The docker documentation has also reflected the change. Hope this helps :)