forked from midnightntwrk/midnight-node-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.envrc
More file actions
55 lines (41 loc) · 2.15 KB
/
.envrc
File metadata and controls
55 lines (41 loc) · 2.15 KB
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
# If your on windows use wsl / git bash / cygwin / msys2 with direnv
export CFG_PRESET=testnet-02
source ./.envrc.${CFG_PRESET}
# This repository only accepts signed commits:
# point out to users at commit time that commits need to be signed,
# not once they've done many commits and are trying to push a PR:
git config --local commit.gpgSign true
git config --local tag.gpgSign true
# docker on mac expects linux/arm64/v8 but currently we don't publish that build
if [[ "$(uname -s)" == "Darwin" ]] && [[ "$(uname -m)" == "arm64" ]]; then
export DOCKER_DEFAULT_PLATFORM=linux/arm64
fi
export POSTGRES_HOST="postgres" # TODO: replace with IP or host to postgres connection if not connecting to the docker one.
export POSTGRES_PORT="5432"
export POSTGRES_USER="postgres"
# A random password is used for your safety. Docker (but not podman) exposes
# ports to the internet by default. This needs to be unguessable.
if [ ! -f postgres.password ]; then
uuidgen | tr -d '-' | head -c 16 > postgres.password
fi
export POSTGRES_PASSWORD="$(cat ./postgres.password)"
export POSTGRES_DB="cexplorer"
# We bring together the above variables into a database connection string:
export DB_SYNC_POSTGRES_CONNECTION_STRING="psql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
# To start with debug logs, add "-l debug" to APPEND_ARGS
# To expose safe rpc method to the host port 9944, add "--unsafe-rpc-external" to APPEND_ARGS or --validator
export APPEND_ARGS="--allow-private-ip --pool-limit 10 --trie-cache-size 0 --prometheus-external --rpc-external --rpc-cors all"
# Validator Values:
if [ ! -f node.privatekey ]; then
# generate node key like this:
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -it docker.io/parity/subkey:latest generate-node-key | sed -n '2p' > midnight-node.privatekey
# Use the second line of output for NODE_KEY (that's what sed -n '2p' does)
fi
export NODE_KEY="$(cat ./midnight-node.privatekey)"
#
# Partner chains config:
#
export CARDANO_NETWORK=preview
export CARDANO_IMAGE="ghcr.io/intersectmbo/cardano-node:10.2.1"
export CARDANO_DATA_DIR=./cardano-data
export CARDANO_CONFIG_DIR=./cardano-config/${CARDANO_NETWORK}