Skip to content

Commit

Permalink
Merge pull request #1771 from CounterpartyXCP/develop
Browse files Browse the repository at this point in the history
v10.1.2
  • Loading branch information
adamkrellenstein authored May 8, 2024
2 parents 1f801a3 + 0a37382 commit aac6448
Show file tree
Hide file tree
Showing 110 changed files with 17,948 additions and 3,176 deletions.
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Nice work! 🎉 You're about to create pull request on the Counterparty Core codebase. As part of this process, please be sure to:
You're about to create pull request on the Counterparty Core codebase! 🎉 As part of this process, please be sure to:

* [ ] Double-check the spelling and grammar of all strings, code comments, etc.
* [ ] Double-check that all code that needs to be is deterministic
* [ ] Add tests to cover any new features
* [ ] Ensure that the test suite passes with the proposed changes
* [ ] Update the project [release notes](release-notes/)
* [ ] Create a corresponding Pull Request in the [official Documentation repository](https://github.com/CounterpartyXCP/Documentation)
* [ ] Update the project documentation as appropriate with a corresponding Pull Request in the [Documentation repository](https://github.com/CounterpartyXCP/Documentation)

... and be sure to label the Pull Request as a "draft" for as long as it is not ready to be merged into `develop`.
18 changes: 9 additions & 9 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
macos-x86_64:
runs-on: macos-12 #x86_64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencies

Expand Down Expand Up @@ -72,15 +72,15 @@ jobs:
# Upload wheels

- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: macos-x86_64-wheels
path: dist

macos-m1:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencies

Expand Down Expand Up @@ -134,15 +134,15 @@ jobs:
# Upload wheels

- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: macos-m1-wheels
path: dist

ubuntu-22-04:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencies

Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
# Upload wheels

- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: ubuntu-22-04-wheels
path: dist
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Docker
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license_scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Docker
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
75 changes: 63 additions & 12 deletions .github/workflows/test_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x

if [ -f "./DOCKER_COMPOSE_TEST_LOCK" ]; then
echo "A test is already running. Exiting."
echo "A test is already running or the last one failed. Exiting."
exit 1
fi
touch "./DOCKER_COMPOSE_TEST_LOCK"
Expand All @@ -19,7 +19,8 @@ cd counterparty-core
VERSION=$(cat docker-compose.yml | grep 'image: counterparty/counterparty:' | awk -F ":" '{print $3}')

# stop the running containers
docker compose stop
docker compose --profile mainnet stop counterparty-core
docker compose --profile testnet stop counterparty-core-testnet

# remove counterparty-core container
#docker rm counterparty-core-counterparty-core-1
Expand All @@ -31,27 +32,77 @@ 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 ~/.local/share/counterparty-docker-data/counterparty/*

# re-start containers
BITCOIN_CHAIN=test docker compose up -d
docker compose --profile mainnet up -d
docker compose --profile testnet up -d

# wait for counterparty-core to be ready
while [ "$(docker compose logs counterparty-core 2>&1 | grep 'Ready for queries')" = "" ]; do
echo "Waiting for counterparty-core to be ready"
echo "Waiting for counterparty-core mainnet to be ready"
sleep 1
done

rm -f ../DOCKER_COMPOSE_TEST_LOCK
while [ "$(docker compose logs counterparty-core-testnet 2>&1 | grep 'Ready for queries')" = "" ]; do
echo "Waiting for counterparty-core testnet to be ready"
sleep 1
done


# check running info with API v1 mainnet
response_v1_mainnet=$(curl -X POST http://127.0.0.1:4100/v1/ \
--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 [ "$response_v1_mainnet" -ne 200 ]; then
echo "Failed to get_running_info mainnet"
exit 1
fi

server_response=$(curl -X POST http://127.0.0.1:14000/api/ \
# check running info with API v1 testnet
response_v1_testnet=$(curl -X POST http://127.0.0.1:14100/v1/ \
--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"
if [ "$response_v1_testnet" -ne 200 ]; then
echo "Failed to get_running_info testnet"
exit 1
fi

# check running info with API v2 mainnet
response_v2_mainnet=$(curl http://api:[email protected]:4000/v2/ \
--write-out '%{http_code}' --silent --output /dev/null)

if [ "$response_v2_mainnet" -ne 200 ]; then
echo "Failed to get API v2 root mainnet"
exit 1
fi

# check running info with API v2 testnet
response_v2_testnet=$(curl http://api:[email protected]:14000/v2/ \
--write-out '%{http_code}' --silent --output /dev/null)

if [ "$response_v2_mainnet" -ne 200 ]; then
echo "Failed to get API v2 root mainnet"
exit 1
fi
fi


# Run dredd test
dredd

# Run compare hashes test
. "$HOME/.profile"
cd counterparty-core
hatch env prune
hatch run pytest counterpartycore/test/compare_hashes_test.py --comparehashes
cd ..


rm -f ../DOCKER_COMPOSE_TEST_LOCK
exit 0
7 changes: 3 additions & 4 deletions .github/workflows/test_compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: Docker Compose

on:
push:
branches: ['develop', 'master']
#branches: ['compose']
branches: ['develop', 'master', "compose"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v8
Expand All @@ -23,4 +22,4 @@ jobs:
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 }}
sh test_compose.sh ${{ steps.branch-names.outputs.current_branch }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ env
venv
docs/_build/*
target/
typings/
pyrightconfig.json
.DS_Store

profile.txt

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM ubuntu:22.04

RUN apt-get update
# install dependencies
RUN apt-get install -y python3 python3-dev python3-pip libleveldb-dev curl
RUN apt-get install -y python3 python3-dev python3-pip libleveldb-dev curl gnupg

# install rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand All @@ -14,16 +14,16 @@ ENV PATH="/root/.cargo/bin:${PATH}"
# install maturin
RUN pip3 install maturin

# copy repository
# copy README
COPY README.md /README.md
COPY ./counterparty-rs /counterparty-rs
COPY ./counterparty-core /counterparty-core

# install counterparty-rs
COPY ./counterparty-rs /counterparty-rs
WORKDIR /counterparty-rs
RUN pip3 install .

# install counterparty-core
COPY ./counterparty-core /counterparty-core
WORKDIR /counterparty-core
RUN pip3 install .

Expand Down
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [ ] Review all open pull requests
- [ ] Write release notes
- [ ] Add a checkpoint verified on all supported versions
- [ ] Update the list of servers to compare hashes with (in `test/compare_hashes_test.py`)
- [ ] Create pull request against `master`
- [ ] Ensure all tests pass in CI
- [ ] Merge PR into `master`
Expand All @@ -21,7 +22,7 @@

# Announcements

- [ ] [Official Forums](https://forums.counterparty.io/t/new-version-announcements-counterparty-and-counterpartyd/363))
- [ ] [Official Forums](https://forums.counterparty.io/t/new-version-announcements-counterparty-and-counterpartyd/363)
- [ ] Mailing list
- [ ] Telegram
- [ ] Twitter
Loading

0 comments on commit aac6448

Please sign in to comment.