Skip to content

Commit

Permalink
stashing some close to working changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kantai committed Dec 12, 2023
1 parent 5ca6d01 commit fb2f31b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
16 changes: 11 additions & 5 deletions 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=16bb6887f84a299b5bbbe4c469337169849ce6ed
ARG GIT_COMMIT=390dffc7e3593711c1f55505d3308063a2039df6
ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git

ARG TARGETPLATFORM
Expand Down Expand Up @@ -41,12 +41,12 @@ RUN <<EOF
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
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --package stacks-node --bin stacks-node
EOF

FROM debian:bookworm-backports

COPY --from=builder /stacks/target/release/stacks-node /usr/local/bin/
COPY --from=builder /stacks/target/debug/stacks-node /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
Expand Down Expand Up @@ -100,10 +100,10 @@ ENV STACKS_24_HEIGHT=$STACKS_24_HEIGHT
ARG STACKS_25_HEIGHT=112
ENV STACKS_25_HEIGHT=$STACKS_25_HEIGHT

ARG STACKS_30_HEIGHT=121
ARG STACKS_30_HEIGHT=131
ENV STACKS_30_HEIGHT=$STACKS_30_HEIGHT

ARG STACKS_PREHEAT_FINISH_HEIGHT=130
ARG STACKS_PREHEAT_FINISH_HEIGHT=150
ENV STACKS_PREHEAT_FINISH_HEIGHT=$STACKS_PREHEAT_FINISH_HEIGHT

# priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001
Expand Down Expand Up @@ -292,12 +292,18 @@ cat > run.sh <<'EOM'
STACKS_PID=$!

function start_miner() {
DEFAULT_TIMEOUT=$(date -v+30S +%s)
while true; do
TX=$(bitcoin-cli listtransactions '*' 1 0 true)
CONFS=$(echo "$TX" | jq '.[].confirmations')
NOW=$(date +%s)
if [ "$CONFS" = "0" ]; then
echo "Detected Stacks mining mempool tx, mining btc block..."
bitcoin-cli generatetoaddress 1 $BTC_ADDR
DEFAULT_TIMEOUT=$(date -v+30S +%s)
elif [[ $NOW -ge $DEFAULT_TIMEOUT ]]; then
bitcoin-cli generatetoaddress 1 $BTC_ADDR
DEFAULT_TIMEOUT=$(date -v+30S +%s)
fi
sleep $MINE_INTERVAL
done
Expand Down
23 changes: 16 additions & 7 deletions stacks-krypton-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name = "krypton-node"
rpc_bind = "0.0.0.0:20443"
p2p_bind = "0.0.0.0:20444"
data_url = "http://127.0.0.1:20443"
p2p_address = "127.0.0.1:20443"
working_dir = "$DATA_DIR"

seed = "$MINER_SEED"
Expand All @@ -10,15 +12,20 @@ local_peer_seed = "$MINER_SEED"
miner = true
use_test_genesis_chainstate = true
pox_sync_sample_secs = 0
wait_time_for_blocks = 0
wait_time_for_microblocks = 50
wait_time_for_blocks = 200
wait_time_for_microblocks = 0
mine_microblocks = false
microblock_frequency = 1000
# mine_microblocks = true
# max_microblocks = 10

[miner]
first_attempt_time_ms = 5000
subsequent_attempt_time_ms = 5000
min_tx_fee = 1
first_attempt_time_ms = 180_000
second_attempt_time_ms = 360_000
wait_for_block_download = false
microblock_attempt_time_ms = 10
self_signing_seed = 1
$REWARD_RECIPIENT_CONF

[connection_options]
Expand All @@ -32,10 +39,12 @@ public_ip_address = "1.1.1.1:1234"

[burnchain]
chain = "bitcoin"
mode = "neon"
mode = "nakamoto-neon"
poll_time_secs = 1
pox_prepare_length = 3
pox_2_activation = $STACKS_POX2_HEIGHT
magic_bytes = "T3"
pox_prepare_length = 5
pox_reward_length = 10
burn_fee_cap = 20_000

### bitcoind-regtest connection info
peer_host = "$BITCOIN_PEER_HOST"
Expand Down

0 comments on commit fb2f31b

Please sign in to comment.