Git Product home page Git Product logo

Comments (4)

raedah avatar raedah commented on August 15, 2024

The above should also take care of the failures that show unfriendly errors such as

$ ./dcrcli balance
Error executing command 'balance'
error fetching accounts: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transpor
t: Error while dialing dial tcp: missing address"

from godcr-old.

itswisdomagain avatar itswisdomagain commented on August 15, 2024

I've had that error even with dcrcli properly configured but without dcrwallet actually running... There might be another way to prevent that error. Will look into that

from godcr-old.

itswisdomagain avatar itswisdomagain commented on August 15, 2024

The above should also take care of the failures that show unfriendly errors such as

$ ./dcrcli balance
Error executing command 'balance'
error fetching accounts: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transpor
t: Error while dialing dial tcp: missing address"

I want to create a separate issue for this as it does not relate to the absence or presence of dcrcli configuration. The error is due to invalid rpc configuration values. Want to keep this issue and the associated PR #64 focused on just taking care of scenarios where dcrcli is not configured.

EDIT: The error missing address represents cases where dcrwallet rpc server address is not set in config and not passed in command-line. This can happen even if dcrcli.conf exists and is configured (partly)

A similar error occurs when the dcrwallet rpc server address is set but dcrcli cannot connect to that address either because it is completely incorrect/invalid or because dcrwallet was not running at the time the connection attempt was made.

For simplicity and focus, this issue and the associating PR should focus on detecting the absence of dcrcli.conf file and providing the user with a means to create the config file or advising the user to pass required drcwallet configuration values via the command-line. This would hopefully also take care of the scenario where dcrwallet rpc server address is not set, but not necessarily.

If a user manually creates a config file, a value for dcrwallet rpc server address may not be set in the config file and may not be passed in command-line options. dcrcli.conf exists but dcrwallet rpc server address does not. Or the server address could exist but does not point to an actively running dcrwallet daemon. These scenarios will be taken care of in #77

from godcr-old.

itswisdomagain avatar itswisdomagain commented on August 15, 2024

This planetdecred/godcr#64 (comment) explains why this issue isn't actually an issue - or shouldn't have been an issue.

In summary,

When running ./dcrcli with no commands, currently the simple dcrcli usage cmds are shown. But these commands are not yet available if the user does not have dcrcli.conf set with the correct rpc login information

True

So this should be detected, and a msg displayed to let the user know that they need to specify this information. The simple usage commands would not be displayed, and instead instructions would be displayed to set edit the config file or to specify the appropriate rpc command line options (-h).

Not really. The rpc connection information we need are rpcAddress and rpcCert. For the latter case, if a value isn't present i config or command-line options, an error message isn't displayed. Instead a default value is used. This same pattern has been introduced in #80 - thus, we no longer need to show the user any message about missing rpc information.

Additionally, we could autoconfigure by looking for the default dcrwallet config and auto parsing the needed settings, asking the user if they would like to use these values.

This however is something that we could and prolly should do. Will make this into a separate low-priority issue.

from godcr-old.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.