#CLI - soroban install default

8 messages · Page 1 of 1 (latest)

livid ether
#

I've noticed that once in a while users run into an issue where they use the cli to install a contract locally when they meant to install on futurenet because soroban install --wasm WASM_FILE defaults to the local sandbox. The symptom of this is that a futurenet invocation will fail with "contract code not installed" which should be enough to debug this. This is clearly user error and should be obvious that futurenet is not specified in that command, but I'm wondering if we could help beginners here by removing the default to sandbox.

#

@native marlin @agile halo @edgy walrus

tacit hawk
#

@dense pawn @still oasis

still oasis
#

The solution that I've been using is to use an environment variable. In a recent PR I added the env for SOROBAN_NETWORK https://github.com/stellar/soroban-tools/pull/563/files#diff-21e513b2ed973222145e350a71a71d77fbda1338928218268b989cbb2665390c

GitHub

What
Add two new ENV variables to allow the network and contract id to be set.
Also improved help headings to make things clearer.
Why
This way you can set which network with an ENV variable which ...

#

So they'd have to install it via the github instead of crates.io.

#

Also next week I'm adding verbose logging. This should help with seeing actions like network requests.

#

Our initial reasoning for defaulting to sandbox was a safety issue. You should make sure you are pointing at the network you expect.

agile halo
#

so IIUC the idea is to always explicitly specify the network (or sandbox), so that it's always obvious what you're interacting with