Skip to content

Instantly share code, notes, and snippets.

@ihavenoface
Last active December 10, 2023 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihavenoface/ac2fcdf0d2e7916bd54d2fc219bc58c5 to your computer and use it in GitHub Desktop.
Save ihavenoface/ac2fcdf0d2e7916bd54d2fc219bc58c5 to your computer and use it in GitHub Desktop.
peercoind + portainer

docker

  1. Install docker
  2. Install portainer
  3. Run the container
mkdir /opt/peercoin-data && cp wallet.dat /opt/peercoin-data/
docker run -d --name=peercoind -v /opt/peercoin-data:/data --restart=always peercoin/peercoind
  1. Interface via command line
    The entrypoint in the current peercoin/peercoind image doesn't pass -datadir=/data internally by default, so we need to specify it.
docker exec peercoind peercoin-cli -datadir=/data getblockchaininfo
docker exec peercoind peercoin-cli -datadir=/data -walletpassphrase="myawesomepassword" 69696969
docker logs -f peercoind
  1. Scroll down to check how to interface via portainer

docker-compose

  1. Install docker + docker-compose
  2. Run project using docker-compose
    (peercoin + portainer) will be run automatically
# copy the docker-compose.yml from this gist to a local dir
mkdir /opt/peercoin-data && cp wallet.dat /opt/peercoin-data/
docker-compose up -d
  1. Interface via command line
    The entrypoint in the current peercoin/peercoind image doesn't pass -datadir=/data internally by default, so we need to specify it.
docker exec peercoind peercoin-cli -datadir=/data getblockchaininfo
# or
docker-compose exec peercoind peercoin-cli -datadir=/data getblockchaininfo
docker exec peercoind peercoin-cli -datadir=/data -walletpassphrase="mypassword" 69696969
# or
docker-compose exec peercoind peercoin-cli -datadir=/data -walletpassphrase="mypassword" 69696969
docker logs -f peercoind
# or
docker-compose logs -f peercoind
  1. Scroll down to check how to interface via portainer

portainer

Run any command by entering the container
primary -> Containers -> locate peercoind -> Quick Actions -> Exec Console -> User "peercoin" -> Connect

enter container

services:
peercoind:
image: peercoin/peercoind
container_name: peercoind
volumes:
- /opt/peercoin-data:/data
restart: always
portainer:
image: portainer/portainer-ce:alpine
container_name: portainer
command: -H unix:///var/run/docker.sock
ports:
- "8000:8000"
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
restart: always
volumes:
portainer_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment