Skip to content

Commit

Permalink
Merge pull request #53 from xian-network/cometbft0-38-5
Browse files Browse the repository at this point in the history
Update docker
  • Loading branch information
crosschainer authored Mar 28, 2024
2 parents 06c609c + 9bca88c commit 86ca09a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
27 changes: 15 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@
FROM ubuntu:22.04

# Install necessary packages
RUN apt-get update \
&& apt-get install -y pkg-config python3.11 python3.11-dev python3.11-venv libhdf5-dev build-essential git wget \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y pkg-config python3.11 python3.11-dev python3.11-venv libhdf5-dev build-essential git wget && \
rm -rf /var/lib/apt/lists/*

# Clone Xian and related repositories
RUN git clone https://github.com/xian-network/xian-core.git /xian \
&& cd /xian \
&& git clone https://github.com/XianChain/contracting.git
RUN git clone https://github.com/xian-network/xian-core.git /xian && \
cd /xian && \
git clone https://github.com/XianChain/contracting.git

# Set up Python virtual environment and dependencies
RUN python3.11 -m venv /xian_venv \
&& . /xian_venv/bin/activate \
&& pip install -e /xian/contracting/ -e /xian/
RUN python3.11 -m venv /xian_venv && \
. /xian_venv/bin/activate && \
pip install -e /xian/contracting/ -e /xian/

# Set the working directory
WORKDIR /xian

# Download, unpack, and initialize Tendermint
# Download, unpack, and initialize CometBFT
RUN wget https://github.com/cometbft/cometbft/releases/download/v0.38.6/cometbft_0.38.6_linux_amd64.tar.gz && \
tar -xf cometbft_0.38.6_linux_amd64.tar.gz && \
rm cometbft_0.38.6_linux_amd64.tar.gz && \
mv cometbft /usr/local/bin && \
cometbft init
cometbft init && \
cp /xian/config/genesis.json /root/.cometbft/config/genesis.json && \
python3.11 /xian/src/xian/tools/validator_file_gen.py --validator_privkey ${VALIDATOR_PRIVKEY} && \
cp /xian/tools/priv_validator_key.json /root/.cometbft/config/priv_validator_key.json

# Expose the Tendermint RPC port
# Expose the CometBFT RPC port
EXPOSE 26657

# Copy the script to the container
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "26657:26657"
- "26657:26657"
environment:
- VALIDATOR_PRIVKEY=${VALIDATOR_PRIVKEY}

0 comments on commit 86ca09a

Please sign in to comment.