Skip to content

Instantly share code, notes, and snippets.

@tpmccallum
Last active August 3, 2018 00:06
Show Gist options
  • Save tpmccallum/f2aac94df08b2bdd5715f88f03d01d85 to your computer and use it in GitHub Desktop.
Save tpmccallum/f2aac94df08b2bdd5715f88f03d01d85 to your computer and use it in GitHub Desktop.
EOSIO using cleos for wallet interaction

Suggestion about "cleos wallet open".

Perhaps we can add a bold note in the hackathon_how_to.md documentation which points out that a wallet has to be 1) opened and then 2) unlocked (always in that order).

Reason

Running the open command, after a wallet has been unlocked (re-opening or switching back to a wallet) locks the wallet.

Example

If you list the open wallets using the following command you can see 3 locked wallets

cleos wallet list
Wallets:
[
  "default",
  "eosiomain",
  "notechainwal"
]

You can unlock a wallet (say, in this case the default wallet) using the following command

cleos wallet unlock --password thePassword
Unlocked: default

If you list the open wallets again, you can see that the asterix (*) is present (indicating that the wallet has been unlocked)

cleos wallet list
Wallets:
[
  "default *",
  "eosiomain",
  "notechainwal"
]

However, if you run the following open command, it results in the wallet being locked

cleos wallet open 
Opened: default

Notice how the asterix has vanished as soon as the open command was executed

cleos wallet list
Wallets:
[
  "default",
  "eosiomain",
  "notechainwal"
]

I thought that this may confuse some people, perhaps we could point this nuance out in the documentation somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment