5

I am trying to deploy a contract to the jungle testnet. I get the following error -

cleos wallet import -n trevor5 5KcFCgZiixiZ69dyA5u3......RBQtZ "/usr/local/bin/keosd" launched Unable to connect to keosd, if keosd is running please kill the process and try again. ~/Projects/EOS/eos/build/programs/keosd$

I kill keosd and then try again. I get the same error message and keosd seems to startup again.

Has anyone any idea how to solve this?

A few comments to give more details following the response to my question -

config.ini -

# The local IP and port to listen for incoming http connections; set blank to disable. (eosio::http_plugin)
http-server-address = 127.0.0.1:8888

# The local IP and port to listen for incoming https connections; leave blank to disable. (eosio::http_plugin)
# https-server-address = 

# Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin)
# https-certificate-chain-file = 

# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
# https-private-key-file = 

# Specify the Access-Control-Allow-Origin to be returned on each request. (eosio::http_plugin)
# access-control-allow-origin = 

# Specify the Access-Control-Allow-Headers to be returned on each request. (eosio::http_plugin)
# access-control-allow-headers = 

# Specify the Access-Control-Max-Age to be returned on each request. (eosio::http_plugin)
# access-control-max-age = 

# Specify if Access-Control-Allow-Credentials: true should be returned on each request. (eosio::http_plugin)
access-control-allow-credentials = false

# The maximum body size in bytes allowed for incoming RPC requests (eosio::http_plugin)
max-body-size = 1048576

# Append the error log to HTTP responses (eosio::http_plugin)
verbose-http-errors = false

# If set to false, then any incoming "Host" header is considered valid (eosio::http_plugin)
http-validate-host = 1

# Additionaly acceptable values for the "Host" header of incoming HTTP requests, can be specified multiple times.  Includes http/s_server_address by default. (eosio::http_plugin)
# http-alias = 

# The path of the wallet files (absolute path or relative to application data dir) (eosio::wallet_plugin)
wallet-dir = "."

# Timeout for unlocked wallet in seconds (default 900 (15 minutes)). Wallets will automatically lock after specified number of seconds of inactivity. Activity is defined as any wallet command e.g. list-wallets. (eosio::wallet_plugin)
unlock-timeout = 900

# Plugin(s) to enable, may be specified multiple times
# plugin = 

I get the keosd apparently seeking to listen on 8900 which is different to the port in config.ini.

cleos wallet import -n trevor5 5KcFCgZiixiZ69dyA5u39SG...8drWEXrRBQtZ
"/usr/local/bin/keosd" launched
Unable to connect to keosd, if keosd is running please kill the process and try again.
~/Projects/EOS/eos$ ps aux | grep keosd
satoshimaca       1180   0.0  0.0  4267752    764 s000  R+   10:05am   0:00.00 grep keosd
satoshimaca       1170   0.0  0.1  4291748   6768 s000  S    10:04am   0:00.02 /usr/local/bin/keosd --http-server-address=::1:8900
~/Projects/EOS/eos$ 

Here is my filelist -

~/Projects/EOS/eos$ ls
CMakeLists.txt      debian          programs
CMakeModules        docs            scripts
Docker          eos.doxygen.in      testnet.md
HEADER          eosio_build.sh      testnet.template
LICENSE.txt     externals       tests
README.md       images          tools
build           libraries       tutorials
contracts       plugins         unittests
~/Projects/EOS/eos$ 

The config.ini file is actually under

    3 satoshimaca  staff        96 15 Jul 16:46 eosio-wallet
drwxr-xr-x    6 satoshimaca  staff       192 15 Jul 12:39 Projects

I am unsure if that makes any different to cleos finding it.

I tried various versions of the following but they all state the same error as I posted originally -

cleos wallet --wallet-url TEXT=http://127.0.0.1:8888/ import -n trevor5 5KcFCgZiixiZ69dyA5u39SGWg4........WEXrRBQtZ

3

I was struggling with the same. The issue is that cleos tries to start keosd automatically but it doesn't seem to use the keosd config.ini file located in ~/eosio-wallet when doing so. I've resorted to just running keosd separately and letting cleos connect to the one I started manually.

In my ~/eosio-wallets/config.ini file I have the following:

# The local IP and port to listen for incoming http connections; set blank to disable. (eosio::http_plugin)
http-server-address = localhost:8900

This localhost:8900 is the address where cleos tries to find keosd by default, which saves you from having to always type --wallet-url <something>.

Then I start keosd by just running it directly as in ./keosd or simply keosd if you added it to your PATH or created an alias for it. This way it will actually use the http-server-address specified in the config file.

After it starts, you can then use cleos and it won't bother starting the keosd process because it will find the one that is already running:

cleos wallet import -n trevor5 5KcFCgZiixiZ69dyA5u39SG...8drWEXrRBQtZ

This command should now work, and you don't need to specify the wallet address or anything else. Hope it helps!

  • I will test this more. I tried what you said and the old error vanishes but new ones show up. I will test more and then post the outcomes. Thanks. – Trevor Oakley Jul 16 '18 at 14:19
  • No problem! By the way, make sure you kill all the other keosd processes that might have been left running after being started by cleos. I'm curious about what errors you're getting now! – Andres Berrios Jul 16 '18 at 15:35
0

If you do not have your wallet's address specified in keosd's config.ini, then you will need to specify it when launching the cleos command. To find the config.ini go sudo find / -name config.ini and look for the ~/eosio-wallet/config.ini directory.

enter image description here

To do this from cleos without needing to edit the config.ini, simply add the following flag to cleos:

--wallet-url TEXT=http://localhost:8900/
                              the http/https URL where keosd is running

You can see your keosd address when you launch keosd:

enter image description here

  • I added a few more details in the original question via an edit. The config.ini does exist but the port stated is different to the listening one in the process. I put in more details about the file structure. I tried various combinations of manually stating the url but they returned the same error. The same error happens with cleos wallet list too. – Trevor Oakley Jul 16 '18 at 9:21

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.