* Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * missed a .git ignored directory on add Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Updates to run the workshop on the Apple M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Build an arch-specific CC images on M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * empty commit - force a build Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * revert an accidental commit that was building the top-level asset-transfer as arm64 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
4.4 KiB
Essential Setup
Remember to clone this repository!
git clone https://github.com/hyperledgendary/full-stack-asset-transfer-guide.git workshop
cd workshop
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.
-
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
- node v16 and npm to run node chaincode and applications
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.