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

[FEATURE]: Skip loading of koinosrc file if RPC endpoint is passed on the command line #158

Open
1 task done
jredbeard opened this issue Nov 19, 2022 · 5 comments
Open
1 task done
Labels
enhancement New feature or request task

Comments

@jredbeard
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

New feature

As a CLI wallet user I'd like to be able to specify an RPC endpoint and still connect to it even if a .koinosrc file is present that contains a connect command.

Current behavior if a .koinosrc file is present and you use the -r option:
202759668-e1bbdae6-55a3-4727-b18b-c344f461bfe9

Once there is a global RC file implemented for system-wide package manager installs (separate related issue #157) then there will be no way around this and -r will never work for me because a .koinosrc file will always be loaded no matter what.

If a .koinosrc file is present in either the local or global locations and -r is specified a message should also be displayed saying Ignoring koinosrc file because an RPC endpoint was specified with -r

Anything else?

I believe that this should be only for the -r command line argument but could potentially just be all command line arguments.

It should skip loading the entire .koinosrc file because contract addresses specified in it may be incorrect if you are connecting to a different endpoint (and this helps to keep the app chain agnostic while still delivering a good user experience for average mainnet users).

@koinos-ci
Copy link

This issue is stale because it has been open for 30 days with no activity.

@mvandeberg
Copy link
Member

Would adding a flag to skip loading of the rc file be sufficient?

@mvandeberg mvandeberg added stale and removed stale labels Mar 3, 2023
@jredbeard
Copy link
Contributor Author

@mvandeberg I think adding a flag to skip loading of the rc file would be a workaround but probably not a solution... especially if #157 is implemented for snap (or other pkg manager) installations.

Maybe an easier workaround that would satisfy this would be to just skip loading the .koinosrc altogether if any command line options are specified. (Forgive me if that suggestion isn't great for other implementation reasons, it's been months since I've looked at this but at a glance that seems logical)

@koinos-ci koinos-ci removed the stale label Mar 4, 2023
@lukemwillis
Copy link
Contributor

Combining this idea with #187 -- you could add a section to .koinosrc to be run on "normal" start up.

[startup]:
  connect https://api.koinos.io

Then you would only run the startup section of .koinosrc when ./koinos-cli is invoked without command line args.

@jredbeard
Copy link
Contributor Author

Combining this idea with #187 -- you could add a section to .koinosrc to be run on "normal" start up.

[startup]:
  connect https://api.koinos.io

Then you would only run the startup section of .koinosrc when ./koinos-cli is invoked without command line args.

So on this, even though I love #187 it doesn't really solve this issue. If we do #157 and there is a 'global' RC file then command line options will never work if they aren't ignored when you pass them. Think of the user experience: I install with snap or apt-get and try to connect to an endpoint with -r as a command line option - instead of doing what I expect, it just goes ahead and connects to main net / test net. It also works against being a chain agnostic framework imo.

@sgerbino sgerbino added the task label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request task
Projects
None yet
Development

No branches or pull requests

5 participants