Adds pisa conf for e2e testing and initial setup for the regtest node

This commit is contained in:
Sergi Delgado Segura
2020-01-20 16:24:33 +01:00
parent 396c56e5db
commit 18cd2a7499
2 changed files with 38 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ def bitcoin_cli():
@pytest.fixture()
def create_txs(bitcoin_cli):
set_up_node(bitcoin_cli)
utxos = bitcoin_cli.listunspent()
if len(utxos) == 0:
@@ -54,6 +55,12 @@ def create_txs(bitcoin_cli):
return signed_commitment_tx.get("hex"), signed_penalty_tx.get("hex")
def set_up_node(bitcoin_cli):
# This method will create a new address a mine bitcoin so the node can be used for testing
new_addr = bitcoin_cli.getnewaddress()
bitcoin_cli.generatetoaddress(101, new_addr)
def build_appointment_data(bitcoin_cli, commitment_tx, penalty_tx):
commitment_tx_id = bitcoin_cli.decoderawtransaction(commitment_tx).get("txid")
current_height = bitcoin_cli.getblockcount()

View File

@@ -0,0 +1,31 @@
# bitcoind
BTC_RPC_USER = "user"
BTC_RPC_PASSWD = "passwd"
BTC_RPC_HOST = "localhost"
BTC_RPC_PORT = 18445
BTC_NETWORK = "regtest"
# CHAIN MONITOR
POLLING_DELTA = 60
BLOCK_WINDOW_SIZE = 10
# ZMQ
FEED_PROTOCOL = "tcp"
FEED_ADDR = "127.0.0.1"
FEED_PORT = 28335
# PISA
MAX_APPOINTMENTS = 100
EXPIRY_DELTA = 6
MIN_TO_SELF_DELAY = 20
SERVER_LOG_FILE = "pisa.log"
PISA_SECRET_KEY = "pisa_sk.der"
# PISA-CLI
CLIENT_LOG_FILE = "pisa.log"
# TEST
TEST_LOG_FILE = "test.log"
# LEVELDB
DB_PATH = "appointments"