mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-02 05:04: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:
|
||||
- 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
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v2-dependencies-
|
||||
- v1-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "test/pisa/e2e/bitcoind_snap.sh" }}
|
||||
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
sudo snap install `cat test/pisa/e2e/bitcoind_snap.sh`
|
||||
pyenv local 3.7.0
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
@@ -40,23 +34,12 @@ jobs:
|
||||
pip install -r pisa/requirements.txt
|
||||
pip install -r pisa/requirements-dev.txt
|
||||
pip install -r apps/cli/requirements-dev.txt
|
||||
pip install -r bitcoin_sandbox/requirements.txt
|
||||
|
||||
- save_cache:
|
||||
paths:
|
||||
- ./venv
|
||||
key: v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
||||
|
||||
# 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
|
||||
|
||||
- /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" }}
|
||||
|
||||
# Run unit tests
|
||||
- run:
|
||||
@@ -83,6 +66,14 @@ jobs:
|
||||
. venv/bin/activate
|
||||
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
|
||||
- run:
|
||||
name: Setup pisa
|
||||
|
||||
@@ -145,3 +145,14 @@ or
|
||||
## 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).
|
||||
|
||||
## 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
|
||||
from copy import deepcopy
|
||||
|
||||
# FIXME: Import from pisa. Common should not import anything from cli nor pisa.
|
||||
from pisa import conf_fields
|
||||
|
||||
from common.constants import LOCATOR_LEN_BYTES
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
dnsseed=0
|
||||
|
||||
# [debug]
|
||||
daemon=1
|
||||
regtest=1
|
||||
debug=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_PASSWD = "passwd"
|
||||
BTC_RPC_HOST = "localhost"
|
||||
BTC_RPC_PORT = 18445
|
||||
BTC_RPC_PORT = 18443
|
||||
BTC_NETWORK = "regtest"
|
||||
|
||||
# ZMQ
|
||||
FEED_PROTOCOL = "tcp"
|
||||
FEED_ADDR = "127.0.0.1"
|
||||
FEED_PORT = 28335
|
||||
FEED_PORT = 28332
|
||||
|
||||
# PISA
|
||||
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