Skip to content

Latest commit

 

History

History
138 lines (98 loc) · 4.46 KB

File metadata and controls

138 lines (98 loc) · 4.46 KB

Essential Setup

Remember to clone this repository!

git clone https://github.com/hyperledger/fabric-samples.git fabric-samples
cd fabric-samples/full-stack-asset-transfer-guide
export WORKSHOP_PATH=$(pwd)

to check the tools you already have ./check.sh

Option 1: Use local environment

Do you want to configure your local environment with the workshop dependencies?

  • To develop an application and/or contract (first two parts of workshop) follow the DEV setup below

  • To deploy a chaincode to kubernetes in a production manner (third part of workshop) follow the PROD setup below

Option 2: Use a Multipass Ubuntu image

If you do not want to install dependencies on your local environment, you can use a Multipass Ubuntu image instead.

Tip - You may need to stop any VPN client for the Multipass networking to work.

  • Install multipass

  • Launch the virtual machine and automatically install the workshop dependencies:

multipass launch \
  --name        fabric-dev \
  --disk        80G \
  --cpus        8 \
  --mem         8G \
  --cloud-init  infrastructure/multipass-cloud-config.yaml
  • Mount the local workshop to your multipass vm:
multipass mount $PWD fabric-dev:/home/ubuntu/full-stack-asset-transfer-guide
  • Open a shell on the virtual machine:
multipass shell fabric-dev

Tip - The vm creation log can be seen at /var/log/cloud-init-output.log if you need to troubleshoot anything.

  • You are now inside the virtual machine. cd to the workshop directory:
cd full-stack-asset-transfer-guide
  • Install Fabric peer CLI and set environment variables
curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
./install-fabric.sh binary
export WORKSHOP_PATH=$(pwd)
export PATH=${WORKSHOP_PATH}/bin:$PATH
export FABRIC_CFG_PATH=${WORKSHOP_PATH}/config

Note - You'll probably want three terminal windows for running the workshop, go ahead and open the shells now:

multipass shell fabric-dev
  • Eventual cleanup - To remove the multipass image when you are done with it after the workshop:
multipass delete fabric-dev
multipass purge
multipass list

DEV - Required Tools

You will need a set of tools to assist with chaincode and application development. We'll assume you are developing in Node for this workshop, but you could also develop in Java or Go by installing the respective compilers.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install 16
  • typescript to compile typescript chaincode and applications to node
npm install -g typescript
  • weft Hyperledger-Labs cli to work with identities and chaincode packages
npm install -g @hyperledger-labs/weft
  • jq jq JSON command-line processor
sudo apt-get update && sudo apt-get install -y jq
  • Fabric peer CLI
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
export WORKSHOP_PATH=$(pwd)
export PATH=${WORKSHOP_PATH}/bin:$PATH
export FABRIC_CFG_PATH=${WORKSHOP_PATH}/config

PROD - Required Tools for Kubernetes Deployment

  • kubectl
  • jq
  • just to run all the comamnds here directly
  • kind if you want to create a cluster locally, see below for other options
  • k9s (recommended, but not essential)

Beta Ansible Playbooks

The v2.0.0-beta Ansible Collection for Hyperledger Fabric is required for Kubernetes deployment. This isn't yet being published to DockerHub but is being published to Github Packages.

For reference check the latest version of ofs-ansible

The Ansible scripts in the workshop are set to use the latest image here by default.