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

wip: start of signer in regtest-env #32

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
STACKS_BLOCKCHAIN_COMMIT: 9385b423609f0b5dabe7ffb66ed4db9f2f68a485
STACKS_BLOCKCHAIN_COMMIT: d0f5712332619b3140badc2d25856975d2747004

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FROM rust:bookworm as builder

# A commit hash, tag, or branch
ARG GIT_COMMIT=9385b423609f0b5dabe7ffb66ed4db9f2f68a485
ARG GIT_COMMIT=d0f5712332619b3140badc2d25856975d2747004
ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git

ARG TARGETPLATFORM
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.stacker
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:18-bookworm as builder
RUN apt-get update && apt-get install -y curl gettext-base jq

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

CMD ["node", "/root/stacking.js"]
CMD ["npx", "tsx", "/root/stacking.ts"]
5 changes: 3 additions & 2 deletions Dockerfile.stacks-node
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ RUN git init && \
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: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=dobtc/bitcoin:25.1 /opt/bitcoin-*/bin /usr/local/bin

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-follower.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"

x-common-vars:
- &STACKS_BLOCKCHAIN_COMMIT 9385b423609f0b5dabe7ffb66ed4db9f2f68a485
- &STACKS_BLOCKCHAIN_COMMIT d0f5712332619b3140badc2d25856975d2747004
- &MINER_PUB_KEY 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c
- &BITCOIN_PEER_PORT 18444
- &BITCOIN_RPC_PORT 18443
Expand Down
80 changes: 76 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: "3.9"

x-common-vars:
- &STACKS_BLOCKCHAIN_COMMIT 9385b423609f0b5dabe7ffb66ed4db9f2f68a485
- &STACKS_BLOCKCHAIN_COMMIT 04e5eb2ee854b9f467170cf8211cb42eda259230
- &BTC_ADDR miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT
- &MINER_SEED 9e446f6b0c6a96cf2190e54bcd5a8569c3e386f091605499464389b8d4e0bfc201 # stx: STEW4ZNT093ZHK4NEQKX8QJGM2Y7WWJ2FQQS5C19, btc: miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT, pub_key: 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c, wif: cStMQXkK5yTFGP3KbNXYQ3sJf2qwQiKrZwR9QJnksp32eKzef1za
- &BITCOIN_PEER_PORT 18444
- &BITCOIN_RPC_PORT 18443
- &BITCOIN_RPC_USER btc
- &BITCOIN_RPC_PASS btc
- &MINE_INTERVAL ${MINE_INTERVAL:-0.5s}
- &MINE_INTERVAL ${MINE_INTERVAL:-10s}
- &MINE_INTERVAL_EPOCH3 ${MINE_INTERVAL_EPOCH3:-600s} # 10 minute bitcoin block times in epoch 3
- &STACKS_20_HEIGHT ${STACKS_20_HEIGHT:-101}
- &STACKS_2_05_HEIGHT ${STACKS_2_05_HEIGHT:-102}
Expand All @@ -18,7 +18,7 @@ x-common-vars:
- &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:-122}
- &STACKS_30_HEIGHT ${STACKS_30_HEIGHT:-131}
- &REWARD_RECIPIENT ${REWARD_RECIPIENT:-STQM73RQC4EX0A07KWG1J5ECZJYBZS4SJ4ERC6WN} # priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001

services:
Expand Down Expand Up @@ -119,7 +119,7 @@ services:
environment:
# STACKS_LOG_TRACE: 1 # uncomment for trace logging
# STACKS_LOG_DEBUG: 1
STACKS_EVENT_OBSERVER: stacks-api:3700
# RUST_LOG: debug
DATA_DIR: /chainstate/stacks-blockchain-miner-data
BITCOIN_PEER_HOST: bitcoind
BITCOIN_PEER_PORT: *BITCOIN_PEER_PORT
Expand Down Expand Up @@ -229,6 +229,78 @@ services:
BTC_RPC_PW: btc
BTC_FAUCET_PK: *MINER_SEED

stacks-signer-1:
networks:
- stacks
build:
context: .
dockerfile: Dockerfile.stacks-node
args:
GIT_COMMIT: *STACKS_BLOCKCHAIN_COMMIT
depends_on:
- stacks-node
volumes:
- ./signer-0.toml:/root/config.toml.in
environment:
STACKS_NODE_HOST: stacks-node:20443
STACKS_SIGNER_ENDPOINT: 0.0.0.0:30001
SIGNER_PRIVATE_KEY: 08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01
entrypoint:
- /bin/bash
- -c
- |
set -e
envsubst < config.toml.in > config.toml
exec stacks-signer run --config config.toml --reward-cycle 1

stacks-signer-2:
networks:
- stacks
build:
context: .
dockerfile: Dockerfile.stacks-node
args:
GIT_COMMIT: *STACKS_BLOCKCHAIN_COMMIT
depends_on:
- stacks-node
volumes:
- ./signer-0.toml:/root/config.toml.in
environment:
STACKS_NODE_HOST: stacks-node:20443
STACKS_SIGNER_ENDPOINT: 0.0.0.0:30002
SIGNER_PRIVATE_KEY: ce109fee08860bb16337c76647dcbc02df0c06b455dd69bcf30af74d4eedd19301
entrypoint:
- /bin/bash
- -c
- |
set -e
envsubst < config.toml.in > config.toml
exec stacks-signer run --config config.toml --reward-cycle 1

stacks-signer-3:
networks:
- stacks
build:
context: .
dockerfile: Dockerfile.stacks-node
args:
GIT_COMMIT: *STACKS_BLOCKCHAIN_COMMIT
depends_on:
- stacks-node
volumes:
- ./signer-0.toml:/root/config.toml.in
environment:
STACKS_NODE_HOST: stacks-node:20443
STACKS_SIGNER_ENDPOINT: 0.0.0.0:30003
SIGNER_PRIVATE_KEY: e75dcb66f84287eaf347955e94fa04337298dbd95aa0dbb985771104ef1913db01
entrypoint:
- /bin/bash
- -c
- |
set -e
envsubst < config.toml.in > config.toml
exec stacks-signer run --config config.toml --reward-cycle 1

networks:
stacks:
volumes:
Expand Down
6 changes: 6 additions & 0 deletions signer-0.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stacks_private_key = "$SIGNER_PRIVATE_KEY"
node_host = "$STACKS_NODE_HOST" # eg "127.0.0.1:20443"
# must be added as event_observer in node config:
endpoint = "$STACKS_SIGNER_ENDPOINT" # e.g 127.0.0.1:30000
network = "testnet"
auth_password = "12345"
10 changes: 8 additions & 2 deletions stacking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"name": "stacking",
"version": "1.0.0",
"description": "",
"main": "stacking.js",
"type": "module",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@stacks/stacking": "6.11.4-pr.a8fa50e.0"
"@stacks/encryption": "6.11.3",
"@stacks/network": "6.11.3",
"@stacks/stacking": "6.11.4-pr.36558cf.0",
"@stacks/transactions": "6.11.3"
},
"devDependencies": {
"tsx": "4.7.1"
}
}
86 changes: 0 additions & 86 deletions stacking/stacking.js

This file was deleted.

Loading
Loading