Skip to content

Commit

Permalink
Merge pull request #54 from xian-network/cometbft0-38-5
Browse files Browse the repository at this point in the history
docker working
  • Loading branch information
crosschainer authored Mar 28, 2024
2 parents 86ca09a + c3ce926 commit acafc52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Use Ubuntu 22.04 as base image
FROM ubuntu:22.04

ARG VALIDATOR_PRIVKEY

# 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 && \
Expand All @@ -13,8 +15,7 @@ RUN git clone https://github.com/xian-network/xian-core.git /xian && \

# 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/
/xian_venv/bin/pip install -e /xian/contracting/ -e /xian/

# Set the working directory
WORKDIR /xian
Expand All @@ -25,9 +26,10 @@ RUN wget https://github.com/cometbft/cometbft/releases/download/v0.38.6/cometbft
rm cometbft_0.38.6_linux_amd64.tar.gz && \
mv cometbft /usr/local/bin && \
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
cp /xian/src/xian/genesis/genesis.json /root/.cometbft/config/genesis.json && \
cp /xian/src/xian/config/config.toml /root/.cometbft/config/config.toml && \
/xian_venv/bin/python3.11 /xian/src/xian/tools/validator_file_gen.py --validator_privkey ${VALIDATOR_PRIVKEY} && \
cp priv_validator_key.json /root/.cometbft/config/priv_validator_key.json

# Expose the CometBFT RPC port
EXPOSE 26657
Expand All @@ -38,5 +40,5 @@ COPY start_node.sh /start_node.sh
# Make the script executable
RUN chmod +x /start_node.sh

# Run the script when the container starts
CMD ["/start_node.sh"]
# Run the script
CMD ["/start_node.sh"]
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
- VALIDATOR_PRIVKEY=${VALIDATOR_PRIVKEY}
ports:
- "26657:26657"
environment:
- VALIDATOR_PRIVKEY=${VALIDATOR_PRIVKEY}
- "26657:26657"

0 comments on commit acafc52

Please sign in to comment.