This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
181 lines (180 loc) · 5.92 KB
/
docker-compose.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
version: '3.8'
services:
polkabtc:
image: 'registry.gitlab.com/interlay/btc-parachain:0-7-2-a06ada7d-1622023912'
command:
- btc-parachain
- --unsafe-rpc-external
- --unsafe-ws-external
- --rpc-methods
- Unsafe
- --dev
ports:
- '9933:9933'
- '9944:9944'
bitcoind:
image: 'ruimarinho/bitcoin-core:0.20'
command:
- -regtest
- -server
- -rpcbind=0.0.0.0
- -rpcallowip=0.0.0.0/0
- -rpcuser=rpcuser
- -rpcpassword=rpcpassword
- -fallbackfee=0.0002
ports:
- '18443:18443'
bitcoin_cli:
image: 'ruimarinho/bitcoin-core:0.20'
command:
- /bin/sh
- -c
- |
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword createwallet Alice
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword createwallet Bob
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword createwallet Dave
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword loadwallet Alice
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword loadwallet Bob
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword loadwallet Dave
ALICE_ADDRESS=$$(bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcwallet=Alice getnewaddress)
# coins need 100 confirmations to be spendable
bitcoin-cli -regtest -rpcconnect=bitcoind -rpcwait -rpcuser=rpcuser -rpcpassword=rpcpassword generatetoaddress 101 $${ALICE_ADDRESS}
electrs:
image: 'interlayhq/electrs:latest'
command:
- electrs
- -v
- --network
- regtest
- --jsonrpc-import
- --cors
- '*'
- --cookie
- 'rpcuser:rpcpassword'
- --daemon-rpc-addr
- bitcoind:18443
- --http-addr
- '[::0]:3002'
- --index-unspendables
ports:
- '3002:3002'
staked_relayer:
# only start staked relayer after mining to prevent long catch-up
image: 'registry.gitlab.com/interlay/polkabtc-clients/staked-relayer:0-7-2'
command:
- staked-relayer
- --keyring
- eve
- --btc-parachain-url
- "ws://polkabtc:9944"
- --auto-fund-with-faucet-url
- "[::0]:3035"
environment: &client-env
BITCOIN_RPC_URL: http://bitcoind:18443
BITCOIN_RPC_USER: rpcuser
BITCOIN_RPC_PASS: rpcpassword
RUST_LOG: info
restart: unless-stopped
oracle:
image: 'registry.gitlab.com/interlay/polkabtc-clients/oracle:0-7-2'
command:
- oracle
- --keyring
- bob
- --btc-parachain-url
- "ws://polkabtc:9944"
environment:
RUST_LOG: info
restart: unless-stopped
faucet:
image: 'registry.gitlab.com/interlay/polkabtc-clients/faucet:0-7-2'
command:
- faucet
- --keyring
- ferdie
- --btc-parachain-url
- "ws://polkabtc:9944"
- --user-allowance
- "1"
- --vault-allowance
- "500"
- --http-addr
- "[::0]:3035"
environment:
RUST_LOG: info
ports:
- '3035:3035'
restart: unless-stopped
vault:
image: 'registry.gitlab.com/interlay/polkabtc-clients/vault:0-7-2'
command:
- /bin/sh
- -c
- |
echo "Sleeping..."
# sleep for 10s to wait for bitcoin to create the Dave wallet
# and also to ensure that the issue period and redeem period are set
sleep 10
vault --keyring=charlie --auto-register-with-collateral 100000000000000 --btc-parachain-url 'ws://polkabtc:9944'
environment:
<<: *client-env
restart: unless-stopped
testdata_gen:
image: 'registry.gitlab.com/interlay/polkabtc-clients/testdata-gen:0-7-2'
command:
- /bin/sh
- -c
- |
echo "Sleeping..."
sleep 3
testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=alice set-issue-period --period=2000
testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=alice set-redeem-period --period=2000
# wait for the vault to register
sleep 9
# NOTE: bitcoin-cli not installed on image
ALICE_ADDRESS="bcrt1q56l7a4g3hluklqmxs89wj8dkpazemfykwfkz4x"
testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=bob set-exchange-rate --exchange-rate=385523187
testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=alice request-issue --issue-amount=10000000 --vault=dave
REDEEM_ID=$$(testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=alice request-redeem --redeem-amount=1000000 --btc-address=$${ALICE_ADDRESS} --vault=dave)
# testdata-gen --btc-parachain-url 'ws://polkabtc:9944' --keyring=alice execute-redeem --redeem-id=$${REDEEM_ID}
environment:
<<: *client-env
ports:
- '3033:3033'
postgres:
image: 'postgres:13'
environment:
POSTGRES_USER: 'user'
POSTGRES_PASSWORD: 'password'
ports:
- '5432:5432'
flyway:
image: 'flyway/flyway:7'
command: 'migrate'
environment:
FLYWAY_USER: 'user'
FLYWAY_PASSWORD: 'password'
FLYWAY_URL: 'jdbc:postgresql://postgres:5432/postgres'
volumes:
- ${PWD}/node_modules/@interlay/polkabtc-stats/sql:/flyway/sql
depends_on:
- postgres
polkabtc_stats:
image: 'registry.gitlab.com/interlay/polkabtc-stats:0-3-3'
restart: always
depends_on:
- postgres
command: bash -c 'while !</dev/tcp/postgres/5432; do sleep 1; done; yarn start'
environment:
MONITOR: '1'
LOG_PRETTY_PRINT: '1'
SYNC_DB_SCHEMA: '1'
ENDPOINT_URL: 'ws://polkabtc:9944'
BTC_NETWORK: 'http://electrs:3002'
PGHOST: 'postgres'
PGPORT: '5432'
PGDATABASE: 'postgres'
PGUSER: 'user'
PGPASSWORD: 'password'
ports:
- '3007:3007'