Replies: 5 comments 1 reply
-
About 1. Active environments (asui)Good idea. Proposed solution - Workdir for installed sui binaries Will work like any other workdir, except it will be all symlinks. This is how it will look like after making "cargobinsui" active:
(yep... there is a bit of "misdirection" with sui-repo/target/debug) When defined (not clear yet) ENV variables will also be exported. ==== Somewhat related, will add "asui list" and "asui set <name>" as the best way to select the active workdir. We do not want to have to create a "customfuture set-active" script for every workdir variation. |
Beta Was this translation helpful? Give feedback.
-
Maybe useful for detection: #!/bin/bash
SUI_DEFAULT_CFG="$HOME/.sui/sui_config"
CARGO_DEFAULT_SUI="$HOME/.cargo/bin/sui"
SUI_DEFAULT_EXISTS=""
SUI_DEFAULT_VERSION=""
SUI_DEFAULT_ACTIVE_ENV=""
SUI_DEFAULT_ACTIVE_URL=""
if [[ -d $SUI_DEFAULT_CFG && -f $CARGO_DEFAULT_SUI ]]; then
SUI_DEFAULT_EXISTS="TRUE"
# Get the version string, convert to array and get 2nd (version)
CMD_RES=($(sui --version))
SUI_DEFAULT_VERSION=${CMD_RES[1]}
# Get the active environent string, convert to array and get 1st (active env) and 3rd (URL)
CMD_RES=($(sui client envs))
SUI_DEFAULT_ACTIVE_URL=${CMD_RES[2]}
SUI_DEFAULT_ACTIVE_ENV=${CMD_RES[0]}
else
SUI_DEFAULT_EXISTS=""
fi
if [[ -z $SUI_DEFAULT_EXISTS ]]; then
echo ""
else
echo "$SUI_DEFAULT_VERSION $SUI_DEFAULT_ACTIVE_ENV $SUI_DEFAULT_ACTIVE_URL"
fi
|
Beta Was this translation helpful? Give feedback.
-
Latest proposal for asui: Can also publish targeting a specific workdir (e.g. "lsui base publish" ) "localnet publish" and "localnet set-active" will be removed to avoid confusion. Why adding "base"? Exception to the rule is when the subcommand base is specified. A sort-of "escape/namespace" |
Beta Was this translation helpful? Give feedback.
-
The following is now commited:
So after install "asui client ..." will work if binary were installed. "asui base" not commited. I found it confusing in practice... so changing my mind on how switching to "any custom" workdir can be done. Will implement devnet and try a variation. Will go from there. |
Beta Was this translation helpful? Give feedback.
-
This is my latest-of-the-latest proposal. This resolves how to manage custom workdirs without shortcuts (when not one of "localnet/devnet/testnet"). Workdirs Management$ workdirs mkdir <name>
$ workdirs ls $ workdirs cp localnet main0.34 (Note: only sui-base.yaml and user git actions controls the repo version, not the workdir name) Shortcut Management$ workdirs set-shortcut-workdir <workdir name> <shortcut name> Clear using empty string Shortcut name will be refused if clashing with an existing executable on the PATH Controlling Custom Workdir - Design DetailsThe same *workdir-exec" can be called in 3 different ways. (1) With shortcut Example to make localnet2 (from table above) to be "asui active": The "generic" design is: All equivalent... because all resolved at doing (3). BTW, (1) and (3) are already implemented. Calling Sui Binary - Design DetailsThe same "sui-exec" can be called in 3 ways. (1) $ <sui shortcut> ...args... Example: (1) $ mylsui client gas (1) and (3) are already implemented. asui - active sui clientIn the end, decided to keep it as transparent as any other "sui" shortcut. asui will select whichever last workdir did "set-active". Examples putting all this together: $ localnet set-active $ workdirs main0.28 set-active |
Beta Was this translation helpful? Give feedback.
-
A number of opportunities present themselves that would be in line with the core capabilities the multi-sui environment scripts have codified.
Active environments (asui) - Currently this script will determine which, if any, redirects to invoking sui as well as setting/pointing to sui configuration files (i.e. client.yaml, sui.keystore, networkyaml, etc.). However; the function of this script is limited to redirecting invocations to the sui binaries to execute client and/or keytool operations as offered by the sui CLI.
o Opportunity - There is a reasonable probability that the user will also have installed the SUI binaries and, in effect, can represent a 'default' installation outside of the
workdirs
instance. This may be a useful consideration when performing the initial./install
of sui-base as a valid redirect in addition to any clone and build steps from sui repoThird Party (e.g. SDK) - When ?sui (asui, lsui, etc.) execute, they assess alignment to the localnet, devnet, futurenet configurations. However; some developer interactions with the sui blockchain may be through a language SDK (Python, C#, golang,etc). In order for an SDK to leverage
sui-base
there would be much replication of script/code to get to whatsui-base
achieves. Furthermore, theasui
,lsui
is to execute and exit and thereby removing key information such as which location and settings inclient.yaml
, and other configuration context could be used by the SDK execution.o Opportunity - If existing or new scripts in
sui-base
could convey that to the SDK invocation, said SDK could leverage that power in interacting with SUI blockchain, maintaining different sets of configurations as well as leverage in a more controled and repeatable test environment. This may be a useful consideration to, through existing or new scripts, to more easily integrate SDK needsBeta Was this translation helpful? Give feedback.
All reactions