From 5ca6d01bb43f10e08c0e1720411a7e23a9e95003 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Tue, 12 Dec 2023 21:04:12 +0100 Subject: [PATCH] feat: almost activating epoch3 --- Dockerfile.e2e | 67 +++++++++++++++++++++++++++++++++++---- stacks-krypton-miner.toml | 1 + 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 6532c27..cac2800 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -3,7 +3,7 @@ FROM rust:bookworm as builder # A commit hash, tag, or branch -ARG GIT_COMMIT=f8ffd1dbe8990234391def4611b2611be9a3e4ba +ARG GIT_COMMIT=16bb6887f84a299b5bbbe4c469337169849ce6ed ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git ARG TARGETPLATFORM @@ -47,7 +47,7 @@ EOF FROM debian:bookworm-backports COPY --from=builder /stacks/target/release/stacks-node /usr/local/bin/ -COPY --from=ruimarinho/bitcoin-core:0.21.1 /opt/bitcoin-*/bin /usr/local/bin +COPY --from=btcpayserver/bitcoin:25.1 /usr/local/bin/bitcoind /usr/local/bin/bitcoin-cli /usr/local/bin/ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y curl gettext-base jq @@ -100,10 +100,12 @@ ENV STACKS_24_HEIGHT=$STACKS_24_HEIGHT ARG STACKS_25_HEIGHT=112 ENV STACKS_25_HEIGHT=$STACKS_25_HEIGHT -# do not boot into epoch3.0 for now (it doesn't work yet) -ARG STACKS_30_HEIGHT=999999 +ARG STACKS_30_HEIGHT=121 ENV STACKS_30_HEIGHT=$STACKS_30_HEIGHT +ARG STACKS_PREHEAT_FINISH_HEIGHT=130 +ENV STACKS_PREHEAT_FINISH_HEIGHT=$STACKS_PREHEAT_FINISH_HEIGHT + # priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001 # ARG REWARD_RECIPIENT=STQM73RQC4EX0A07KWG1J5ECZJYBZS4SJ4ERC6WN ARG REWARD_RECIPIENT @@ -134,6 +136,33 @@ const server = http.createServer((req, res) => { EOM EOF +# Create Stacking script +RUN npm init -y && npm i @stacks/stacking@6 +RUN < /root/stack.js <<'EOM' + const { StackingClient } = require('@stacks/stacking'); + const { StacksTestnet } = require('@stacks/network'); + console.log('Stacking with args:', process.argv.slice(2)); + const network = new StacksTestnet({ url: 'http://localhost:20443' }); + const address = 'ST18MDW2PDTBSCR1ACXYRJP2JX70FWNM6YY2VX4SS'; + const client = new StackingClient(address, network); + client.stack({ + amountMicroStx: parseInt(process.argv[2]), + burnBlockHeight: parseInt(process.argv[3]), + poxAddress: 'mvuYDknzDtPgGqm2GnbAbmGMLwiyW3AwFP', + cycles: 12, + privateKey: '08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01', + fee: 1000, + nonce: 0, + }) + .then(r => console.log('Stacked', r)) + .catch(e => { + console.error('Error stacking', e); + process.exit(1); + }); +EOM +EOF + # Bootstrap chainstates SHELL ["/bin/bash", "-ce"] RUN <