-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1567 from CounterpartyXCP/develop
v10.0.0-rc.1
- Loading branch information
Showing
66 changed files
with
8,137 additions
and
3,514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
if [ -f "./DOCKER_COMPOSE_TEST_LOCK" ]; then | ||
echo "A test is already running. Exiting." | ||
exit 1 | ||
fi | ||
touch "./DOCKER_COMPOSE_TEST_LOCK" | ||
|
||
GIT_BRANCH="$1" | ||
|
||
# pull the latest code | ||
rm -rf counterparty-core | ||
git clone --branch "$GIT_BRANCH" https://github.com/CounterpartyXCP/counterparty-core.git | ||
cd counterparty-core | ||
|
||
VERSION=$(cat docker-compose.yml | grep 'image: counterparty/counterparty:' | awk -F ":" '{print $3}') | ||
|
||
# stop the running containers | ||
docker compose stop | ||
|
||
# remove counterparty-core container | ||
docker rm counterparty-core-counterparty-core-1 | ||
|
||
# remove counterparty-core image | ||
docker rmi counterparty/counterparty:$VERSION || true | ||
|
||
# build the counterparty-core new image | ||
docker build -t counterparty/counterparty:$VERSION . | ||
|
||
# remove the counterparty-core data | ||
sudo rm -rf ~/counterparty-docker-data/counterparty/* | ||
|
||
# re-start containers | ||
COUNTERPARTY_NETWORK=test docker compose up -d | ||
|
||
while [ "$(docker compose logs counterparty-core 2>&1 | grep 'Ready for queries')" = "" ]; do | ||
echo "Waiting for counterparty-core to be ready" | ||
sleep 1 | ||
done | ||
|
||
rm -f ../DOCKER_COMPOSE_TEST_LOCK | ||
|
||
server_response=$(curl -X POST http://127.0.0.1:14000/api/ \ | ||
--user rpc:rpc \ | ||
-H 'Content-Type: application/json; charset=UTF-8'\ | ||
-H 'Accept: application/json, text/javascript' \ | ||
--data-binary '{ "jsonrpc": "2.0", "id": 0, "method": "get_running_info" }' \ | ||
--write-out '%{http_code}' --silent --output /dev/null) | ||
|
||
if [ "$server_response" -ne 200 ]; then | ||
echo "Failed to get_running_info" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test Docker Compose | ||
|
||
on: | ||
push: | ||
branches: ['develop'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get branch names. | ||
id: branch-names | ||
uses: tj-actions/branch-names@v8 | ||
- uses: alinz/ssh-scp-action@master | ||
with: | ||
key: ${{ secrets.TEST_SERVER_KEY }} | ||
host: ${{ secrets.TEST_SERVER_IP }} | ||
user: ${{ secrets.TEST_SERVER_USER }} | ||
ssh_before: | | ||
rm -f test_compose.sh | ||
scp: | | ||
.github/workflows/test_compose.sh ${{ secrets.TEST_SERVER_USER }}@${{ secrets.TEST_SERVER_IP }}:~/test_compose.sh | ||
ssh_after: | | ||
sh test_compose.sh ${{ steps.branch-names.outputs.current_branch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,38 @@ The simplest way to get your Counterparty node up and running is to use Docker C | |
sudo apt install docker-compose | ||
``` | ||
|
||
Then, for `mainnet`, run: | ||
Then run node services in background with: | ||
|
||
```bash | ||
docker-compose -f simplenode/compose.yml up | ||
git clone [email protected]:CounterpartyXCP/counterparty-core.git | ||
cd counterparty-core | ||
mkdir ~/counterparty-docker-data | ||
docker-compose up -d | ||
``` | ||
|
||
For `testnet`, modify the Docker Compose file in `simplenode/` and then run: | ||
**To run a node you must have at least 1.5TB free.** By default all data is stored in the `~/counterparty-docker-data` folder. You can modify this folder with the environment variable `$COUNTERPARTY_DOCKER_DATA`. For example: | ||
|
||
```bash | ||
COUNTERPARTY_DOCKER_DATA=/var/data docker-compose up -d | ||
``` | ||
|
||
Use `docker-compose logs` to view output from services. For example: | ||
|
||
```bash | ||
docker-compose -f simplenode/compose.yml -p simplenode-testnet up | ||
docker-compose logs --tail=10 -f bitcoind | ||
docker-compose logs --tail=10 -f addrindexrs | ||
docker-compose logs --tail=10 -f counterparty-core | ||
``` | ||
|
||
You can use the environment variable `COUNTERPARTY_NETWORK` to run a `testnet` node: | ||
|
||
``` | ||
COUNTERPARTY_NETWORK=test docker-compose up -d | ||
``` | ||
|
||
Then wait for your node to catch up with the network. Note: this process currently takes a long time, beause it does not make use of the `bootstrap` or `kickstart` functionality. (See below.) | ||
NOTES: | ||
- By default, this Docker Compose script makes use of the `bootstrap` functionality, because Docker makes it hard to use `kickstart`. (See below.) | ||
- When working with a low-memory system, you can tell `addrindexrs` to use JSON-RPC to communicate with `bitcoind` using the environment variable `ADDRINDEXRS_JSONRPC_IMPORT`: `ADDRINDEXRS_JSONRPC_IMPORT=true docker-compose up -d` | ||
|
||
|
||
# Manual Installation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.