Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QB-1793 Update Dockerfile #253

Merged
merged 2 commits into from
May 1, 2023
Merged

QB-1793 Update Dockerfile #253

merged 2 commits into from
May 1, 2023

Conversation

weichen-qsnetwork
Copy link
Collaborator

@weichen-qsnetwork weichen-qsnetwork commented Apr 20, 2023

Change details

  • Use entrypoint.sh to update permissions when we mount the folder to the container.
  • Update Dockerfile to use higher Golang version and new dependencies.
  • Update Makefile to easily build docker images.

How to use

Quickly start a stratos chain fullnode

docker build -t stchain .
docker run -d --name stchain-node stchain

It will connect the default chain on stratos-chain-testnet.

Run a stratos chain custom node

If you want to keeps all configuration and data files outside the container, you can follow the script:

STCHAIND_HOME=~/stchaind-home
MONIKER=test-node
CONTAINER_NAME=stchain-node
GENESIS_FILE_URL=https://raw.githubusercontent.com/stratosnet/stratos-chain-testnet/main/genesis.json
CONFIG_FILE_URL=https://raw.githubusercontent.com/stratosnet/stratos-chain-testnet/main/config.toml

# Build docker image
make build-docker

# Init chain node
mkdir -v $STCHAIND_HOME
docker run --rm -v $STCHAIND_HOME:/stchaind/.stchaind stratos-chain "stchaind init $MONIKER"

# Download genesis and config from testnet
wget $GENESIS_FILE_URL -O $STCHAIND_HOME/config/genesis.json
wget $CONFIG_FILE_URL -O $STCHAIND_HOME/config/config.toml
sed -i 's/moniker = ".*"/moniker = "'$MONIKER'"/g' $STCHAIND_HOME/config/config.toml

# Start chain node
docker run --name $CONTAINER_NAME -d -v $STCHAIND_HOME:/stchaind/.stchaind stratos-chain "stchaind start"

# View logs
sudo docker logs $CONTAINER_NAME

# Stop chain node
sudo docker stop $CONTAINER_NAME

# Remove chain node and data
sudo docker rm $CONTAINER_NAME
rm -rf $STCHAIND_HOME

@weichen-qsnetwork weichen-qsnetwork force-pushed the QB-1793.update.dockerfile branch from 87b8977 to 950ae28 Compare April 26, 2023 12:21
@weichen-qsnetwork weichen-qsnetwork changed the base branch from dev to release April 26, 2023 12:22
@weichen-qsnetwork weichen-qsnetwork force-pushed the QB-1793.update.dockerfile branch from 950ae28 to 38e4fde Compare April 26, 2023 12:26
@alexstratos alexstratos merged commit ece8cd3 into release May 1, 2023
@alexstratos alexstratos deleted the QB-1793.update.dockerfile branch May 1, 2023 19:13
alexstratos pushed a commit that referenced this pull request May 17, 2023
* QB-1793 Update Dockerfile
* Download genesis and config in entrypoint.sh
Co-authored-by: weichen-qsnetwork <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants