diff --git a/README.md b/README.md index afde03a..1dc63c8 100644 --- a/README.md +++ b/README.md @@ -346,7 +346,7 @@ sha256sum /etc/ghost/casper.json You should see: ``` -9da6045ed6d4fd844e3939573b31c013d0e564e542029330faa6d978cb4a915a +4645c7d39a64424d823f659d408070f8c90426117e7af147b0360697b2db7f4f /etc/ghost/casper.json ``` Create running `ghost-node` service that starts on system boot using `--unit-file` flag. diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..47b76d7 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.93.1" +components = ["rustfmt", "clippy", "rust-src"] +targets = ["wasm32-unknown-unknown"] diff --git a/scripts/starter.sh b/scripts/starter.sh index 0183cbb..dde3bc7 100755 --- a/scripts/starter.sh +++ b/scripts/starter.sh @@ -85,30 +85,16 @@ extract_seed() { echo $seed } -upgrade_compiler_if_needed() { - UPDATE_STATUS=$(rustup check 2>&1) +apply_patches_if_needed() { + local PATCH_STATUS=0 "$SCRIPT_FOLDER"/patch.sh || PATCH_STATUS=$? - if echo "$UPDATE_STATUS" | grep -q "Update available" || [ $PATCH_STATUS -eq 2 ]; then + if [ "$PATCH_STATUS" -eq 2 ]; then echo "[+] clean all cache on the current system" - cargo install cargo-cache cargo clean + cargo install cargo-cache cargo cache --remove-dir all - echo "[+] upgrading rustc compiler version to latest" - rustup update - toolchain_name=$(rustup show | grep default | head -n 1 | cut -d' ' -f1) - - if ! rustup target list --installed | grep -q "wasm32-unknown-unknown"; then - echo "[+] installing wasm32-unknown-unknown target" - rustup target add wasm32-unknown-unknown - fi - - if ! rustup component list --installed | grep -q "rust-src"; then - echo "[+] installing rust-src component" - rustup component add rust-src - fi - echo "[+] fetching all dependencies" cargo fetch @@ -240,7 +226,7 @@ if [[ $HARD_RESET = true ]]; then exit 1 fi - upgrade_compiler_if_needed + apply_patches_if_needed echo "[+] trying to stop current ghost-node" sudo systemctl stop ghost-node @@ -349,12 +335,12 @@ if [[ $SET_ENVIRONMENT = true ]]; then if prompt "[?] setup the rust environment (e.g. WASM support)?"; then rustup default stable - upgrade_compiler_if_needed + apply_patches_if_needed fi fi if [[ ! -z $RELEASE ]]; then - upgrade_compiler_if_needed + apply_patches_if_needed if prompt "[?] 'cargo build $RELEASE $FEATURES' is what you want?"; then cd $PROJECT_FOLDER echo "[+] starting build in 3 seconds..."