forked from LNSwap/lnstxbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
165 lines (165 loc) · 8.23 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
tasks:
# runs during prebuild
- init: |
echo 'init script'
echo 'deb http://mirror.arizona.edu/ubuntu/ focal main' | sudo tee -a /etc/apt/sources.list
sudo apt update && sudo apt install rsync lcov --assume-yes
nvm install 14
mkdir ~/.lnstx-aggregator
cp boltz.conf ~/.lnstx-aggregator/boltz.conf
echo "bronze large spike canoe youth crucial seminar awkward allow frozen client math" > ~/.lnstx-aggregator/seed.dat
echo "http://localhost:9008" > /home/gitpod/.lnstx-aggregator/accesslist.txt
npm i
npm run docker:regtest
sleep 150
# wait until contracts are deployed
# sed -i 's/sslEnabled: true/sslEnabled: false/g' lib/Config.ts
# git stash
# modify regtest container? to have prune=5000 and use mempool api
# lnd --lnddir=/root/.lnd-btc --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1:18443
# lnd --lnddir=/root/.lnd-btc2 --listen=127.0.0.1:9736 --rpclisten=0.0.0.0:10011 --restlisten=0.0.0.0:8081 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1:18443
command: |
npm run dev
# rm package-lock.json
# npm i
- init: |
docker ps
# sleep 60
command: >
alias lnclibtc2='docker exec -it regtest lncli --rpcserver=127.0.0.1:10011 --tlscertpath=/root/.lnd-btc2/tls.cert --macaroonpath=/root/.lnd-btc2/data/chain/bitcoin/regtest/admin.macaroon'
alias lnclibtc1='docker exec -it regtest lncli --rpcserver=127.0.0.1:10009 --tlscertpath=/root/.lnd-btc/tls.cert --macaroonpath=/root/.lnd-btc/data/chain/bitcoin/regtest/admin.macaroon'
alias btccli='docker exec -it regtest sh -c "/usr/bin/bitcon-cli"'
echo 'lnclibtc2 newaddress p2wkh'
echo "bitcoin-cli send '{\"bcrt1q93rsj05zw3pvf8pa4gpjaypy5x5mqws49as43t\":10}'"
echo 'bitcoin-cli -regtest -generate 1'
echo 'bitcoin-cli gettxout a15863a0b1bbce4d35bbf6d4933564d52720b7c364665cc627c82679bfe29455 0 '
echo 'watch -n10 -x bitcoin-cli -regtest -generate 1'
# docker exec -it regtest bash
# echo "alias lnclibtc2='lncli --rpcserver=127.0.0.1:10011 --tlscertpath=/root/.lnd-btc/tls.cert --macaroonpath=/root/.lnd-btc/data/chain/bitcoin/regtest/admin.macaroon'"
# docker stop regtest && docker rm regtest && npm run docker:regtest
- init: |
npm i -g shx rimraf postgresql-client @stacks/cli
sleep 60
npm run stacks:mocknet:old
sleep 60
# npm run stacks:mocknet
command: |
echo 'clarinet integrate started!'
- init: |
echo 'wait until clarinet integrate full starts up'
sleep 270
command: |
npm run stacks:fund
SIGNER=ST27SD3H5TTZXPBFXHN1ZNMFJ3HNE2070QX7ZN4FF NONCE=1 npm run stacks:fund:signer
sleep 1
SIGNER=ST1N28QCRR03EW37S470PND4SPECCXQ22ZZHF97GP NONCE=2 npm run stacks:fund:signer
sleep 1
SIGNER=ST3RXC1Q8MXYKPWRNQ6ZFAWSRY8PKRK8H4BW2F8F NONCE=3 npm run stacks:fund:signer
sleep 1
SIGNER=STJ4J7FPHJRJ4Y91650TG58K136JH64VFK6V6DD3 NONCE=4 npm run stacks:fund:signer
sleep 1
SIGNER=STN1P6FRK2E2DJPDZN90AVWCSW7MHZWG3V5HS0XC NONCE=5 npm run stacks:fund:signer
sleep 15
sed -i 's/.stxswap/.stxswap_v10/g' contracts/triggerswap*.clar
sed -i 's/.sip10swap/.sip10swap_v3/g' contracts/triggerswap*.clar
sed -i 's/SP000000000000000000002Q6VF78/ST000000000000000000002AMW42H/g' contracts/triggerswap*.clar
npm run stacks:deploy
git stash
# seed set manually and funded ST1N28QCRR03EW37S470PND4SPECCXQ22ZZHF97GP as the operator account
- init: |
git clone https://github.com/pseudozach/lnstxbridge-frontend.git /workspace/lnstxbridge-frontend
export REACT_APP_BOLTZ_API=https://9007-${GITPOD_WORKSPACE_URL:8}
export REACT_APP_STACKS_API=https://3999-${GITPOD_WORKSPACE_URL:8}
export REACT_APP_STACKS_NETWORK_TYPE=mocknet
gp env REACT_APP_BOLTZ_API=$REACT_APP_BOLTZ_API
cd /workspace/lnstxbridge-frontend
sed -i 's/HTTPS=true/HTTPS=false/g' .env
sed -i 's/PORT=443/PORT=8888/g' .env
sed -i 's/REACT_APP_STACKS_NETWORK_TYPE=mainnet/REACT_APP_STACKS_NETWORK_TYPE=mocknet/g' .env
sed -i 's#REACT_APP_BOLTZ_API=https://api.lnswap.org:9002#REACT_APP_BOLTZ_API=${REACT_APP_BOLTZ_API}#g' .env
npm i
# sed -i 's/REACT_APP_STACKS_NETWORK_TYPE=mainnet/REACT_APP_STACKS_NETWORK_TYPE=mocknet/g' .env
# sed -i "s#new StacksMocknet()#new StacksMocknet({url: '$REACT_APP_STACKS_API'})#g" /workspace/lnstxbridge-frontend/src/views/swap/steps/sendTransaction.js
# sed -i "s#new StacksMocknet()#new StacksMocknet({url: '$REACT_APP_STACKS_API'})#g" /workspace/lnstxbridge-frontend/src/views/reverse/steps/lockingFunds.js
# git stash
# git update-index --assume-unchanged .env
command: npm run start
- init: |
brew install clarinet
# clarinet build from source instructions
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# git clone https://github.com/hirosystems/clarinet.git --recursive /workspace/clarinet
# cd /workspace/clarinet
# cargo install --path . --locked
command: |
sed -i 's/.stxswap_v10/.stxswap/g' contracts/triggerswap_v*.clar
clarinet test
- init: |
echo 'npm run compile:watch'
command: |
xxd -p -c2000 docker/regtest/data/lnd/macaroons/admin.macaroon
echo 'npm run compile:watch'
# gitpod might have issue with archive.ubuntu.com
# echo 'deb http://mirror.arizona.edu/ubuntu/ focal main' | sudo tee -a /etc/apt/sources.list
# sudo apt update && sudo apt install rsync --assume-yes && npm i
- init: |
git clone https://github.com/pseudozach/lnswap-widget /workspace/lnswap-widget
cd /workspace/lnswap-widget
npm i
export GITPOD_CORE_URL=${GITPOD_WORKSPACE_URL:8}
sed -i 's#apiUrl: "https://api.lnswap#// apiUrl: "https://api.lnswap#g' /workspace/lnswap-widget/src/config.js
sed -i 's#// apiUrl: "http://localhost#apiUrl: "http://localhost#g' /workspace/lnswap-widget/src/config.js
sed -i 's#/createswap#/zcreateswap#g' /workspace/lnswap-widget/src/components/Widget/Widget.js
command: npm run start
- init: |
git clone https://github.com/pseudozach/lnstxbridge-dashboard /workspace/lnstxbridge-dashboard
cd /workspace/lnstxbridge-dashboard
npm i
export NEXT_PUBLIC_BACKEND_URL="http://localhost:9008"
command: |
npm run dev
- init: |
git clone https://github.com/pseudozach/umbrel /workspace/umbrel
cd /workspace/umbrel
command: |
echo "umbrel fork is cloned"
- init: |
git clone https://github.com/pseudozach/lnstxbridge-client /workspace/lnstxbridge-client
cd /workspace/lnstxbridge-client
sleep 150
nvm use 14
npm i
sed -i 's/sslEnabled: true/sslEnabled: false/g' lib/Config.ts
mkdir ~/.lnstx-client
cp boltz.conf ~/.lnstx-client/boltz.conf
echo "diamond harbor game bird when board caution improve sight scorpion inform income" > ~/.lnstx-client/seed.dat
mkdir ~/.lnstx-client/lnd
docker cp regtest:/root/.lnd-btc2/tls.cert ~/.lnstx-client/lnd/tls.cert
docker cp regtest:/root/.lnd-btc2/data/chain/bitcoin/regtest/admin.macaroon ~/.lnstx-client/lnd/admin.macaroon
nvm use 14
npm run docker:regtest:fund
# no need - manually set ~/.lnstx-client/boltz.conf providerUrl=https://9003-pseudozach-lnstxbridge-e1iw24tfkhf.ws-us32.gitpod.io
# sed -i 's#http://localhost:9003#https://9003-`${GITPOD_WORKSPACE_URL:8}`#g' ~/.lnstx-client/boltz.conf
# sed -i 's#gitpodapiurl#https://3999-'"$GITPOD_CORE_URL"'#g' /workspace/lnswap-widget/src/config.js
command: |
npm run dev
# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
ports:
- port: 3000
onOpen: ignore
- port: 3999
onOpen: open-browser
visibility: public
- port: 9007
onOpen: ignore
visibility: public
- port: 8888
onOpen: open-browser
visibility: public
- port: 8080
onOpen: ignore
visibility: public
- port: 8000
onOpen: ignore
visibility: public