Skip to content

Instantly share code, notes, and snippets.

@cryptodusan
Last active September 14, 2021 07:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptodusan/368ceb68ab7ba65c1638bbe6fe94c766 to your computer and use it in GitHub Desktop.
Save cryptodusan/368ceb68ab7ba65c1638bbe6fe94c766 to your computer and use it in GitHub Desktop.
Ironfish Docker script
#!/bin/bash
CONTAINER_NAME=ironfish
RUNNING=$(docker ps -f name=${CONTAINER_NAME} -q)
if [ -z $RUNNING ]; then
docker run --rm --tty --interactive --name $CONTAINER_NAME --network host --volume $HOME/.ironfish:/root/.ironfish ghcr.io/iron-fish/ironfish:latest $@
else
docker exec --tty --interactive $CONTAINER_NAME ./bin/run $@
fi
@cryptodusan
Copy link
Author

Simple script that helps execute ironfish commands when run as a docker container.

  • container is not running -> it will start one (and execute the given command)
  • container is running -> it executes the command within that container

I also recommend "installing" the script as a regular command, i.e.:
sudo update-alternatives --install /usr/local/bin/ironfish ironfish PATH_TO_SCRIPT 0

After that, it's easy to just run ironfish start, ironfish miners:start, ironfish status -f...

@tucq88
Copy link

tucq88 commented Sep 14, 2021

Hmm it's started but can't connect, Any suggestion for network config?

Update : It takes time with docker setup for connecting with node & enable to run other commands. So be patient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment