Newer
Older
#!/bin/bash
trap 'exit 1' ERR
if ! which docker > /dev/null 2>&1
then
echo 'Can not find Docker. Make sure it is installed.'
if grep -q Debian /etc/issue
then
echo Consider
echo 'echo deb "[arch=amd64] https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker.list'
echo 'apt update'
echo 'apt install docker-ce-cli'
if grep -vq swapaccount=1 /etc/default/grub
then
echo 'Also, you should read https://docs.docker.com/install/linux/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities'
fi
fi
exit 1
fi
mkdir -p ${HOME}/dockers/volumes/bfanodo,home,bfa,bfa,network,node,geth
mounts="-v ${HOME}/dockers/volumes/bfanodo,home,bfa,bfa,network,node,geth:/home/bfa/bfa/network/node/geth"
docker run --rm $mounts -u root alpine chown -R 30303:30303 /home/bfa/bfa/network
docker run -d --memory 4g $mounts -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 -p 30303:30303 --restart=unless-stopped --name bfanodo rlegene/bfanode