Playing with the latest release and I could create a wallet but have not yet seen the (zero) balance.
So I sniffed the wallet address with dog and crashed the cli.
Also supplying the balance from stdin does nothing…
willie@gagarin:~$ safe wallet balance
...awaiting Wallet address/location from STDIN stream...
safe://hyryynyenpmkjkzpzffy3hic8sybtzmta337d5krxu8n9qjqy78gfkd4bzg4y84y
^C
willie@gagarin:~$ safe wallet balance safe://hyryynyenpmkjkzpzffy3hic8sybtzmta337d5krxu8n9qjqy78gfkd4bzg4y84y
Error:
0: AccessDenied: Couldn't read Wallet found at "safe://hyryynyenpmkjkzpzffy3hic8sybtzmta337d5krxu8n9qjqy78gfkd4bzg4y84y"
Location:
sn_cli/src/subcommands/wallet.rs:77
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
This is a valid error, you need to make sure the CLI has a keypair so it uses it for every command, otherwise it uses a random one each time, thus what happens is that the Wallet is first created with one key as the owner which is not the same key it uses for when you try to check the balance.
Long story short, make sure you create and set up a keypair for CLI with $ safe keys create --for-cli, after that create a new Wallet and you should be able to check its balance and make deposits to it.
I’ll take a look at the issue with dog in the next few days, I think it’s just that Wallet and a few other data types are not yet supported by dog.
Thank you.
My error was I had missed the --for-cli flag off safe keys create
But now I get a different error ContentError rather than AccessDenied
willie@gagarin:~$ safe keys create --for-cli
New SafeKey created: "safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo"
Key pair generated:
Public Key = 70a5cf9316f52cc238fc25cb59751c790dc5e5edc2addef48dcf469a46547c4b
Secret Key = efc71f320d92a33b229d2f926269d8a31a7c73a75bcea4c83c0477ecd9369fe3
Setting new SafeKey to be used by CLI...
New credentials were successfully stored in /home/willie/.safe/cli/credentials
Safe CLI now has write access to the network
willie@gagarin:~$ safe wallet create
Wallet created at: "safe://hyryynyen6huscqwkyqkrwomp1gt1hadnubg76tb4bboof5t3a761x8d433ny84y"
willie@gagarin:~$ safe wallet balance safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo
Error:
0: ContentError: Failed to read balances from Wallet: ContentError: The url safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo has an SafeKey(Public(70a5cf(01110000)..)) address. To fetch register entries, this url must refer to a register.
Location:
sn_cli/src/subcommands/wallet.rs:77
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
but dog works now
willie@gagarin:~$ safe cat "safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo"
No content to show since the URL targets a SafeKey. Use the 'dog' command to obtain additional information about the targeted SafeKey.
willie@gagarin:~$ safe dog "safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo"
== URL resolution step 1 ==
Resolved from: safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo
= SafeKey =
XOR-URL: safe://hyryyyyyyqn1h9ras6wscrq8hrzfi17ehxrghm3xpaks777rp37djwt1wxtfo
XOR name: 0x70a5cf9316f52cc238fc25cb59751c790dc5e5edc2addef48dcf469a46547c4b
Native data type: SafeKey
You are using the wrong URL to check the balance, you should use the Wallet’s URL instead of the SafeKey’s URL you just created for CLI, i.e. use $ safe wallet balance safe://hyryynyen6huscqwkyqkrwomp1gt1hadnubg76tb4bboof5t3a761x8d433ny84y
In fact, its nearly early here. I’ll get some kip before I start messing with DBCs
Thanks again
willie@gagarin:~$ safe wallet balance safe://hyryynyen6huscqwkyqkrwomp1gt1hadnubg76tb4bboof5t3a761x8d433ny84y
Wallet at "safe://hyryynyen6huscqwkyqkrwomp1gt1hadnubg76tb4bboof5t3a761x8d433ny84y" has a total balance of 0.000000000 safecoins
Just checked there and it fails trying to install node-0.1.1
willie@gagarin:~/.safe/node$ safe node install
Downloading sn_node version: 0.1.1
Downloading https://sn-node.s3.eu-west-2.amazonaws.com/sn_node-0.1.1-x86_64-unknown-linux-musl.tar.gz...
Error:
0: Error downloading release from 'https://sn-node.s3.eu-west-2.amazonaws.com/sn_node-0.1.1-x86_64-unknown-linux-musl.tar.gz'
1: UpdateError: Download request failed with status: 404
Location:
sn_cli/src/operations/helpers.rs:92
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
willie@gagarin:~/.safe/node$ safe -V
sn_cli 0.51.3
safe wallet create
Wallet created at: "safe://hyryynyen9nkeujixmyd9jroxfb7t3tkoudrauogedjc6ukosyh6g4s7ntkho84y"
josh@pc1:~$ safe wallet balance safe://hyryynyen9nkeujixmyd9jroxfb7t3tkoudrauogedjc6ukosyh6g4s7ntkho84y
Wallet at "safe://hyryynyen9nkeujixmyd9jroxfb7t3tkoudrauogedjc6ukosyh6g4s7ntkho84y" has a total balance of 0.000000000 safecoins
$ safe wallet create
Wallet created at: "safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y"
$ safe wallet balance safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y
Wallet at "safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y" has a total balance of 0.000000000 safecoins
$ safe wallet deposit --name my-first-dbc safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y 550ec207952fcb671353628d68a3e6860ba86...
Spendable DBC deposited with name 'my-first-dbc' in Wallet located at "safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y"
$ safe wallet balance safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y
Wallet at "safe://hyryynyengccd6t6zrq4zgq89bo8sec976kguhhp38a6gajxa31ipz96pxjjy84y" has a total balance of 18446744073.709551615 safecoins
Yes that was my thought too. It compiled fine for me last night - if you use STABLE, nightly gave me a facefull of error msgs that I couldnt handle at that time of night
EDIT
Sorry - sn_dbc compiled OK last night, I never got around to sn_dbc_examples.
The sn_dbc mint-repl example is also what I’ve been using to generate the tests for these commands. Note these commands are yet in development. There are three hard-coded DBCs in the unit tests if you want to use them for playing with the CLI commands without needing to generate them with the mint-repl: safe_network/wallet.rs at main · maidsafe/safe_network · GitHub. Just copy the characters from any of them and paste them into the deposit command.
safe wallet balance safe://hyryynyen9nkeujixmyd9jroxfb7t3tkoudrauogedjc6ukosyh6g4s7ntkho84y
Wallet at "safe://hyryynyen9nkeujixmyd9jroxfb7t3tkoudrauogedjc6ukosyh6g4s7ntkho84y" has a total balance of 18446744073.709551615 safecoins
To be fair though, I think we need a better user experience for this. There is nothing in the CLI that indicates to users that they can fix the problem by creating keys.