koinos / koinos/koinos-cli

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

Open
#158 5 comments 0 reactions 0 assignees View on GitHub
enhancement task
Dominant language
Go
Stars
7
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] 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](https://user-images.githubusercontent.com/23157604/202857520-07937f9f-297f-46bd-8d13-f64c8bf61eed.png)

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).

Contributor guide

Open the contributing guide

Research direction

Start at the CLI handling for the -r option and the code that loads local or global .koinosrc files. Reproduce the behavior with a .koinosrc containing a connect command, then verify that -r skips the entire file, connects to the supplied endpoint, and displays the requested ignoring message.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.