xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
164 stars 47 forks source link

Incorrect network warning #11

Closed milancermak closed 1 year ago

milancermak commented 1 year ago

starkli version: 0.1.2

I was using starkli to declare a contract. This is the command I ran:

starkli declare --account ./goerli-experiments-account.json --keystore ~/.starknet_accounts/goerli-experiments.keystore  target/dev/xoroshiro_Xoroshiro.sierra.json
WARNING: when using JSON-RPC, the --network flag is ignored. There's no need to use --network as network is automatically detected.

I had both STARKNET_RPC and STARKNET_NETWORK set as envvars.

I think the warning is confusing as I didn't use --network in my command.

glihm commented 1 year ago

That's a good catch. For now starkli can't know if the option is set from env or cli, so perhaps we need to rephrase to be more generic on that. Or add support to know from where the values are taken. :+1:

xJonathanLEI commented 1 year ago

@milancermak btw you can use STARKNET_ACCOUNT and STARKNET_KEYSTORE to simplify command invocations. And even in that case you can still override them via the --account and --keystore flags.

xJonathanLEI commented 1 year ago

Thanks for the feedback. Good UX is extremely important so we need to get this right. We need to get this right. Most error/warning messages are mostly placeholders at the moment and could definitely use some work.

xJonathanLEI commented 1 year ago

Improved the warning messages to be more accurate: https://github.com/xJonathanLEI/starkli/commit/4b85e4ad44dd486fe1f53c76731aa9cd845a1fa8. The new messages also point to the documentation.

Closing this optimistically.