Skip to content

Commit

Permalink
feat(wip): wip
Browse files Browse the repository at this point in the history
  • Loading branch information
outSH committed Oct 26, 2023
1 parent a86adc9 commit 705998a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 52 deletions.
81 changes: 30 additions & 51 deletions tools/docker/indy-testnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,14 @@
# Runs indy pool for testing purpose
# Original source - https://github.com/hyperledger/indy-sdk/blob/master/ci/indy-pool.dockerfile
# Original source - https://github.com/hyperledger/indy-vdr/blob/main/ci/indy-pool.dockerfile
# Changes marked with `EDIT`

FROM ubuntu:16.04
FROM ghcr.io/hyperledger/indy-node-container/indy_node:1.12.6-ubuntu18-main
RUN pip3 install "supervisor~=4.2"

ARG uid=1000

# Install environment
RUN apt-get update -y && apt-get install -y \
git \
wget \
python3.5 \
python3-pip \
python-setuptools \
python3-nacl \
apt-transport-https \
ca-certificates \
supervisor

RUN pip3 install -U \
pip==9.0.3 \
setuptools

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 || \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CE7709D068DB5E88
ARG indy_stream=master
RUN echo "deb https://repo.sovrin.org/deb xenial $indy_stream" >> /etc/apt/sources.list

RUN useradd -ms /bin/bash -u $uid indy

ARG indy_plenum_ver=1.12.1~dev989
ARG indy_node_ver=1.12.1~dev1172
ARG python3_indy_crypto_ver=0.4.5
ARG indy_crypto_ver=0.4.5
ARG python3_pyzmq_ver=18.1.0
ARG python3_orderedset_ver=2.0
ARG python3_psutil_ver=5.4.3
ARG python3_pympler_ver=0.5

RUN apt-get update -y && apt-get install -y \
python3-pyzmq=${python3_pyzmq_ver} \
indy-plenum=${indy_plenum_ver} \
indy-node=${indy_node_ver} \
python3-indy-crypto=${python3_indy_crypto_ver} \
libindy-crypto=${indy_crypto_ver} \
python3-orderedset=${python3_orderedset_ver} \
python3-psutil=${python3_psutil_ver} \
python3-pympler=${python3_pympler_ver} \
vim
# EDIT
ARG UID=1000
RUN usermod -u $UID indy
ENV UID=$UID

RUN echo "[supervisord]\n\
logfile = /tmp/supervisord.log\n\
Expand Down Expand Up @@ -89,16 +50,34 @@ command=start_indy_node Node4 0.0.0.0 9707 0.0.0.0 9708\n\
directory=/home/indy\n\
stdout_logfile=/tmp/node4.log\n\
stderr_logfile=/tmp/node4.log\n"\
>> /etc/supervisord.conf
>> /etc/supervisord.conf

RUN mkdir -p \
/etc/indy \
/var/lib/indy/backup \
/var/lib/indy/plugins \
/var/lib/indy/sandbox \
/var/log/indy \
&& chown -R indy:root /etc/indy /var/lib/indy /var/log/indy

USER indy

RUN awk '{if (index($1, "NETWORK_NAME") != 0) {print("NETWORK_NAME = \"sandbox\"")} else print($0)}' /etc/indy/indy_config.py> /tmp/indy_config.py
RUN mv /tmp/indy_config.py /etc/indy/indy_config.py
# TODO - to files?
RUN echo "LEDGER_DIR = '/var/lib/indy'\n\
LOG_DIR = '/var/log/indy'\n\
KEYS_DIR = '/var/lib/indy'\n\
GENESIS_DIR = '/var/lib/indy'\n\
BACKUP_DIR = '/var/lib/indy/backup'\n\
PLUGINS_DIR = '/var/lib/indy/plugins'\n\
NODE_INFO_DIR = '/var/lib/indy'\n\
NETWORK_NAME = 'sandbox'\n"\
>> /etc/indy/indy_config.py

# EDIT - Use different default pool IP
ARG pool_ip=172.16.0.2
ARG pool_ip=127.0.0.1

# EDIT - Store pool ip in environment variable
ENV POOL_IP=$pool_ip

EXPOSE 9701 9702 9703 9704 9705 9706 9707 9708

# EDIT - Use different entry script- generate indy pool just once
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/indy-testnet/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
image: ${CACTUS_INDY_TESTNET_IMAGE_NAME:-indy-testnet-pool}
build:
context: ./
args:
- pool_ip=172.16.0.2
ports:
- "9701:9701"
- "9702:9702"
Expand Down
3 changes: 2 additions & 1 deletion tools/docker/indy-testnet/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
echo ${POOL_IP}

if [ ! -e '/var/lib/indy/sandbox/pool_transactions_genesis' ]; then
echo "CREATE ${UID}"
generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4 --ips="${POOL_IP},${POOL_IP},${POOL_IP},${POOL_IP}"
fi

/usr/bin/supervisord
/usr/local/bin/supervisord

0 comments on commit 705998a

Please sign in to comment.