Skip to content

Commit

Permalink
use AMP payments
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Sep 16, 2022
1 parent eb58ea3 commit 2b191ab
Show file tree
Hide file tree
Showing 18 changed files with 393 additions and 128 deletions.
56 changes: 32 additions & 24 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
name: Integration Test
on:
name: Integration Tests
on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-18.04
integration-test:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
test-name: ['boostPayment', 'botCreation', 'chatPayment', 'cleanup', 'clearAllChats', 'clearAllContacts', 'contacts', 'images', 'latestTest', 'lsats', 'paidMeet', 'paidTribeImages', 'queryRoutes', 'self', 'sphinxPeople', 'streamPayment', 'tribe', 'tribe3Escrow', 'tribe3Messages', 'tribe3Private', 'tribe3Profile', 'tribeEdit', 'tribeImages', 'messageLength', 'transportToken', 'pinnedMsg', 'hmac', 'socketIO', 'tribeMember']
test-name: [
'boostPayment', 'botCreation', 'chatPayment', 'cleanup', 'clearAllChats',
'clearAllContacts', 'contacts', 'images', 'latestTest', 'lsats', 'paidMeet',
'paidTribeImages', 'queryRoutes', 'self', 'sphinxPeople', 'streamPayment',
'tribe', 'tribe3Escrow', 'tribe3Messages', 'tribe3Private', 'tribe3Profile',
'tribeEdit', 'tribeImages', 'messageLength', 'transportToken', 'pinnedMsg',
'hmac', 'socketIO', 'tribeMember', 'ampMessage'
]
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
Expand All @@ -25,35 +32,36 @@ jobs:
- name: Build Relay
working-directory: ./relay
run: |
npm install && npm run build && docker build -t sphinxlightning/sphinx-relay .
npm install && npm run build && docker build -t sphinxlightning/sphinx-relay .
- name: Checkout stack
run: |
git clone https://github.com/stakwork/sphinx-stack.git stack
- name: give permissions
git clone -b amp https://github.com/antonilol/sphinx-stack.git stack
- name: give permissions
working-directory: ./stack
run: |
chmod 777 ./bitcoind;
chmod 777 -R ./relay;
chmod 777 -R ./lnd;
chmod 777 -R ./proxy;
- name: Turn on Stack
chmod 777 ./bitcoind
chmod 777 -R ./relay
chmod 777 -R ./lnd
chmod 777 -R ./proxy
- name: Turn on Stack
working-directory: ./stack
run: |
GITACTION_ENV=gitactionenv docker-compose -f alts/proxy.yml --project-dir . up -d
GITACTION_ENV=gitactionenv docker-compose -f alts/proxy.yml --project-dir . up -d
- name: Check for NODES.json
working-directory: ./stack
run: |
sleep 240;
sleep 4m
docker-compose ps
docker logs meme.sphinx
docker logs dave.sphinx
docker wait stack_relaysetup_1;
- name: copy file
uses: canastro/copy-file-action@master
with:
source: "stack/relay/NODES.json"
target: "relay/src/tests/configs/nodes.json"
docker logs -f stack_relaysetup_1
docker logs -f stack_lndsetup_1
- name: copy nodes.json
run: |
mkdir relay/src/tests/configs
cp stack/relay/NODES.json relay/src/tests/configs/nodes.json
- name: Run tests
working-directory: ./relay
run: |
npx ava src/tests/controllers/${{matrix.test-name}}.test.ts --verbose --serial --timeout=2m
# run: npx ava src/tests/controllers/${{matrix.test-name}}.test.ts --verbose --serial --timeout=2m
# a script that runs the same test but allows retries when failed + a lot of logs
run: .github/workflows/test.sh ${{matrix.test-name}}
39 changes: 39 additions & 0 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

delay=10
retries=3

i=0

while true; do
if (npx ava src/tests/controllers/"$1".test.ts --verbose --serial --timeout=2m); then
break
else
((i++))
if [ $i -gt $retries ]; then
echo DEBUG LOGS

echo -e "\n\n== alice chans ==\n\n"
docker exec alice-lnd.sphinx lncli -n regtest listchannels

echo -e "\n\n=== bob chans ===\n\n"
docker exec bob-lnd.sphinx lncli -n regtest --rpcserver=localhost:10010 listchannels

echo -e "\n\n== carol chans ==\n\n"
docker exec carol-lnd.sphinx lncli -n regtest --rpcserver=localhost:10011 listchannels

echo -e "\n\n===== alice =====\n\n"
docker logs alice.sphinx

echo -e "\n\n====== bob ======\n\n"
docker logs bob.sphinx

echo -e "\n\n===== carol =====\n\n"
docker logs carol.sphinx

exit 1
fi
echo Test failed, retrying in "$delay"s "($i/$retries)"
sleep $delay
fi
done
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ creds/*
!creds/scheduler_creds
hsm_secret

src/tests/configs/*
src/tests/configs/nodes.json
src/tests/configs/
2 changes: 1 addition & 1 deletion dist/src/grpc/interfaces.js.map

Large diffs are not rendered by default.

86 changes: 57 additions & 29 deletions dist/src/grpc/lightning.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/grpc/lightning.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/src/grpc/subscribe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2b191ab

Please sign in to comment.