Skip to content

Commit

Permalink
sserver: log chain name when finding blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
SwimmingTiger committed May 15, 2020
1 parent 18bf00e commit 0e757b5
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 18 deletions.
1 change: 0 additions & 1 deletion docker/btcpool/test/bch/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/bch/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/bch/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/bch/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/beam/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/beam/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/beam/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/beam/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/bsv/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/bsv/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/bsv/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/bsv/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/btc/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/btc/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/btc/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/btc/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/ltc/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/ltc/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/ltc/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/ltc/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/ubtc/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/ubtc/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/ubtc/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/ubtc/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
1 change: 0 additions & 1 deletion docker/btcpool/test/zec/testcase/0000-build-image

This file was deleted.

40 changes: 40 additions & 0 deletions docker/btcpool/test/zec/testcase/0000-build-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

DOCKER_COMPOSE="docker-compose --no-ansi"

BUILD_ARGS="--build-arg BUILD_JOBS=$(nproc) --build-arg BUILD_TESTING=ON"
if [ "$APT_MIRROR_URL" != "" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg APT_MIRROR_URL=$APT_MIRROR_URL"
fi
if [ "$NO_CACHE" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --no-cache"
fi

if [ "$BUILD_BASE_IMAGE" != "" ]; then
echo "build base image..."
cd "$BASE_DIR/../../base-image"
docker build -t $BASE_IMAGE -f Dockerfile.btc $BUILD_ARGS . | tee -a $STDOUT
echo "done"
fi

if [ "$DEBUG" = "1" ]; then
BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_TYPE=Debug"
fi

echo "build btcpool-$TEST_SUITE image..."
cd "$BASE_DIR/.."
echo "build args: $BUILD_ARGS"
docker build -t btccom/btcpool-$TEST_SUITE -f Dockerfile $BUILD_ARGS --build-arg BASE_IMAGE=$BASE_IMAGE ../../.. | tee -a $STDOUT
echo "done"

if [ -f "$BASE_DIR/docker-compose.yml" ]; then
echo "build docker compose..."
cd "$BASE_DIR"
$DOCKER_COMPOSE build | tee -a $STDOUT
echo "done"

echo "clear old docker compose..."
$DOCKER_COMPOSE down | tee -a $STDOUT
echo "done"
fi
1 change: 0 additions & 1 deletion docker/btcpool/test/zec/testcase/0005-unittest

This file was deleted.

4 changes: 4 additions & 0 deletions docker/btcpool/test/zec/testcase/0005-unittest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

docker run --rm btccom/btcpool-${TEST_SUITE} unittest
4 changes: 2 additions & 2 deletions src/bitcoin/StratumServerBitcoin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ void ServerBitcoin::checkShare(
sendSolvedShare2Kafka(chainId, &foundBlock, coinbaseBin);

if (sjob->proxyJobDifficulty_ > 0) {
LOG(INFO) << ">>>> solution found: " << blkHash.ToString()
LOG(INFO) << ">>>> [" << chainName(chainId) << "] solution found: " << blkHash.ToString()
<< ", jobId: " << share.jobid()
<< ", userId: " << share.userid() << ", by: " << workFullName
<< " <<<<";
Expand All @@ -633,7 +633,7 @@ void ServerBitcoin::checkShare(
GetJobRepository(chainId)->markAllJobsAsStale(height);
});

LOG(INFO) << ">>>> found a new block: " << blkHash.ToString()
LOG(INFO) << ">>>> [" << chainName(chainId) << "] found a new block: " << blkHash.ToString()
<< ", jobId: " << share.jobid()
<< ", userId: " << share.userid() << ", by: " << workFullName
<< " <<<<";
Expand Down
4 changes: 2 additions & 2 deletions src/eth/StratumServerEth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ void ServerEth::checkShareAndUpdateDiff(
Uint256ToEthash256(sjob->networkTarget_, ethashTarget);
if (ethash_quick_check_difficulty(
&ethashHeader, nonce, &ethashMixHash, &ethashTarget)) {
LOG(INFO) << "preliminary solution found, header hash: "
LOG(INFO) << "[" << chainName(chainId) << "] preliminary solution found, header hash: "
<< header.GetHex() << ", nonce: " << nonce
<< ", mix digest: " << mixHash->GetHex()
<< ", network target: " << sjob->networkTarget_.GetHex()
Expand Down Expand Up @@ -598,7 +598,7 @@ void ServerEth::checkShareAndUpdateDiff(
}

if (isSubmitInvalidBlock_ || bnShareTarget <= bnNetworkTarget) {
LOG(INFO) << "solution found, share target: " << shareTarget.GetHex()
LOG(INFO) << "[" << chainName(chainId) << "] solution found, share target: " << shareTarget.GetHex()
<< ", network target: " << sjob->networkTarget_.GetHex()
<< ", worker: " << workFullName;

Expand Down

0 comments on commit 0e757b5

Please sign in to comment.