squeaknode/itests/run_itest.sh
Jonathan Zernik 2f8d718518
Add received payments worker (#450)
* Got subscribe invoices worker working

* Improve error message in lnd invoice worker

* Only mark received payments if paid if the invoice is settled

* Check if invoice is settled before marking received payment as paid

* Pass settle index as param to mark paid db method

* Add migration to include settle_index in sent payments table

* Got latest settle index query working, I think

* Only return received payments that are already paid in db query

* Remove unused column from get latest settle index query

* Update static build
2020-11-11 22:02:26 -05:00

46 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
trap "exit" INT TERM
trap "kill 0" EXIT
function mine_blocks {
while true; do
printf "Mining 1 block to address: $MINING_ADDRESS ..."
docker-compose run btcctl generate 1
sleep 1
done
}
cd itests
docker-compose down --volumes --remove-orphans
COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build
docker-compose up -d
# Initialize the blockchain with miner rewards going to the test client.
client_address=""
while [ "$client_address" = "" ]
do
new_address_output=$(docker exec -it test_lnd_client lncli --network=simnet newaddress np2wkh)
echo "new_address_output:"
echo $new_address_output
client_address=$(echo $new_address_output | jq .address -r)
sleep 2
done
MINING_ADDRESS=$client_address docker-compose up -d btcd
echo "Mining 400 blocks to address: $client_address ..."
docker-compose run btcctl generate 400
echo "Finished mining blocks."
sleep 30
echo "Continue mining blocks, 1 every 10 seconds."
mine_blocks &
echo "Background mining task is in background..."
echo "Running test.sh...."
docker-compose run test ./test.sh
echo "Shutting down itest..."
# docker-compose down