forked from MardukExchange/lnsovbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
117 lines (112 loc) · 6.96 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
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
tasks:
- init: |
mkdir $HOME/Downloads
wget https://github.com/rsksmart/rskj/releases/download/IRIS-3.0.1/rskj-core-3.0.1-IRIS-all.jar -P $HOME/Downloads
mkdir ~/.boltz
cp boltz.gitpod.conf ~/.boltz/boltz.conf
echo "agree color smart member eagle air march always tornado curious endless wise" > ~/.boltz/seed.dat
command: yarn rsk:geth
# - init: |
# cd ~
# git clone https://github.com/rsksmart/artifacts.git
# cd /home/gitpod/artifacts/Dockerfiles/RSK-Node
# docker build -t rskregtest -f Dockerfile.RegTest .
# docker run -d --name regtest-node-01 -p 4444:4444 -p 30305:30305 rskregtest
# command: |
# echo 'docker rsk should be running - tried this to get around 4444 reachability issue'
- init: |
sudo apt install rsync --assume-yes
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update --assume-yes
sudo apt-get install ethereum --assume-yes
command: |
echo 'loadScript("/workspace/lnsovbridge/gethstartup.js")'
geth attach http://127.0.0.1:4444/
# echo 'web3.eth.defaultAccount = eth.accounts[0]'
# echo 'loadScript("/workspace/lnsovbridge/etherswap.js")'
# echo 'loadScript("/workspace/lnsovbridge/erc20swap.js")'
# echo 'loadScript("/workspace/lnsovbridge/erc20token.js")'
# echo 'loadScript("/workspace/lnsovbridge/erc20token.js")'
# fund metamask with regtest rsk - rpc url: https://4444-scarlet-kite-mva383vt.ws-us18.gitpod.io, chainid: 33
# eth.sendTransaction({from:eth.accounts[1], to:'0x946b238f8Ead0170686b32b23070fF4BFB006D3B', value: web3.toWei(10, "ether"), gas:21000}); //fund your wallet
# eth.sendTransaction({from:eth.accounts[1], to:'0xeCb6b2a431826634E36d2787016670EBd8AF5A9B', value: web3.toWei(10, "ether"), gas:21000}); //fund boltz signer
# web3.eth.defaultAccount = eth.accounts[1]
# erc20token.transfer('0x946b238f8Ead0170686b32b23070fF4BFB006D3B', web3.toWei(1000, "ether")); // erc20 tokens to metamask wallet
# erc20token.transfer('0xeCb6b2a431826634E36d2787016670EBd8AF5A9B', web3.toWei(1000, "ether")); // erc20 tokens to boltz signer
# add erc20 token address to metamask 0x271905cc3d21d8d11f3213e4130108295e578434 + another time for XUSD 0x738e6fcdd7c1212469da9531a0c7a12aa6e6ccc1 or 0x59014d3017a5ad194d6b8a82a34b5b43beca72f7
# geth attach http://127.0.0.1:4444/ --jspath "/workspace/lnsovbridge" --exec 'loadScript("etherswap.js"); loadScript("erc20swap.js"); loadScript("erc20token.js"); loadScript("erc20token.js");'
# sleep 5
# web3.eth.defaultAccount = eth.accounts[0]
# loadScript("/workspace/lnsovbridge/erc20swap.js")
# loadScript("/workspace/lnsovbridge/etherswap.js")
# loadScript("/workspace/lnsovbridge/erc20token.js")
- init: |
yarn docker:regtest
command: >
alias lnclibtc2='docker exec -it regtest lncli --rpcserver=127.0.0.1:10011 --tlscertpath=/root/.lnd-btc/tls.cert --macaroonpath=/root/.lnd-btc/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-btc2/data/chain/bitcoin/regtest/admin.macaroon'
alias bitcoin-cli='docker exec -it regtest bitcoin-cli'
echo "bitcoin-cli send '{\"bcrt1q93rsj05zw3pvf8pa4gpjaypy5x5mqws49as43t\":10}'"
echo 'bitcoin-cli -regtest -generate 4'
echo 'watch -n10 -x bitcoin-cli -regtest -generate 1'
echo 'lnclibtc2 command is ready'
- init: |
echo 'modifying regtest container to work with blixt'
command: |
alias lnclibtc2='docker exec -it regtest lncli --rpcserver=127.0.0.1:10011 --tlscertpath=/root/.lnd-btc/tls.cert --macaroonpath=/root/.lnd-btc/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-btc2/data/chain/bitcoin/regtest/admin.macaroon'
alias bitcoin-cli='docker exec -it regtest bitcoin-cli'
bitcoin-cli stop
sleep 3
docker exec -it regtest bash -c "echo -e 'rpcuser=topkek\nrpcpassword=topkek' >> /root/.bitcoin/bitcoin.conf"
docker exec -it regtest bitcoind
docker exec -it regtest bash -c "echo -e '[Bitcoind]\nbitcoind.rpcuser=topkek\nbitcoind.rpcpass=topkek\nbitcoind.zmqpubrawblock=tcp://127.0.0.1:29001\nbitcoind.zmqpubrawtx=tcp://127.0.0.1:29000' >> /root/.lnd-btc/lnd.conf"
docker exec -it regtest bash -c "echo -e '[Bitcoind]\nbitcoind.rpcuser=topkek\nbitcoind.rpcpass=topkek\nbitcoind.zmqpubrawblock=tcp://127.0.0.1:29001\nbitcoind.zmqpubrawtx=tcp://127.0.0.1:29000' >> /root/.lnd-btc2/lnd.conf"
lnclibtc1 stop
lnclibtc2 stop
sleep 3
bitcoin-cli -regtest createwallet "test1"
echo 'topkek:topkek' > docker/regtest/data/core/cookies/.bitcoin-cookie
watch -n10 -x docker exec -it regtest bitcoin-cli -regtest -generate 1
# restart lnds in separate windows
# docker exec -it regtest bash -c "nohup 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 &"
# docker exec -it regtest bash -c "nohup 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 &"
# open channel from blixt to 02eab8a8f2f22e3423b9533bf95766625def0cc92ad96bf06e1fa3a8fd18cecf5f@192.168.0.143:9736
- init: |
npm install
command: |
echo curl 'http://localhost:4444/' -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
echo regtest rsk - rpc url: https://4444-${GITPOD_WORKSPACE_URL:8}, chainid: 33
echo or use companion app https://www.gitpod.io/blog/local-app#installation
echo npm run dev
#npm run dev
- init: |
git clone https://github.com/pseudozach/boltz-frontend.git /workspace/boltz-frontend
export REACT_APP_BOLTZ_API=https://9001-${GITPOD_WORKSPACE_URL:8}
gp env REACT_APP_BOLTZ_API=$REACT_APP_BOLTZ_API
cd /workspace/boltz-frontend && npm i
command: |
echo npm run start
# btc-rbtc swapper
- init: |
git clone https://github.com/grmkris/btc-rbtc-swapper /workspace/btc-rbtc-swapper
cd /workspace/btc-rbtc-swapper
command: |
echo hello-world
# npm run start
# update frontend .env with current gitpod name e.g. REACT_APP_BOLTZ_API=https://9001-fuchsia-termite-wsc9g47t.ws-us18.gitpod.io/
# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
ports:
- port: 9001
visibility: public
onOpen: ignore
- port: 3000
visibility: public
onOpen: open-browser
- port: 4444
visibility: public
onOpen: ignore
- port: 9736
visibility: public
onOpen: ignore