Merge pull request #1982 from blockstack/feat/net-test-docker

Add Dockerfile that can run net-test scripts
This commit is contained in:
Aaron Blankstein
2020-10-20 15:45:43 -05:00
committed by GitHub
3 changed files with 23 additions and 1 deletions

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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"