Skip to content

Commit

Permalink
Merge pull request #1982 from blockstack/feat/net-test-docker
Browse files Browse the repository at this point in the history
Add Dockerfile that can run net-test scripts
  • Loading branch information
kantai authored Oct 20, 2020
2 parents 26cf9a2 + a8a2457 commit 7ed580f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/actions/bitcoin-int-tests/Dockerfile.net-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM rust:buster

WORKDIR /src

COPY . .

RUN cd / && wget https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
RUN cd / && tar -xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz

RUN ln -s /bitcoin-0.20.0/bin/bitcoind /bin/
RUN ln -s /bitcoin-0.20.0/bin/bitcoin-cli /bin/

RUN apt-get update
RUN apt-get install -y jq screen net-tools ncat

RUN cargo build --workspace

ENV PATH="/src/target/debug:/src/net-test/bin:${PATH}"

WORKDIR /src/net-test/bin
RUN bash
1 change: 1 addition & 0 deletions net-test/bin/faucet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ http_401() {
http_500() {
local ERR="$1"
local ERR_LEN=${#ERR}
log "500 error: ${ERR}"
printf "HTTP/1.0 500 Internal Server error\r\nContent-Length: $ERR_LEN\r\nContent-Type: text/plain\r\n\r\n$ERR"
}

Expand Down
2 changes: 1 addition & 1 deletion net-test/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ start_bitcoind() {
logln "ok"

log "Starting bitcoind..."
bitcoind -conf="$BITCOIN_CONF" >"$BITCOIN_LOGFILE" 2>&1 &
bitcoind -fallbackfee=0.0002 -conf="$BITCOIN_CONF" >"$BITCOIN_LOGFILE" 2>&1 &
local BITCOIN_PID=$!
logln "PID $BITCOIN_PID"

Expand Down

0 comments on commit 7ed580f

Please sign in to comment.