ChainMovers / suibase

Sui development environment and cookbook.
https://suibase.io
Apache License 2.0
35 stars 6 forks source link

Multiple repos support (was Versions) #9

Closed FrankC01 closed 1 year ago

FrankC01 commented 1 year ago

Discussed in https://github.com/sui-base/sui-base/discussions/8

Originally posted by **FrankC01** March 6, 2023 Currently, the `workdirs`, have specific "branch" sources The reality is that you (user) may want/need the current definition PLUS a `sui genesis` from the `main` branch of the repo (which is by definition a bit more unstable) The user may also want various `...net` versions, e.g.: - devnet-lastest - devnet-0.27.0 - devnet-0.26.0 - etc.
mario4tier commented 1 year ago

Brought back an older idea: localnet set-sui-repo --path

... and it end up to work quite well for your use case.

A genesis "from scratch" is done for every set-sui-repo, so the addresses for these change. It is the safest thing to do.

The genesis for the default repos are "from config", so the deterministic address trick still work, with a new set of config ready for when 0.28 will "land".

Example of use (multiple co-existing repos)
===========================================
localnet set-sui-repo --path ~/my_repos/sui-0.28.0
localnet start              <-- Will build, but not download.
localnet stop              <-- Optional. set-sui-repo will stop localnet if you don't.

localnet set-sui-repo --path ~/my_repos/sui-0_27_1

localnet start               <-- Build, not download. Properly detect needs to regen on repo change.
localnet update           <-- Does not "update" when not on default, just do the build+regen part.
localnet set-sui-repo   <-- No parameter. Back to default

By observing the symlink with "ls -al ~/sui-base/workdirs/localnet" it should be self-explanatory how it works.