Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet can communicate over http to node, but can't get info from server on Docker #2454

Closed
MatthewDarnell opened this issue Jan 23, 2019 · 2 comments

Comments

@MatthewDarnell
Copy link

MatthewDarnell commented Jan 23, 2019

I'm running 2 Docker containers. One for a node, another for the wallet. The wallet can see the grin node just fine, I can query it over curl. However, the wallet can't seem to get any info from it.

I can hit the grin node container from the wallet container:

root@grinwallet:/wallet# curl -u grin:password http://grin:3000/v1/status
{
  "protocol_version": 1,
  "user_agent": "MW/Grin 1.0.0",
  "connections": 13,
  "tip": {
    "height": 10282,
    "last_block_pushed": "000001458659734b99e754c76954d60cedba95a20ef4d86a3c52436927733d45",
    "prev_block_to_last": "000005d24cce12a0e48330782181eceea5d38a506e970f0ca376caa1cb43eef4",
    "total_difficulty": 4794038959825
  }
}

I can get its api commands:

root@grinwallet:/wallet# curl -u grin:password -D -- "http://grin:3000"
[
  "get blocks",
  "get chain",
  "post chain/compact",
  "post chain/validate",
  "get chain/outputs",
  "get status",
  "get txhashset/roots",
  "get txhashset/lastoutputs?n=10",
  "get txhashset/lastrangeproofs",
  "get txhashset/lastkernels",
  "get txhashset/outputs?start_index=1&max=100",
  "get pool",
  "post pool/push",
  "post peers/a.b.c.d:p/ban",
  "post peers/a.b.c.d:p/unban",
  "get peers/all",
  "get peers/connected",
  "get peers/a.b.c.d"
]

However, I cannot get the wallet to get info from the node:

root@grinwallet:/wallet# grin wallet -p 'password' -r "http://grin:3000"  info
20190123 00:03:06.995 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20190123 00:03:06.996 INFO grin - Using wallet configuration file at /wallet/grin-wallet.toml
20190123 00:03:06.996 INFO grin - This is Grin version 1.0.0 (git v1.0.0-15-gb22e575), built for x86_64-unknown-linux-gnu by rustc 1.32.0 (9fda7c223 2019-01-16).
20190123 00:03:06.996 DEBUG grin - Built with profile "release", features "".
20190123 00:03:06.996 DEBUG grin_wallet::types - Using wallet seed file at: /wallet/wallet_data/wallet.seed
20190123 00:03:07.029 INFO grin_wallet - Using LMDB Backend for wallet
20190123 00:03:07.029 DEBUG grin_wallet::types - Using wallet seed file at: /wallet/wallet_data/wallet.seed

____ Wallet Summary Info - Account 'default' as of height 0 ____

 Total                            | 0.000000000 
 Awaiting Confirmation (< 10)     | 0.000000000 
 Locked by previous transaction   | 0.000000000 
 -------------------------------- | ------------- 
 Currently Spendable              | 0.000000000 


WARNING: Wallet failed to verify data against a live chain. The above is from local cache and only valid up to the given height! (is your `grin server` offline or broken?)
Command 'info' completed successfully
@MatthewDarnell
Copy link
Author

Looks like I had a simple config option in my grin-wallet.toml set to the wrong path after all! Anyway, it would be really nice to have failed wallet commands return the error code. In this case, grin was returning 401 Unauthorized, which would have really helped me track it down quicker.

@marekyggdrasil
Copy link

Had the same problem, just to clarify, in my case solution was to set

node_api_secret_path = "/path/to/a/file/containing/the/secret"

In grin-wallet.toml to lead to file which contains .api_secret same as one on the Grin node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants