Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

default.wallet location issue #15

Closed
etranger05 opened this issue Jul 15, 2022 · 1 comment
Closed

default.wallet location issue #15

etranger05 opened this issue Jul 15, 2022 · 1 comment

Comments

@etranger05
Copy link

etranger05 commented Jul 15, 2022

Found a wallet issue when creating an account.

$ dune --start test_node
Creating docker container [dune_container]
Creating node [test_node]
Using Configuration [/home/www-data/config.ini]


$ dune --create-account nodeone
Creating account [nodeone] with key pair [Private: 5K4GCQPREhc6HmJ2wWNqRHvVNSL1bZ79hu8grtmkUhGJcndUfMg, Public: EOS8DMcuK28sN7jw8Uj5gEKtH8JxdbhovhVkDaUoQAemo49RBse97]
Error 3120006: No available wallet
Ensure that you have created a wallet and have it open
Error Details:
You don't have any wallet!
Stack Trace:
wallet_manager.cpp:140 get_public_keys

In my analysis, this is caused by the script setup_system.sh which creates wallet run as root permission by the Dockerfile, and eosio-wallet is generated under /root.

But the dune script is running as the user www-data so that it is trying to find default.wallet from /home/www-data.

This is the wallet location just after run the bootstrap.sh and create the container.

$ docker exec -u root -it dune_container ls -alh /root/eosio-wallet
total 16K
drwxr-xr-x 2 root root 4.0K Jul 15 12:48 .
drwx------ 1 root root 4.0K Jul 15 12:48 ..
-rw-r--r-- 1 root root 2.9K Jul 15 12:48 config.ini
-rw------- 1 root root  311 Jul 15 12:48 default.wallet
-rw-r--r-- 1 root root    0 Jul 15 12:48 wallet.lock
$ docker exec -u root -it dune_container ls -alh /home/www-data
total 16K
drwxr-xr-x 1 www-data www-data 4.0K Jul 15 12:49 .
drwxr-xr-x 1 root     root     4.0K Jul 15 12:49 ..
-rw-r--r-- 1 www-data www-data  621 Jul 15 12:49 config.ini
drwxr-xr-x 2 www-data www-data 4.0K Jul 15 12:49 nodes

I tried to make a PR but it looks a bit complex as a user that it may related to permission issue and other features such as export/import wallet.

so I'm just leaving commands for somebody who need a simple workaround as below. You can run it just after bootstrap.sh completed.

$ dune --create-account <username> # this will fail but generate eosio-wallet structure under /home/www-data.
$ docker exec -u root -it dune_container cp /root/eosio-wallet/default.wallet /home/www-data/eosio-wallet/ 
$ docker exec -u root -it dune_container chown www-data:www-data /home/www-data/eosio-wallet/default.wallet

Thanks.

@larryk85
Copy link

This should be resolved as of v1.0.0-rc1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants