forked from GaloyMoney/blink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
87 lines (73 loc) · 2.81 KB
/
.envrc
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
export DOCKER_HOST_IP=${DOCKER_HOST_IP:-127.0.0.1}
export NETWORK=regtest
export NODE_ENV=development
export LND1_TLS=$(base64 dev/lnd/tls.cert | tr -d '\n\r')
export LND2_TLS=$(base64 dev/lnd/tls.cert | tr -d '\n\r')
export LNDONCHAIN_TLS=$(base64 dev/lnd/tls.cert | tr -d '\n\r')
export TLSOUTSIDE1=$(base64 dev/lnd/tls.cert | tr -d '\n\r')
export TLSOUTSIDE2=$(base64 dev/lnd/tls.cert | tr -d '\n\r')
fetch_macaroon() {
local container_id=$(docker ps -q -f status=running -f name="${PWD##*/}-$1-")
if [ ! -z "${container_id}" ]; then
# On Arch Linux `docker compose up` appears to complete before the lnd containers have initialized the macaroons.
# Here we retry for 10 seconds until we can copy the macroon successfully
for i in 1 2 3 4 5 6 7 8 9 10; do
docker cp $container_id:/root/.lnd/data/chain/bitcoin/$NETWORK/admin.macaroon dev/lnd/$1.macaroon 2> /dev/null
if [ "$?" = "0" ]; then
base64 dev/lnd/$1.macaroon | tr -d '\n\r'
break
fi
sleep 1
done
fi
}
export LND1_MACAROON=$(fetch_macaroon lnd1)
export LND2_MACAROON=$(fetch_macaroon lnd2)
export LNDONCHAIN_MACAROON=$(fetch_macaroon lndonchain)
export MACAROONOUTSIDE1=$(fetch_macaroon lnd-outside-1)
export MACAROONOUTSIDE2=$(fetch_macaroon lnd-outside-2)
fetch_pubkey() {
local container_id=$(docker ps -q -f status=running -f name="${PWD##*/}-$1-")
if [ ! -z "${container_id}" ]; then
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
docker exec ${container_id} lncli -n $NETWORK getinfo > /dev/null 2>&1
if [ "$?" = "0" ]; then
docker exec ${container_id} lncli -n $NETWORK getinfo 2> /dev/null | jq -r .identity_pubkey
break
fi
sleep 1
done
fi
}
export LND1_PUBKEY=$(fetch_pubkey lnd1)
export LND2_PUBKEY=$(fetch_pubkey lnd2)
export LNDONCHAIN_PUBKEY=$(fetch_pubkey lndonchain)
export BITCOINDPORT=18443
export BITCOINDADDR=${DOCKER_HOST_IP}
export BITCOINDRPCPASS=rpcpassword
export LND1_DNS=${DOCKER_HOST_IP}
export LND2_DNS=${DOCKER_HOST_IP}
export LNDONCHAIN_DNS=${DOCKER_HOST_IP}
export LNDOUTSIDE1ADDR=${DOCKER_HOST_IP}
export LNDOUTSIDE2ADDR=${DOCKER_HOST_IP}
export LND1_RPCPORT=10009
export LND2_RPCPORT=10010
export LNDONCHAIN_RPCPORT=10011
export LNDOUTSIDE1RPCPORT=10012
export LNDOUTSIDE2RPCPORT=10013
export MONGODB_ADDRESS=${DOCKER_HOST_IP}:27017
export MONGODB_PASSWORD=password
export REDIS_0_INTERNAL_IP=${DOCKER_HOST_IP}
export REDIS_0_PORT=6379
export REDIS_0_DNS=${DOCKER_HOST_IP}
export REDIS_0_SENTINEL_PORT=26379
export PRICE_ADDRESS=${DOCKER_HOST_IP}
export PRICE_PORT=50051
export LOCAL=docker-compose
export JWT_SECRET="jwt_secret"
export GEETEST_ID="geetest_id"
export GEETEST_KEY="geetest_key"
export TWILIO_ACCOUNT_SID="AC_twilio_id"
export TWILIO_API_KEY="twilio_secret"
export TWILIO_API_SECRET="twilio_api"
export TWILIO_PHONE_NUMBER="twilio_phone"