forked from zigbee-alliance/distributed-compliance-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genlocalnetappbins.sh
executable file
·32 lines (26 loc) · 1.01 KB
/
genlocalnetappbins.sh
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
set -euo pipefail
DOCKERFILE="${1:-Dockerfile-build}"
IMAGE_TAG="${2:-dcld-build}"
VERSION_DIR="${3:-genesis}"
MAINNET_STABLE_VERSION="${4:-""}"
LOCALNET_DIR=".localnet"
docker build -f ${DOCKERFILE} -t ${IMAGE_TAG} .
docker container create --name ${IMAGE_TAG}-inst ${IMAGE_TAG}
if [ -n "$MAINNET_STABLE_VERSION" ]; then
wget "https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/${MAINNET_STABLE_VERSION}/dcld"
chmod ugo+x dcld
fi
for node_name in node0 node1 node2 node3 observer0 lightclient0; do
if [[ -d "${LOCALNET_DIR}/${node_name}" ]]; then
mkdir -p ${LOCALNET_DIR}/${node_name}/cosmovisor/${VERSION_DIR}/bin/
if [ -n "$MAINNET_STABLE_VERSION" ]; then
cp dcld ${LOCALNET_DIR}/${node_name}/cosmovisor/${VERSION_DIR}/bin/
else
docker cp ${IMAGE_TAG}-inst:/go/bin/dcld ${LOCALNET_DIR}/${node_name}/cosmovisor/${VERSION_DIR}/bin/
fi
fi
done
if [ -n "$MAINNET_STABLE_VERSION" ]; then
rm dcld
fi
docker rm ${IMAGE_TAG}-inst