entropyxyz / cli

CLI utility to ease interactions with an Entropy network.
GNU Affero General Public License v3.0
5 stars 0 forks source link

Should we move the endpoint to an env var rather than have the endpoint set in the config? #146

Open rh0delta opened 1 week ago

rh0delta commented 1 week ago

Question came about in the entropy core sync (2024-06-27) where there was a confusion around why the endpoint was not more configurable rather than needing a fair amount of code changes and a new migration to update.

Might make more sense to move the endpoint to an environment variable so that its easily changed, can even look at adding it to secrets manager, but that might be overkill.

johnnymatthews commented 1 week ago

I'm all for not hardcoding the network address into the CLI. Can we have both an ENV variable and be able to pass the network in as an argument? That way the user can do either:

ENTROPY_NETWORK="wss://testnet.entropy.xyz"
entropy-cli --address 05ea ...

or

entropy-cli --network "wss://testnet.entropy.xyz" --address 05ea ...
rh0delta commented 1 week ago

@johnnymatthews yeah that's definitely a possibility. @frankiebee what are your thoughts on this?

frankiebee commented 1 week ago

at one point i laid ground work for this. I see it got removed yes i'm all for this i would still like the ability to have set endpoints in the config though

johnnymatthews commented 1 week ago

at one point i laid ground work for this. I see it got removed

You mean you made commits to fix this issue? They should be around in the history somewhere if so, no?

mixmix commented 4 days ago

It's already set-able via the env var ENDPOINT and via flags --endpoint or -e

https://github.com/entropyxyz/cli/blob/fb1f6ee9b464ffba7a5e9c7b0c6b4ed2c67c5f40/src/cli.ts#L17-L39

mixmix commented 4 days ago

In retrospect ENDPOINT is a super vague ENV var ... is should def be changed!

johnnymatthews commented 2 days ago

In retrospect ENDPOINT is a super vague ENV var ... is should def be changed!

Agreed. I'd prefer that all environment variables for this CLI start with ENTROPY_CLI_ or something like that. The CLI_ bit is specifically to reduce any conflicts with other repos like Core or whatever.