diff --git a/.github/workflows/buildService.yml b/.github/workflows/buildService.yml index de30e20..9ab20c4 100644 --- a/.github/workflows/buildService.yml +++ b/.github/workflows/buildService.yml @@ -27,6 +27,7 @@ jobs: make PACKAGE_ID=$(yq -oy ".id" manifest.*) echo "package_id=$PACKAGE_ID" >> $GITHUB_ENV + printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n" shell: bash - name: Upload .s9pk diff --git a/.github/workflows/releaseService.yml b/.github/workflows/releaseService.yml index f1eebb4..6cf91f2 100644 --- a/.github/workflows/releaseService.yml +++ b/.github/workflows/releaseService.yml @@ -33,6 +33,7 @@ jobs: - name: Generate sha256 checksum run: | PACKAGE_ID=${{ env.package_id }} + printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n" sha256sum ${PACKAGE_ID}.s9pk > ${PACKAGE_ID}.s9pk.sha256 shell: bash diff --git a/Makefile b/Makefile index fa91629..bb7a18d 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,11 @@ else endif @start-sdk pack -install: -ifeq (,$(wildcard ./start9/config.yaml)) - @echo; echo "You must define \"host: http://server-name.local\" in ./start9/config.yaml config file first"; echo -else - start-cli package install $(PKG_ID).s9pk -endif +install: + @if [ ! -f ~/.embassy/config.yaml ]; then echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first."; exit 1; fi + @echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n" + @[ -f $(PKG_ID).s9pk ] || ( $(MAKE) && echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n" ) + @start-cli package install $(PKG_ID).s9pk docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager manifest.yaml check-rpc.sh check-synced.sh actions/* ifeq ($(ARCH),x86_64) diff --git a/README.md b/README.md index 6ac17e0..85aa33a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ Install the following system dependencies to build this project by following the - [docker](https://docs.docker.com/get-docker) - [docker-buildx](https://docs.docker.com/buildx/working-with-buildx/) -- [rust-musl-cross](https://github.com/Start9Labs/rust-musl-cross) - [yq](https://mikefarah.gitbook.io/yq) - [rust](https://rustup.rs) - [start-sdk](https://github.com/Start9Labs/start-os/tree/sdk) @@ -35,8 +34,8 @@ Install the following system dependencies to build this project by following the Clone the project locally. Note the submodule link to the original project(s). ``` -git clone git@github.com:Start9Labs/bitcoind-wrapper.git -cd bitcoind-wrapper +git clone git@github.com:Start9Labs/bitcoind-startos.git +cd bitcoind-startos git submodule update --init ``` diff --git a/actions/reindex_chainstate.sh b/actions/reindex_chainstate.sh index 8b7e25e..41aa5a0 100644 --- a/actions/reindex_chainstate.sh +++ b/actions/reindex_chainstate.sh @@ -2,7 +2,6 @@ set -e -touch /root/.bitcoin/requires.reindex_chainstate action_result_running=" { \"version\": \"0\", \"message\": \"Bitcoin Core restarting in reindex chainstate mode\", @@ -17,4 +16,19 @@ action_result_stopped=" { \"copyable\": false, \"qr\": false }" -bitcoin-cli -rpcconnect=bitcoind.embassy stop >/dev/null 2>/dev/null && echo $action_result_running || echo $action_result_stopped \ No newline at end of file +action_result_pruned=" { + \"version\": \"0\", + \"message\": \"Bitcoin Core does not allow reindex-chainstate for pruned nodes. If the Chainstate is corrupted on a pruned node the entire blockchain will need to be re-downloaded from genesis with the 'Reindex Blockchain' action\", + \"value\": null, + \"copyable\": false, + \"qr\": false +}" + +pruned=$(yq e '.advanced.pruning.mode' /root/.bitcoin/start9/config.yaml) + +if [ "$pruned" != "disabled" ]; then + echo $action_result_pruned +else + touch /root/.bitcoin/requires.reindex_chainstate + bitcoin-cli -rpcconnect=bitcoind.embassy stop >/dev/null 2>/dev/null && echo $action_result_running || echo $action_result_stopped +fi \ No newline at end of file diff --git a/bitcoin b/bitcoin index d822839..1088a98 160000 --- a/bitcoin +++ b/bitcoin @@ -1 +1 @@ -Subproject commit d82283950f5ff3b2116e705f931c6e89e5fdd0be +Subproject commit 1088a98f5aad080cc6cca2da174f206509fcda6c diff --git a/manager/src/main.rs b/manager/src/main.rs index 4996a65..2d64599 100644 --- a/manager/src/main.rs +++ b/manager/src/main.rs @@ -455,8 +455,18 @@ fn inner_main(reindex: bool, reindex_chainstate: bool) -> Result<(), Box (), + Err(e) if e.kind() == std::io::ErrorKind::NotFound => (), + a => a?, + } } else if reindex_chainstate { btc_args.push("-reindex-chainstate".to_owned()); + match fs::remove_file("/root/.bitcoin/requires.reindex_chainstate") { + Ok(()) => (), + Err(e) if e.kind() == std::io::ErrorKind::NotFound => (), + a => a?, + } } std::io::copy( @@ -471,13 +481,6 @@ fn inner_main(reindex: bool, reindex_chainstate: bool) -> Result<(), Box (), - Err(e) if e.kind() == std::io::ErrorKind::NotFound => (), - a => a?, - } - } let raw_child = child.id(); *CHILD_PID.lock().unwrap() = Some(raw_child); let pruned = { diff --git a/manifest.yaml b/manifest.yaml index 64f7079..ebad58c 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,14 +1,14 @@ id: bitcoind title: "Bitcoin Core" -version: 27.0.0 -eos-version: 0.3.4.3 +version: 27.1.0 +eos-version: 0.3.4.4 release-notes: | - * Update Bitcoin to [v27.0](https://github.com/bitcoin/bitcoin/releases/tag/v27.0) - * Default mempoolfullrbf=1 on fresh installs - * Minor config description improvements + * Update Bitcoin to [v27.1](https://github.com/bitcoin/bitcoin/releases/tag/v27.1) + * Add 'Reindex Chainstate' Action + * Improve config descriptions and instructions * Notice! If Bitcoin gets stuck in "Stopping" status after the update, the solution is to restart your server. System -> Restart. license: MIT -wrapper-repo: https://github.com/Start9Labs/bitcoind-wrapper +wrapper-repo: https://github.com/Start9Labs/bitcoind-startos upstream-repo: https://github.com/bitcoin/bitcoin support-site: https://github.com/bitcoin/bitcoin/issues marketing-site: https://bitcoincore.org/ @@ -153,7 +153,7 @@ actions: reindex-chainstate: name: "Reindex Chainstate" description: "Rebuilds the chainstate database using existing block index data; as the block index is not rebuilt, 'reindex_chainstate' should be strictly faster than 'reindex'. This action should only be used in the case of chainstate corruption; if the blocks stored on disk are corrupted, the 'reindex' action will need to be run instead." - warning: Blocks not stored on disk will be redownloaded in order to rebuild the database. If your node is pruned, this action is equivalent to syncing the node from scratch, so this process could take weeks on low-end hardware. + warning: While faster than 'Reindex', 'Reindex Chainstate' can still take several days or more to complete. Pruned nodes do not allow 'reindex-chainstate'; if you are running a pruned node and suspect chainstate corruption the 'reindex' action (requiring redownloading the entire Blockchain) should be run instead. allowed-statuses: - running - stopped diff --git a/scripts/services/migrations.ts b/scripts/services/migrations.ts index 3da6706..ef9d60a 100644 --- a/scripts/services/migrations.ts +++ b/scripts/services/migrations.ts @@ -268,5 +268,5 @@ export const migration: T.ExpectedExports.migration = ), }, }, - "27.0.0" + "27.1.0" );