Skip to content

Instantly share code, notes, and snippets.

@koakh
Last active April 30, 2020 21:24
Show Gist options
  • Save koakh/6e3b909417eb603853cbff8216efd180 to your computer and use it in GitHub Desktop.
Save koakh/6e3b909417eb603853cbff8216efd180 to your computer and use it in GitHub Desktop.
setup hyperledger fabric 1.4.6 on ubuntu 18.04...20.04
#!/bin/bash
[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1
FABRIC_VERSION=1.4.6
# FABRIC_VERSION=2.0.1
echo "install docker"
apt install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"
apt update && sudo apt upgrade
apt install docker-ce -y
echo "add docker group to user"
usermod -aG docker ${USER}
newgrp docker
echo "add user to docker group and reboot or use newgrp"
usermod -aG docker ${USER}
id -nG
newgrp docker
echo "install docker compose"
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo "install HyperLedger Fabric"
apt install git python -y
wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.14.2.linux-amd64.tar.gz
rm go1.14.2.linux-amd64.tar.gz
cd ~
curl -sSL https://bit.ly/2ysbOFE | bash -s ${FABRIC_VERSION}
echo "" >> ~/.bashrc
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc
echo "export PATH=\$PATH:/home/mario/fabric-samples/bin" >> ~/.bashrc
source ~/.bashrc
docker -v
docker-compose -v
go version
echo "test network"
cd fabric-samples/first-network/ \
./byfn.sh up
# FABRIC_VERSION=2.0.1
# cd fabric-samples/test-network
# ./network.sh up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment