Skip to content

Commit 7612078

Browse files
committed
regtest: adding aperture docker instance
1 parent 612c704 commit 7612078

File tree

2 files changed

+107
-4
lines changed

2 files changed

+107
-4
lines changed

regtest/docker-compose.yml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
- bitcoind:/home/bitcoin/.bitcoin
3131

3232
lndserver:
33-
image: lightninglabs/lnd:v0.17.0-beta
33+
image: lightninglabs/lnd:v0.18.5-beta
3434
container_name: lndserver
3535
restart: unless-stopped
3636
networks:
@@ -68,6 +68,7 @@ services:
6868
- loopserver
6969
volumes:
7070
- "lndserver:/root/.lnd"
71+
- "loopserver:/root/loopserver"
7172
depends_on:
7273
- lndserver
7374
command:
@@ -82,6 +83,30 @@ services:
8283
- "--bitcoin.zmqpubrawblock=tcp://bitcoind:28332"
8384
- "--bitcoin.zmqpubrawtx=tcp://bitcoind:28333"
8485

86+
aperture:
87+
build:
88+
context: https://github.com/lightninglabs/aperture.git # GitHub repository URL
89+
dockerfile: Dockerfile # Optional: If the Dockerfile isn't named 'Dockerfile'
90+
container_name: aperture
91+
restart: unless-stopped
92+
depends_on:
93+
- loopserver
94+
- etcd
95+
networks:
96+
regtest:
97+
aliases:
98+
- aperture
99+
volumes:
100+
- "lndserver:/root/.lnd" # Ensure this volume is correctly mapped
101+
- "loopserver:/root/loopserver" # Ensure this volume is correctly mapped
102+
- "aperture:/root/.aperture" # Ensure this volume is correctly mapped
103+
ports:
104+
- "11018:11018" # Expose the port for the aperture service
105+
entrypoint: [ "/bin/aperture" ] # Ensure executable is found here
106+
command:
107+
- "--configfile=/root/.aperture/aperture.yaml"
108+
109+
85110
lndclient:
86111
image: lightninglabs/lnd:v0.17.0-beta
87112
container_name: lndclient
@@ -124,22 +149,45 @@ services:
124149
- loopclient
125150
volumes:
126151
- "lndclient:/root/.lnd"
152+
- "aperture:/root/.aperture"
153+
- "loopclient:/root/.loop"
127154
depends_on:
128-
- lndclient
155+
- loopserver
129156
command:
130157
- "loopd"
158+
- "--experimental"
131159
- "--network=regtest"
132160
- "--debuglevel=debug"
133-
- "--server.host=loopserver:11009"
134-
- "--server.notls"
161+
- "--server.host=aperture:11018"
162+
#- "--server.notls"
163+
- "--server.tlspath=/root/.loop/aperture-tls.cert"
135164
- "--lnd.host=lndclient:10009"
136165
- "--lnd.macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
137166
- "--lnd.tlspath=/root/.lnd/tls.cert"
138167

168+
etcd:
169+
image: bitnami/etcd:3.3.12
170+
platform: linux/amd64
171+
container_name: etcd
172+
hostname: etcd
173+
networks:
174+
regtest:
175+
aliases:
176+
- etcd
177+
restart: unless-stopped
178+
ports:
179+
- "2379:2379"
180+
- "2380:2380"
181+
environment:
182+
- ALLOW_NONE_AUTHENTICATION=yes
183+
139184
networks:
140185
regtest:
141186

142187
volumes:
143188
bitcoind:
144189
lndserver:
145190
lndclient:
191+
loopserver:
192+
loopclient:
193+
aperture:

regtest/regtest.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ function setup() {
7777

7878
lndclient openchannel --node_key $LNDSERVER --local_amt 16000000
7979
mine 6
80+
81+
82+
docker cp aperture:/root/.aperture/tls.cert /tmp/aperture-tls.cert
83+
chmod 644 /tmp/aperture-tls.cert
84+
docker cp -a /tmp/aperture-tls.cert loopclient:/root/.loop/aperture-tls.cert
85+
86+
8087
}
8188

8289
function stop() {
@@ -137,8 +144,56 @@ function copy_loopserver_files() {
137144
chmod 644 /tmp/loopserver-walletkit.macaroon
138145
docker cp -a /tmp/loopserver-walletkit.macaroon loopserver:/home/loopserver/walletkit.macaroon
139146

147+
docker cp loopserver:/home/loopserver/tls.cert /tmp/naut-tls.cert
148+
chmod 644 /tmp/naut-tls.cert
149+
docker cp -a /tmp/naut-tls.cert aperture:/root/.aperture/naut-tls.cert
150+
151+
write_aperture_config
152+
docker cp /tmp/aperture.yaml aperture:/root/.aperture/aperture.yaml
140153
}
141154

155+
156+
function write_aperture_config() {
157+
rm -rf /tmp/aperture.yaml
158+
touch /tmp/aperture.yaml && cat > /tmp/aperture.yaml <<EOF
159+
listenaddr: '0.0.0.0:11018'
160+
staticroot: '/root/.aperture/static'
161+
servestatic: true
162+
debuglevel: trace
163+
insecure: false
164+
writetimeout: 0
165+
166+
servername: aperture
167+
autocert: false
168+
169+
authenticator:
170+
lndhost: lndserver:10009
171+
tlspath: /root/.lnd/tls.cert
172+
macdir: /root/.lnd/data/chain/bitcoin/regtest
173+
network: regtest
174+
175+
etcd:
176+
host: 'etcd:2379'
177+
user:
178+
password:
179+
180+
services:
181+
- name: loop
182+
hostregexp: '^.*$'
183+
pathregexp: '^/looprpc.*$'
184+
address: 'loopserver:11009'
185+
protocol: https
186+
tlscertpath: /root/.aperture/naut-tls.cert
187+
price: 1000
188+
authwhitelistpaths:
189+
- '^/looprpc.SwapServer/LoopOutTerms.*$'
190+
- '^/looprpc.SwapServer/LoopOutQuote.*$'
191+
- '^/looprpc.SwapServer/LoopInTerms.*$'
192+
- '^/looprpc.SwapServer/LoopInQuote.*$'
193+
EOF
194+
}
195+
196+
142197
if [[ $# -lt 1 ]]; then
143198
echo "Usage: $0 start|stop|restart|info|loop"
144199
fi

0 commit comments

Comments
 (0)