diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 137f523..265f5fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,19 +4,15 @@ on: push: env: - STACKS_BLOCKCHAIN_COMMIT: "feat/epoch-2.4" + STACKS_BLOCKCHAIN_COMMIT: e14022aa7e2eb82714c2ccaa3b8f2ed0f5568f8e -jobs: - cancel-previous-runs: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.10.0 - with: - access_token: ${{ github.token }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: build-stacks-node: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -28,21 +24,15 @@ jobs: key: cache-stacks-node-${{ env.STACKS_BLOCKCHAIN_COMMIT }} - name: Install Rust - linux/amd64 if: steps.cache.outputs.cache-hit != 'true' - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: x86_64-unknown-linux-gnu + run: rustup toolchain install stable - name: Install Rust - linux/arm64 if: steps.cache.outputs.cache-hit != 'true' - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: aarch64-unknown-linux-gnu + run: rustup target add aarch64-unknown-linux-gnu - name: Install compilation tooling if: steps.cache.outputs.cache-hit != 'true' run: | sudo apt-get update - sudo apt-get install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross gcc-aarch64-linux-gnu + sudo apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libgcc-11-dev-arm64-cross - name: Fetch Stacks node repo if: steps.cache.outputs.cache-hit != 'true' env: @@ -81,10 +71,11 @@ jobs: CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar run: | - cargo build --package stacks-node --bin stacks-node --release --target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu + rm ".cargo/config" + cargo build --package stacks-node --bin stacks-node --profile release-lite --target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu mkdir -p ../bin/x86_64-unknown-linux-gnu ../bin/aarch64-unknown-linux-gnu - cp target/x86_64-unknown-linux-gnu/release/stacks-node ../bin/x86_64-unknown-linux-gnu - cp target/aarch64-unknown-linux-gnu/release/stacks-node ../bin/aarch64-unknown-linux-gnu + cp target/x86_64-unknown-linux-gnu/release-lite/stacks-node ../bin/x86_64-unknown-linux-gnu + cp target/aarch64-unknown-linux-gnu/release-lite/stacks-node ../bin/aarch64-unknown-linux-gnu - uses: actions/upload-artifact@v3 with: name: stacks-node-bin @@ -94,7 +85,7 @@ jobs: build-push-docker: needs: build-stacks-node - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -115,13 +106,13 @@ jobs: images: hirosystems/stacks-api-e2e tags: | type=raw,value=latest,enable={{is_default_branch}} - type=raw,value=stacks2.4,enable={{is_default_branch}} - type=raw,value=stacks2.4-{{branch}}-{{sha}} - type=ref,event=branch,prefix=stacks2.4- - type=ref,event=pr,prefix=stacks2.4- - type=semver,pattern={{version}},prefix=stacks2.4- - type=semver,pattern={{major}}.{{minor}},prefix=stacks2.4- - type=sha,prefix=stacks2.4- + type=raw,value=stacks3.0,enable={{is_default_branch}} + type=raw,value=stacks3.0-{{branch}}-{{sha}} + type=ref,event=branch,prefix=stacks3.0- + type=ref,event=pr,prefix=stacks3.0- + type=semver,pattern={{version}},prefix=stacks3.0- + type=semver,pattern={{major}}.{{minor}},prefix=stacks3.0- + type=sha,prefix=stacks3.0- - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx diff --git a/Dockerfile.e2e b/Dockerfile.e2e index b09f0ed..9adcaf6 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -1,9 +1,9 @@ # syntax=docker/dockerfile:1 -FROM rust:bullseye as builder +FROM rust:bookworm as builder # A commit hash, tag, or branch -ARG GIT_COMMIT=feat/epoch-2.4 +ARG GIT_COMMIT=e14022aa7e2eb82714c2ccaa3b8f2ed0f5568f8e ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git ARG TARGETPLATFORM @@ -19,11 +19,11 @@ RUN < config.toml - stacks-node start --config=config.toml & + stacks-node start --config config.toml & STACKS_PID=$! while true; do - HEIGHT=$(curl -s localhost:20443/v2/info | jq '.burn_block_height') + HEIGHT=$(curl -s 127.0.0.1:20443/v2/info | jq '.burn_block_height') if [ "$HEIGHT" = "101" ]; then echo "Stacks node caught up to Bitcoin block $HEIGHT" break @@ -158,7 +174,7 @@ RUN < run.sh <<'EOM' bitcoin-cli -rpcwait generatetoaddress 1 $BTC_ADDR envsubst < config.toml.in > config.toml - stacks-node start --config=config.toml & + stacks-node start --config config.toml & STACKS_PID=$! function start_miner() { while true; do - TX=$(bitcoin-cli listtransactions '*' 1 0 true) + TX=$(bitcoin-cli -rpcwallet=main listtransactions '*' 1 0 true) CONFS=$(echo "$TX" | jq '.[].confirmations') if [ "$CONFS" = "0" ]; then echo "Detected Stacks mining mempool tx, mining btc block..." diff --git a/Dockerfile.stacks-node b/Dockerfile.stacks-node index f290a4e..6620a89 100644 --- a/Dockerfile.stacks-node +++ b/Dockerfile.stacks-node @@ -6,17 +6,21 @@ RUN test -n "$GIT_COMMIT" || (echo "GIT_COMMIT not set" && false) RUN echo "Building stacks-node from commit: https://github.com/stacks-network/stacks-blockchain/commit/$GIT_COMMIT" +RUN apt-get update && apt-get install -y libclang-dev +RUN rustup toolchain install stable +RUN rustup component add rustfmt --toolchain stable + WORKDIR /stacks RUN git init && \ git remote add origin https://github.com/stacks-network/stacks-blockchain.git && \ git -c protocol.version=2 fetch --depth=1 origin "$GIT_COMMIT" && \ git reset --hard FETCH_HEAD -RUN cargo build --package stacks-node --bin stacks-node --release +RUN cargo build --package stacks-node --bin stacks-node --profile release-lite FROM debian:bullseye-backports -COPY --from=builder /stacks/target/release/stacks-node /usr/local/bin/ +COPY --from=builder /stacks/target/release-lite/stacks-node /usr/local/bin/ COPY --from=ruimarinho/bitcoin-core:0.21.1 /opt/bitcoin-*/bin /usr/local/bin diff --git a/docker-compose-follower.yml b/docker-compose-follower.yml index a946c06..3756f68 100644 --- a/docker-compose-follower.yml +++ b/docker-compose-follower.yml @@ -1,7 +1,7 @@ version: "3.9" x-common-vars: - - &STACKS_BLOCKCHAIN_COMMIT master + - &STACKS_BLOCKCHAIN_COMMIT e14022aa7e2eb82714c2ccaa3b8f2ed0f5568f8e - &MINER_PUB_KEY 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c - &BITCOIN_PEER_PORT 18444 - &BITCOIN_RPC_PORT 18443 @@ -60,7 +60,7 @@ services: until $(curl -o /dev/null -s stacks-node-miner:20443); do sleep 5 done - exec stacks-node start --config=config.toml + exec stacks-node start --config config.toml networks: stacks: diff --git a/docker-compose-miner.yml b/docker-compose-miner.yml index 12b6f06..d2f689b 100644 --- a/docker-compose-miner.yml +++ b/docker-compose-miner.yml @@ -1,7 +1,7 @@ version: "3.9" x-common-vars: - - &STACKS_BLOCKCHAIN_COMMIT master + - &STACKS_BLOCKCHAIN_COMMIT e14022aa7e2eb82714c2ccaa3b8f2ed0f5568f8e - &BTC_ADDR miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT - &MINER_SEED 9e446f6b0c6a96cf2190e54bcd5a8569c3e386f091605499464389b8d4e0bfc201 # stx: STEW4ZNT093ZHK4NEQKX8QJGM2Y7WWJ2FQQS5C19, btc: miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT, pub_key: 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c, wif: cStMQXkK5yTFGP3KbNXYQ3sJf2qwQiKrZwR9QJnksp32eKzef1za - &BITCOIN_PEER_PORT 18444 @@ -16,6 +16,8 @@ x-common-vars: - &STACKS_22_HEIGHT ${STACKS_22_HEIGHT:-105} - &STACKS_23_HEIGHT ${STACKS_23_HEIGHT:-106} - &STACKS_24_HEIGHT ${STACKS_24_HEIGHT:-107} + - &STACKS_25_HEIGHT ${STACKS_25_HEIGHT:-108} + - &STACKS_30_HEIGHT ${STACKS_30_HEIGHT:-999999} # do not boot into epoch3.0 for now (it doesn't work yet) - &REWARD_RECIPIENT ${REWARD_RECIPIENT:-STQM73RQC4EX0A07KWG1J5ECZJYBZS4SJ4ERC6WN} # priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001 services: @@ -116,6 +118,8 @@ services: STACKS_22_HEIGHT: *STACKS_22_HEIGHT STACKS_23_HEIGHT: *STACKS_23_HEIGHT STACKS_24_HEIGHT: *STACKS_24_HEIGHT + STACKS_25_HEIGHT: *STACKS_25_HEIGHT + STACKS_30_HEIGHT: *STACKS_30_HEIGHT REWARD_RECIPIENT: *REWARD_RECIPIENT entrypoint: - /bin/bash @@ -129,7 +133,7 @@ services: rm -rf $${DATA_DIR}/* envsubst < config.toml.in > config.toml # bitcoin-cli -rpcwait -rpcconnect=bitcoind getmininginfo - exec stacks-node start --config=config.toml + exec stacks-node start --config config.toml ################################## ##### UNCOMMENT IF USING API ##### diff --git a/stacks-krypton-miner.toml b/stacks-krypton-miner.toml index f803db9..7048a66 100644 --- a/stacks-krypton-miner.toml +++ b/stacks-krypton-miner.toml @@ -32,9 +32,11 @@ public_ip_address = "1.1.1.1:1234" [burnchain] chain = "bitcoin" -mode = "krypton" +mode = "neon" poll_time_secs = 1 pox_2_activation = $STACKS_POX2_HEIGHT +pox_reward_length = $POX_REWARD_LENGTH +pox_prepare_length = $POX_PREPARE_LENGTH ### bitcoind-regtest connection info peer_host = "$BITCOIN_PEER_HOST" @@ -44,6 +46,7 @@ rpc_ssl = false username = "$BITCOIN_RPC_USER" password = "$BITCOIN_RPC_PASS" timeout = 30 +wallet_name = "main" [[burnchain.epochs]] epoch_name = "1.0" @@ -73,6 +76,15 @@ start_height = $STACKS_23_HEIGHT epoch_name = "2.4" start_height = $STACKS_24_HEIGHT +[[burnchain.epochs]] +epoch_name = "2.5" +start_height = $STACKS_25_HEIGHT + +[[burnchain.epochs]] +epoch_name = "3.0" +start_height = $STACKS_30_HEIGHT + + [[ustx_balance]] address = "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6" amount = 10000000000000000