rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
128 stars 54 forks source link

refactor rooch config and chainid to support multi env for rooch store, including devnet/testnet/mainnet #701

Closed baichuan3 closed 8 months ago

baichuan3 commented 8 months ago

resolver https://github.com/rooch-network/rooch/issues/685 and https://github.com/rooch-network/rooch/issues/689

Summary:

  1. refactored chainid, support built-in ChainID (dev/test/main) and user-defined ChainID (id+name)

  2. When the rooch server starts, it supports specifying chainid parameters, which are -n dev, -n test, -n main, which will generate db files with different paths according to the chainid, and start by test network by default;

  3. In the dev network, the db will default use a temporary file directory. After each server shutdown, the db file will be automatically deleted; the test network and main network networks will retain the db file

  4. Correspondingly, the cleanup command also needs to specify the chainid, which is still the test network network by default;

  5. At the same time, the server startup error prompt is optimized. If the db schema is abnormal, the user is prompted to clean up the db file

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **rooch** | ⬜️ Ignored ([Inspect](https://vercel.com/rooch/rooch/FLyoMP7VUHStaAZ3kvxGDkwYZEEK)) | [Visit Preview](https://rooch-git-supprotconfigbychain-rooch.vercel.app) | | Aug 27, 2023 1:27pm |
baichuan3 commented 8 months ago

Encountered similar version errors several times, from different dependencies, related to the migration to google gke? @yourmoonlight @jolestar

Run cargo test -p testsuite --test integration
error: package `anstream v0.5.0` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.[6](https://github.com/rooch-network/rooch/actions/runs/5975123766/job/16212745764?pr=701#step:10:7)8.0
Either upgrade to rustc 1.70.0 or newer, or use
cargo update -p anstream@0.5.0 --precise ver
where `ver` is the latest version of `anstream` supporting rustc 1.68.0
Error: Process completed with exit code [10](https://github.com/rooch-network/rooch/actions/runs/5975123766/job/16212745764?pr=701#step:10:11)1.
jolestar commented 8 months ago

@baichuan3 upgrade rust to 1.70.0 or lock the clap to a particular minor version.

Maybe we need to add the Cargo.lock to the source code repo, to avoid the dependency auto update.

baichuan3 commented 8 months ago

@baichuan3 upgrade rust to 1.70.0 or lock the clap to a particular minor version.

Maybe we need to add the Cargo.lock to the source code repo, to avoid the dependency auto update.

Try to upgrade rust to lastest stable ver 1.72.0, there are some changes in syntax cause ci to fail, need another pr to handle it.

jolestar commented 8 months ago

We should remove Cargo.lock from .gitignore and add the Cargo.lock to git.

https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

If you’re building a non-end product, such as a rust library that other rust packages will depend on, put Cargo.lock in your .gitignore. If you’re building an end product, which are executable like command-line tool or an application, or a system library with crate-type of staticlib or cdylib, check Cargo.lock into git. If you’re curious about why that is, see “Why do binaries have Cargo.lock in version control, but not libraries?” in the FAQ.

In the beginning, this repo is for MoveOS, a library, so we ignore the Cargo.lock.

But now, it is a binary repo for rooch, so we should add Cargo.lock to git.