Skip to content

Instantly share code, notes, and snippets.

View mbwhite's full-sized avatar

Matthew B White mbwhite

View GitHub Profile
@mbwhite
mbwhite / getLatestDockerImages.sh
Created January 21, 2020 09:37
Gets the master branch Fabric Docker images
#!/bin/bash -e
set -euo pipefail
echo "======== PULL DOCKER IMAGES ========"
###############################################################
# Pull and Tag the fabric and fabric-ca images from Artifactory
###############################################################
echo "Fetching images from Artifactory"
ARTIFACTORY_URL=hyperledger-fabric.jfrog.io
@mbwhite
mbwhite / Setup
Last active December 20, 2019 22:22
RPi Setup
https://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
rsync -azvh ~/github.com $BACKUP/
https://www.raspberrypi.org/documentation/remote-access/ssh/README.md
https://www.raspberrypi.org/documentation/configuration/raspi-config.md
Change pwd
@mbwhite
mbwhite / monitordocker.sh
Last active November 18, 2019 13:39
Live monitoring of docker containers
#!/bin/bash
# You can use this command to get this script
#
# curl -LOs https://gist.github.com/mbwhite/a32abc57a0a45ecc466977ceef67df1f/raw/monitordocker.sh && chmod +x monitordocker.sh
#
# This script uses the logspout and http stream tools to let you watch the docker containers
# in action.
#
# More information at https://github.com/gliderlabs/logspout/tree/master/httpstream
@mbwhite
mbwhite / gist:668494565bf0b155c6fb60627f9deb09
Created October 15, 2019 09:46
2.0 LIfecycle cheat sheet
## Cheat Sheet for sequence of commands for v2.0 lifecycle and byfn
docker kill $(docker ps -q) && docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q) --force
docker volume prune -f && docker network prune -f
./byfn.sh generate
./byfn.sh restart
# org1 ->
docker exec -it cli bash
@mbwhite
mbwhite / JavaChaincodeQuickStart.md
Created October 14, 2019 10:59
Draft of QuickStart with Fabric Java Chaincode

Quick Start - Java Chaincode

Aim: to get up and working with Java Chaincode as quick as possible. Also as a sanity check that everything is setup correctly.

Assumptions

That you have:

  • git installed
  • docker and docker-compose installed
@mbwhite
mbwhite / dashboard.json
Last active October 21, 2019 16:08
Java Chaincode Grafanna Dashboard (WIP)
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@mbwhite
mbwhite / notes.md
Created August 23, 2019 07:48
Running Chaincode in Dev move

Node.js - example script in package.json

 "start:dev": "CORE_CHAINCODE_LOGGING_SHIM=debug fabric-chaincode-node start --peer.address=localhost:7052 --chaincode-id-name hellonet:1"

sudo yum install gcc-c++ make


# get the nvm installer for node.js
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
# (restart the terminal app to get this added to your shell path)
@mbwhite
mbwhite / setup-ubuntu-dev.sh
Last active February 27, 2021 20:53
Ubuntu Setup
#!/bin/bash
# update packge information and
# install the build essentials
sudo apt update
sudo apt install build-essentials git
sudo apt upgrade
# zsh
sudo apt-get install zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@mbwhite
mbwhite / metadata.ts
Created May 10, 2019 09:11
Example client app to get data from Hyperledger Fabric Contract
/*
SPDX-License-Identifier: Apache-2.0
*/
/**
* Client application to get the metadata from a deployed Fabric Contract.
*
* Good example of the essentials of connecting a client to Fabric, and how to
* issue a simple transaction. As this is an 'evaluate' transaction (i.e. nothing is
* committed to the ledger) it is also a useful 'ping' transactions. All chaincode's start