Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main #41

Merged
merged 127 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
5f09fff
feat: stacks 3.0
zone117x Dec 9, 2023
d118d29
ci: attempt to fix build
zone117x Dec 9, 2023
37144c3
ci: attempt build fix
zone117x Dec 9, 2023
0bc97e2
ci: attempt build fix 2
zone117x Dec 9, 2023
a4cea3e
chore: update nodejs install script from deprecated version
zone117x Dec 9, 2023
3ff52f0
chore: bump docker e2e file from bullseye to bookworm
zone117x Dec 9, 2023
7114a1b
chore: fix curl install
zone117x Dec 9, 2023
61ff03a
fix: add new dependencies to Dockerfile.e2e for building stacks-node …
zone117x Dec 10, 2023
d90e0cb
chore: bump stacks-node to wip nakamoto branch
zone117x Dec 10, 2023
800259e
ci: remove deprecated `actions-rs/toolchain`
zone117x Dec 10, 2023
71cfeb5
ci: use built-in cancel-in-progress
zone117x Dec 10, 2023
5ca6d01
feat: almost activating epoch3
zone117x Dec 12, 2023
fb2f31b
stashing some close to working changes
kantai Dec 12, 2023
dec3fe5
okay, working-ish version
kantai Dec 13, 2023
f801252
ah, better working version
kantai Dec 13, 2023
aa53140
build for release
zone117x Dec 13, 2023
7951b47
build for release
zone117x Dec 13, 2023
8f95e53
ci: bump stacks-node commit
zone117x Dec 13, 2023
9c369a1
feat: epoch3 working with docker-compose
zone117x Dec 16, 2023
4551d13
fix: add timeout to bitcoin mining
zone117x Dec 16, 2023
0e7f57e
feat: robust stacking script
zone117x Dec 16, 2023
658bb90
chore: re-enable stacks-api
zone117x Dec 17, 2023
0bc6dc8
bump stacks-core next branch, include tx-broadcasting script
zone117x Dec 20, 2023
6913eb4
chore: bump stacks-node with stability fixes
zone117x Dec 21, 2023
eb4b12f
feat: slow down bitcoin block mining in epoch3
zone117x Dec 21, 2023
74ce0fb
chore: stack for multiple cycles to reduce pox activation flakiness
zone117x Dec 21, 2023
4b7ea50
chore: bump to latest next branch
zone117x Jan 16, 2024
e6330cf
fix: update bitcoin core
zone117x Jan 16, 2024
3d65412
update stacks core commit hash for next (#28)
rafaelcr Jan 23, 2024
204ab4c
chore: bump stacks-node next branch
zone117x Jan 23, 2024
5e7e4a1
fix: specify wallet name in bitcoin conf
zone117x Jan 25, 2024
1d675fd
fix: load btc wallet on startup
zone117x Jan 25, 2024
269b140
fix: stacking with latest version of stack-stx (#30)
rafaelcr Jan 25, 2024
4a8c53f
fix: add `mining_key` for epoch3.0
zone117x Jan 26, 2024
c8f17f3
chore: bump stacks-api
zone117x Jan 26, 2024
ce0db11
chore: bump stacks-node
zone117x Feb 1, 2024
025ae3c
Merge branch 'feat/epoch25' into feat/epoch30
zone117x Feb 1, 2024
2b23270
chore: bump stacks-node in miner docker compose
zone117x Feb 1, 2024
ec7c627
chore: bump stacks-node
zone117x Feb 1, 2024
2fd5faf
fix: add wallet name in bitcoind command
zone117x Feb 2, 2024
457f270
chore: bump stacks-node
zone117x Feb 2, 2024
ad24eb6
chore: bump stacks-api
zone117x Feb 6, 2024
c5e985e
chore: bump latest next
zone117x Feb 6, 2024
e40a25b
fix: stacks-node --config option change
zone117x Feb 6, 2024
7966530
chore: update to next and add pox signer logic
zone117x Feb 20, 2024
b0a8c8e
fix: stacks signature logic
zone117x Feb 21, 2024
1e6ad6a
chore: revert debug changes
zone117x Feb 21, 2024
a8fee88
Merge pull request #31 from hirosystems/chore/update-next-signer-keys
zone117x Feb 21, 2024
8b2307a
chore: bump stacks-node
zone117x Feb 21, 2024
0e0672c
Merge branch 'feat/epoch25' into epoch3-interim-blocks
zone117x Feb 21, 2024
777bf36
chore: bump stacks-node next and stacks.js stacking script
zone117x Feb 28, 2024
a54d816
wip: start of signer in regtest-env
hstove Feb 29, 2024
f7535e3
feat: add event observers to follower config
obycode Mar 1, 2024
bcae21a
fix: set `GIT_COMMIT` for signer
obycode Mar 1, 2024
b338fb7
fix: resolve signer toml template
zone117x Mar 1, 2024
cf8246d
feat: add 3rd signer service
zone117x Mar 1, 2024
4a408be
fix: stacking script bug
zone117x Mar 1, 2024
04c85f0
chore: bump stacks-node next version
zone117x Mar 1, 2024
3333c91
chore: speedup built for stacks-signer (re-use stacks-node, and use d…
zone117x Mar 1, 2024
4373361
feat: stack with multiple accounts at once
zone117x Mar 1, 2024
dd8d5a2
fix: increase prepare length in attempt to reduce timing flakiness
zone117x Mar 1, 2024
e23cf49
feat: unsure stacks-extend is ran in time for next cycle to have stx
zone117x Mar 1, 2024
0fca736
chore: disable self_signing_seed and mining_key in toml
zone117x Mar 1, 2024
df6e8c6
feat: burnchain configs and commit hash
hstove Mar 1, 2024
6937473
fix: re-add miner_key
hstove Mar 1, 2024
c1dec15
feat: add `block_proposal_token`, use auth token commit
hstove Mar 4, 2024
20f56e5
fix: remove vscode settings
hstove Mar 5, 2024
100d103
fix: update JS scripts
obycode Mar 5, 2024
045c05d
feat: new pox-4 signer key args
hstove Mar 6, 2024
2bffdc2
feat: dns now supported in stacks-signer node_host
zone117x Mar 6, 2024
5b11c45
chore: remove unused env vars
zone117x Mar 6, 2024
810e629
fix: silence stacking.js startup errors
zone117x Mar 6, 2024
5cc1d38
Merge pull request #1 from hstove/feat/pox4-amount-auth
hstove Mar 6, 2024
be4158c
feat: latest next
hstove Mar 6, 2024
2e9b5a5
feat: typescript stacker
hstove Mar 6, 2024
783b588
fix: use crypto.random, kill old js file
zone117x Mar 6, 2024
601aadf
fix: update config parameter name `subsequent_attempt_time_ms`
obycode Mar 6, 2024
7da30c1
chore: set bitcoin min interval to 10s pre-3.0
obycode Mar 6, 2024
68770d0
feat: stack with varying amounts for more realistic reward set data
zone117x Mar 7, 2024
ec3e826
fix: npm resolution issues
hstove Mar 6, 2024
805142a
fix: npm stuff, start of monitor script
hstove Mar 7, 2024
8e2d752
fix: conflicts
hstove Mar 7, 2024
54b8025
feat: monitor script/service
hstove Mar 7, 2024
2b9673f
feat: use monitor script for any testnet
hstove Mar 7, 2024
a162cb6
fix: monitor interval, naka block diff
hstove Mar 7, 2024
b013052
feat: update signers with db_path
hstove Mar 8, 2024
eb5252d
feat: show new transactions in monitor
hstove Mar 8, 2024
cc71057
chore: epoch3 bitcoin mining sleep earlier
zone117x Mar 8, 2024
a174f17
feat: use a proper logger
hstove Mar 8, 2024
1708190
feat: more stacking loggin
hstove Mar 8, 2024
2ae8b59
feat: improve logic for stack-extend
hstove Mar 8, 2024
867900d
fix: add burn / stacks height to lag warning
hstove Mar 9, 2024
e3f5312
feat: show time of last stx block
hstove Mar 9, 2024
95d6529
use nodejs lts (v20) docke base
zone117x Mar 13, 2024
1981ed0
fix: use basic tx fee incrementing so that txs are RBF instead of rej…
zone117x Mar 13, 2024
43992b1
remove "forceExtend" logic which seems to trigger txs too early and c…
zone117x Mar 13, 2024
b3ed457
cleanup: move several env vars from js scripts to docker-compose.yml
zone117x Mar 13, 2024
9eef017
[bitcoin mining script] epoch2.5 specific block times
zone117x Mar 13, 2024
301f267
option to configure pox cycle consts via docker-compose.yml
zone117x Mar 13, 2024
5f949e0
fix bug with stx amount integer overflow
zone117x Mar 13, 2024
f6478f8
decrease pox cycle length for faster pox cycles
zone117x Mar 13, 2024
b65df65
js to ts for tx-broadcaster
zone117x Mar 14, 2024
041f4b0
check for account balances before trying to stack higher than availab…
zone117x Mar 14, 2024
cdeac64
chore: remove unused code
zone117x Mar 14, 2024
71dc579
bump stacks blockchain node commit
zone117x Mar 14, 2024
198ef75
Revert "decrease pox cycle length for faster pox cycles"
zone117x Mar 14, 2024
1d059f7
reduce /v2/pox polling
zone117x Mar 14, 2024
13c9ba4
give higher initial stx balance to signer accounts
zone117x Mar 14, 2024
18de9ac
bump stacks-api and stacks-node commit
zone117x Mar 14, 2024
97069a5
cleanup tx-broadcaster script
zone117x Mar 14, 2024
3564463
stack for 1 cycle at a time rather than 2
zone117x Mar 14, 2024
d7dcd08
more tx-broadcaster script cleanup
zone117x Mar 14, 2024
8cbcecc
feat: new next, remove --reward-cycle arg
hstove Mar 15, 2024
72abfc7
docs: api csv dump command
zone117x Mar 18, 2024
504b18f
chore: update stacks-node and stacks-api commits
zone117x Mar 18, 2024
24cfb0f
signers listen to burn_blocks events for https://github.com/stacks-ne…
zone117x Mar 18, 2024
9822ae6
fix: handle any error in `waitForSetup`
hstove Mar 19, 2024
12c9dac
feat: update signer accounts with mnemonic
hstove Mar 19, 2024
43f7ae0
feat: update to latest next and set 2.0 height to 0
obycode Mar 22, 2024
6a6e211
feat: stackers only target 1/2/3 slots
hstove Mar 26, 2024
f186c47
feat: add `flood` script
hstove Mar 22, 2024
9d8f758
Merge pull request #35 from hirosystems/feat/flood
hstove Apr 16, 2024
d4cfc79
feat: improve flooder to support more accounts
hstove Apr 16, 2024
77e2a75
chore: update to latest commit hashes
obycode Aug 16, 2024
579eb84
feat: add env variable STACK_AMOUNT_STX to override stacking amount
hstove Aug 23, 2024
1217a4f
Merge pull request #40 from hirosystems/feat/stack-full-balance
hstove Aug 23, 2024
3c7ed71
fix: adjust bitcoin mined block intervals
CharlieC3 Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 17 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ on:
push:

env:
STACKS_BLOCKCHAIN_COMMIT: "feat/epoch-2.4"
STACKS_BLOCKCHAIN_COMMIT: d0f5712332619b3140badc2d25856975d2747004

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
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
Expand All @@ -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:
Expand Down Expand Up @@ -94,7 +84,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
Expand All @@ -115,13 +105,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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
stacking/node_modules
package-lock.json
6 changes: 3 additions & 3 deletions Dockerfile.btc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:bullseye-backports
FROM debian:bookworm

COPY --from=ruimarinho/bitcoin-core:0.21.1 /opt/bitcoin-*/bin /usr/local/bin
COPY --from=dobtc/bitcoin:25.1 /opt/bitcoin-*/bin /usr/local/bin

RUN apt-get update && apt-get install -y curl/bullseye-backports jq zstd
RUN apt-get update && apt-get install -y curl jq zstd
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
CMD ["/bin/bash"]
103 changes: 77 additions & 26 deletions Dockerfile.e2e
Original file line number Diff line number Diff line change
@@ -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=d0f5712332619b3140badc2d25856975d2747004
ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git

ARG TARGETPLATFORM
Expand Down Expand Up @@ -38,17 +38,20 @@ RUN <<EOF
git reset --hard FETCH_HEAD
fi

apt-get update && apt-get install -y libclang-dev
rustup toolchain install stable
rustup component add rustfmt --toolchain stable
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --package stacks-node --bin stacks-node --release
EOF

FROM debian:bullseye-backports
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=dobtc/bitcoin:25.1 /opt/bitcoin-*/bin /usr/local/bin

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl/bullseye-backports gettext-base jq
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
RUN apt-get update && apt-get install -y curl gettext-base jq
RUN curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh && chmod 500 nsolid_setup_deb.sh && ./nsolid_setup_deb.sh 20 && apt-get install nodejs -y
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

VOLUME /chainstate
Expand Down Expand Up @@ -94,6 +97,15 @@ ENV STACKS_23_HEIGHT=$STACKS_23_HEIGHT
ARG STACKS_24_HEIGHT=111
ENV STACKS_24_HEIGHT=$STACKS_24_HEIGHT

ARG STACKS_25_HEIGHT=112
ENV STACKS_25_HEIGHT=$STACKS_25_HEIGHT

ARG STACKS_30_HEIGHT=132
ENV STACKS_30_HEIGHT=$STACKS_30_HEIGHT

ARG STACKS_PREHEAT_FINISH_HEIGHT=150
ENV STACKS_PREHEAT_FINISH_HEIGHT=$STACKS_PREHEAT_FINISH_HEIGHT

# priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001
# ARG REWARD_RECIPIENT=STQM73RQC4EX0A07KWG1J5ECZJYBZS4SJ4ERC6WN
ARG REWARD_RECIPIENT
Expand Down Expand Up @@ -124,6 +136,33 @@ const server = http.createServer((req, res) => {
EOM
EOF

# Create Stacking script
RUN npm init -y && npm i @stacks/stacking@6
RUN <<EOF
cat > /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: '6a1a754ba863d7bab14adbbc3f8ebb090af9e871ace621d3e5ab634e1422885e01',
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 <<EOF
Expand All @@ -135,8 +174,8 @@ RUN <<EOF
bitcoind &
BTCD_PID=$!
bitcoin-cli -rpcwait getmininginfo
bitcoin-cli createwallet ""
bitcoin-cli importprivkey $BTC_ADDR_WIF "" false
bitcoin-cli -named createwallet wallet_name=main descriptors=false load_on_startup=true
bitcoin-cli -rpcwallet=main importprivkey $BTC_ADDR_WIF "" false
bitcoin-cli generatetoaddress 101 $BTC_ADDR

node event-observer.js &
Expand All @@ -145,7 +184,7 @@ RUN <<EOF
export STACKS_EVENT_OBSERVER="127.0.0.1:3998"
mkdir -p /chainstate/stacks-blockchain-data
envsubst < config.toml.in > config.toml
stacks-node start --config=config.toml &
stacks-node start --config config.toml &
STACKS_PID=$!

while true; do
Expand All @@ -157,27 +196,39 @@ RUN <<EOF
sleep 0.5s
done

DEFAULT_TIMEOUT=$(($(date +%s) + 30))
SENT_STACKING=0
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..."
if [ "$CONFS" = "0" ] || [ $(date +%s) -gt $DEFAULT_TIMEOUT ]; then
if [ $(date +%s) -gt $DEFAULT_TIMEOUT ]; then
echo "Timed out waiting for a mempool tx, mining a btc block..."
else
echo "Detected Stacks mining mempool tx, mining btc block..."
fi
bitcoin-cli generatetoaddress 1 $BTC_ADDR
DEFAULT_TIMEOUT=$(($(date +%s) + 30))
chain_height=$(bitcoin-cli getblockcount)
echo "Current Bitcoin chain height: $chain_height"

while true; do
HEIGHT=$(curl -s localhost:20443/v2/info | jq '.burn_block_height')
if [ "$HEIGHT" = "$chain_height" ]; then
echo "Stacks node caught up to Bitcoin block $HEIGHT"
break
else
echo "Stacks node burn height: $HEIGHT, waiting for $chain_height"
fi
sleep 0.1s
done

if [ "$chain_height" = "$STACKS_24_HEIGHT" ]; then
POX_CONTRACT=$(curl -s localhost:20443/v2/pox | jq -r '.contract_id')
BURN_HEIGHT=$(curl -s localhost:20443/v2/pox | jq -r '.current_burnchain_block_height')
echo "POX contract check $BURN_HEIGHT $POX_CONTRACT"
if [ "$POX_CONTRACT" = "ST000000000000000000002AMW42H.pox-4" ] && [ "$SENT_STACKING" = "0" ]; then
echo "POX contract is pox-4"
SENT_STACKING=1
# issue a stack-stx tx, required for epoch3.0 transition
POX_STATE=$(curl -s localhost:20443/v2/pox)
echo "Stack STX tx for epoch3.0 transition"
echo "$POX_STATE" | jq '.'
MIN_STACKING_AMOUNT="8500000000000000"
BURN_HEIGHT=$(echo $POX_STATE | jq '.current_burnchain_block_height + 1')
node /root/stack.js $MIN_STACKING_AMOUNT $BURN_HEIGHT
sleep 5s
fi

if [ "$chain_height" = "$STACKS_PREHEAT_FINISH_HEIGHT" ]; then
break
fi

Expand Down Expand Up @@ -223,12 +274,12 @@ cat > 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..."
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.stacker
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:20-bookworm as builder

RUN apt-get update && apt-get install -y curl gettext-base jq

WORKDIR /root
COPY ./stacking/package.json /root/
RUN npm i

COPY ./stacking/stacking.ts ./stacking/common.ts ./stacking/monitor.ts ./stacking/tx-broadcaster.ts /root/

CMD ["npx", "tsx", "/root/stacking.ts"]
5 changes: 2 additions & 3 deletions Dockerfile.stacks-api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-bullseye as builder
FROM node:20-bookworm as builder

ARG GIT_COMMIT
RUN test -n "$GIT_COMMIT" || (echo "GIT_COMMIT not set" && false)
Expand All @@ -17,9 +17,8 @@ RUN git describe --tags --abbrev=0 || git -c user.name='user' -c user.email='ema
RUN echo "GIT_TAG=$(git tag --points-at HEAD)" >> .env

RUN npm config set update-notifier false && \
npm config set unsafe-perm true && \
npm ci --audit=false && \
npm run build && \
npm prune --production
npm prune --omit=dev

CMD ["node", "./lib/index.js"]
17 changes: 11 additions & 6 deletions Dockerfile.stacks-node
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
FROM rust:bullseye as builder
FROM rust:bookworm as builder

# TODO: is there a built-in required arg syntax?
ARG GIT_COMMIT
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 --package stacks-signer --bin stacks-node --bin stacks-signer

FROM debian:bullseye-backports
FROM debian:bookworm

COPY --from=builder /stacks/target/release/stacks-node /usr/local/bin/
COPY --from=builder /stacks/target/debug/stacks-node /usr/local/bin/
COPY --from=builder /stacks/target/debug/stacks-signer /usr/local/bin/

COPY --from=ruimarinho/bitcoin-core:0.21.1 /opt/bitcoin-*/bin /usr/local/bin
COPY --from=dobtc/bitcoin:25.1 /opt/bitcoin-*/bin /usr/local/bin

RUN apt-get update && apt-get install -y curl/bullseye-backports gettext-base jq
RUN apt-get update && apt-get install -y curl gettext-base jq
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /root
Expand Down
Loading
Loading