soroban-cli
soroban-cli copied to clipboard
soroban-cli: Very difficult to diagnose what is wrong if you miss `--network` or `--source`
If you simply type soroban contract invoke --id ... it is almost impossible to tell why it fails.
First you need a --network (but the error doesn't tell you that).
Then you also need a --source (but the error doesn't tell you that either).
We should: a. Output relevant errors for these b. Have default network and source settings so you don't need to type them at all in the "normal" case.
You can use ENV for both source and network. If you don't provide the network your local ledger is used. If you don't include source the default test seed is used to generate a seed phrase.
What error are you getting?
$ soroban contract invoke --id $TOKEN_ID -- --help
error: parsing contract spec: contract spec not found
$ soroban contract invoke --network standalone --id $TOKEN_ID -- --help
error: jsonrpc error: RPC call failed: ErrorObject { code: InvalidRequest, message: "not found (at ledger 75)", data: None }
Yeah but those would both work if the contract was deployed to the corresponding environments. So should we add more context to these errors to suggest that the issue is that the contract hasn't been deployed?