mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-09 00:24:23 +01:00
Merge pull request #101 from sr-gi/small-fixes
Simplifies circle-ci + small fixes
This commit is contained in:
@@ -18,21 +18,15 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
# Get bitcoin_sandbox
|
|
||||||
- run:
|
|
||||||
name: Get bitcoin_sandbox
|
|
||||||
command: git clone --single-branch --branch ln https://github.com/sr-gi/bitcoin_sandbox.git
|
|
||||||
|
|
||||||
# Download and cache dependencies
|
# Download and cache dependencies
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
- v1-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "test/pisa/e2e/bitcoind_snap.sh" }}
|
||||||
# fallback to using the latest cache if no exact match is found
|
|
||||||
- v2-dependencies-
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
command: |
|
command: |
|
||||||
|
sudo snap install `cat test/pisa/e2e/bitcoind_snap.sh`
|
||||||
pyenv local 3.7.0
|
pyenv local 3.7.0
|
||||||
python3 -m venv venv
|
python3 -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
@@ -40,23 +34,12 @@ jobs:
|
|||||||
pip install -r pisa/requirements.txt
|
pip install -r pisa/requirements.txt
|
||||||
pip install -r pisa/requirements-dev.txt
|
pip install -r pisa/requirements-dev.txt
|
||||||
pip install -r apps/cli/requirements-dev.txt
|
pip install -r apps/cli/requirements-dev.txt
|
||||||
pip install -r bitcoin_sandbox/requirements.txt
|
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- ./venv
|
- ./venv
|
||||||
key: v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
- /snap
|
||||||
|
key: v1-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "test/pisa/e2e/bitcoind_snap.sh" }}
|
||||||
# Build docker env for E2E testing
|
|
||||||
- run:
|
|
||||||
name: Build bitcoin_sandbox
|
|
||||||
command: |
|
|
||||||
cp test/pisa/e2e/bitcoin.conf bitcoin_sandbox/
|
|
||||||
cp test/pisa/e2e/sandbox-conf.py bitcoin_sandbox/bitcoin_sandbox/conf.py
|
|
||||||
cp bitcoin_sandbox/docker/Dockerfile_ubuntu_no_ln bitcoin_sandbox/Dockerfile
|
|
||||||
. venv/bin/activate
|
|
||||||
cd bitcoin_sandbox && python -m bitcoin_sandbox.run_scenarios
|
|
||||||
|
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
- run:
|
- run:
|
||||||
@@ -83,6 +66,14 @@ jobs:
|
|||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pytest test/apps/cli/unit
|
pytest test/apps/cli/unit
|
||||||
|
|
||||||
|
# Run bitcoind for E2E testing
|
||||||
|
- run:
|
||||||
|
name: Run bitcoind
|
||||||
|
command: |
|
||||||
|
mkdir -p /home/circleci/snap/bitcoin-core/common/.bitcoin/
|
||||||
|
cp test/pisa/e2e/bitcoin.conf /home/circleci/snap/bitcoin-core/common/.bitcoin/
|
||||||
|
/snap/bin/bitcoin-core.daemon
|
||||||
|
|
||||||
# Setup pisa for E2E testing
|
# Setup pisa for E2E testing
|
||||||
- run:
|
- run:
|
||||||
name: Setup pisa
|
name: Setup pisa
|
||||||
|
|||||||
@@ -145,3 +145,14 @@ or
|
|||||||
## the Eye of Satoshi's API
|
## the Eye of Satoshi's API
|
||||||
|
|
||||||
If you wish to read about the underlying API, and how to write your own tool to interact with it, refer to [tEOS-API.md](tEOS-API.md).
|
If you wish to read about the underlying API, and how to write your own tool to interact with it, refer to [tEOS-API.md](tEOS-API.md).
|
||||||
|
|
||||||
|
## Are you reckless? Try me on mainnet
|
||||||
|
Would you like to try me on `mainnet` instead of `testnet`? Add `-s https://mainnet.teos.pisa.watch` to your calls, for example:
|
||||||
|
|
||||||
|
```
|
||||||
|
python wt_cli.py -s https://teosmainnet.pisa.watch add_appointment -f dummy_appointment_data.json
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also change the config file to avoid specifying the server every time:
|
||||||
|
|
||||||
|
`DEFAULT_PISA_API_SERVER = "https://teosmainnet.pisa.watch"`
|
||||||
@@ -1 +1,3 @@
|
|||||||
responses
|
responses
|
||||||
|
pytest
|
||||||
|
black
|
||||||
@@ -3,6 +3,7 @@ import pytest
|
|||||||
import logging
|
import logging
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
|
# FIXME: Import from pisa. Common should not import anything from cli nor pisa.
|
||||||
from pisa import conf_fields
|
from pisa import conf_fields
|
||||||
|
|
||||||
from common.constants import LOCATOR_LEN_BYTES
|
from common.constants import LOCATOR_LEN_BYTES
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
dnsseed=0
|
dnsseed=0
|
||||||
|
|
||||||
# [debug]
|
# [debug]
|
||||||
|
daemon=1
|
||||||
regtest=1
|
regtest=1
|
||||||
debug=1
|
debug=1
|
||||||
logips=1
|
logips=1
|
||||||
|
|||||||
1
test/pisa/e2e/bitcoind_snap.sh
Normal file
1
test/pisa/e2e/bitcoind_snap.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
bitcoin-core --channel=0.19/stable
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
BTC_RPC_USER = "user"
|
BTC_RPC_USER = "user"
|
||||||
BTC_RPC_PASSWD = "passwd"
|
BTC_RPC_PASSWD = "passwd"
|
||||||
BTC_RPC_HOST = "localhost"
|
BTC_RPC_HOST = "localhost"
|
||||||
BTC_RPC_PORT = 18445
|
BTC_RPC_PORT = 18443
|
||||||
BTC_NETWORK = "regtest"
|
BTC_NETWORK = "regtest"
|
||||||
|
|
||||||
# ZMQ
|
# ZMQ
|
||||||
FEED_PROTOCOL = "tcp"
|
FEED_PROTOCOL = "tcp"
|
||||||
FEED_ADDR = "127.0.0.1"
|
FEED_ADDR = "127.0.0.1"
|
||||||
FEED_PORT = 28335
|
FEED_PORT = 28332
|
||||||
|
|
||||||
# PISA
|
# PISA
|
||||||
DATA_FOLDER = "~/.pisa_btc/"
|
DATA_FOLDER = "~/.pisa_btc/"
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# Copy this file with your own configuration and save it as conf.py
|
|
||||||
|
|
||||||
# Docker
|
|
||||||
DOCK_NETWORK_NAME = "pisa_net"
|
|
||||||
DOCK_NETWORK_SUBNET = "172.16.0.0/16"
|
|
||||||
DOCK_NETWORK_GW = "172.16.0.1"
|
|
||||||
DOCK_CONTAINER_NAME_PREFIX = "btc_n"
|
|
||||||
DOCK_IMAGE_NAME = "sandbox_btc"
|
|
||||||
DOCKER_INI_PORT_MAPPING = 22000
|
|
||||||
DOCKER_RPC_PORT_MAPPING = 18444
|
|
||||||
DOCKER_ZMQ_BLOCK_PORT_MAPPING = 28334
|
|
||||||
|
|
||||||
# Log
|
|
||||||
LOG_FILE = "bitcoin_sandbox.log"
|
|
||||||
|
|
||||||
# Graphs
|
|
||||||
BITCOIN_GRAPH_FILE = "./graphs/basic3.graphml"
|
|
||||||
LN_GRAPH_FILE = "./graphs/basic3_ln.graphml"
|
|
||||||
DEFAULT_LN_GRAPH_WEIGHT = 10000
|
|
||||||
Reference in New Issue
Block a user