Skip to content

Instantly share code, notes, and snippets.

Carl Youngblood cayblood

Block or report user

Report or block cayblood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docker-compose-cli.yaml
version: '2'
services:
cli:
container_name: cli
image: hyperledger/fabric-tools:1.2.0
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=info # Set logging level to debug for more verbose logging
@cayblood
cayblood / permissions-example.js
Last active Feb 26, 2020
example of how to use hyperledger fabric permissions
View permissions-example.js
'use strict';
const shim = require('fabric-shim');
async function requireRole(stub, role) {
const ClientIdentity = shim.ClientIdentity;
let cid = new ClientIdentity(stub);
if (!cid.assertAttributeValue('role', role))
throw new Error(`Unauthorized access: ${role} required`);
}
@cayblood
cayblood / AMBManagementMachinePolicy.json
Created Feb 26, 2020
Policy attached to fabric client machine role that connects to Amazon Managed Blockchain networks.
View AMBManagementMachinePolicy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ManageNetworkResources",
"Effect": "Allow",
"Action": [
"managedblockchain:CreateProposal",
"managedblockchain:GetProposal",
"managedblockchain:DeleteMember",
View amb-workshop.txt
1. Visit https://awslabs1.awsapps.com/start/
2. Log in with your username and password
3. Your AMB network should already be created with the following settings:
NetworkName acme
NetworkDescription ACME consortium blockchain
Edition STARTER
FirstMemberName ACME1stMember
FirstMemberDescription The first member in the ACME consortium
FirstMemberAdminUsername acme1admin
View prompt.bash
# display user@host and current working dir
PS1='\[$(tput setaf 2)\]\u\[$(tput sgr0)\]@\[$(tput setaf 3)\]\h\[$(tput sgr0)\] \w'
# display git info if applicable
PS1=$PS1'\[$(tput setaf 5)\]`if [ "$(vcprompt)" != "" ]; then echo " $(vcprompt | tr -d '"'"'[:space:]'"'"')"; fi`'
# display rvm info if applicable
PS1=$PS1'\[$(tput setaf 1)\] [`if [ "$(~/.rvm/bin/rvm-prompt)" != "" ]; then echo "$(~/.rvm/bin/rvm-prompt)"; fi`]\[$(tput sgr0)\]'
# display nvm info if available
@cayblood
cayblood / saltaires-deploy.sh
Created Apr 12, 2019
Saltaires static web site deployment script
View saltaires-deploy.sh
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
View start-devbox.sh
#!/bin/bash
INSTANCE_ID=$(aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | {id: .InstanceId, name: .Tags[] | select(.Key == "Name") | .Value} | select(.name == "carl-development") | .id')
aws ec2 start-instances --instance-ids "$INSTANCE_ID"
@cayblood
cayblood / multipart
Last active Apr 11, 2019
User data to update a Route53 subdomain with the new IP address of an EC2 instance every time it boots. Instance must be assigned role with Route53 permissions.
View multipart
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
@cayblood
cayblood / tezos-baker-setup.sh
Last active Feb 17, 2019
How to set up a tezos baker on EC2 ubuntu 18.04
View tezos-baker-setup.sh
###############################################################
# TEZOS BAKING SETUP
#
# Technical overview: http://tezos.gitlab.io/mainnet/whitedoc/proof_of_stake.html
#
# other tools: https://github.com/bakechain/bakechain
# https://github.com/Cryptonomic/Deployments/wiki/Galleon:-Releases
#
# short link: http://bit.ly/tezos-baker
#
@cayblood
cayblood / polymer_setup.js
Last active Jan 17, 2019
Adding custom elements needs to wait until after polymer-ready
View polymer_setup.js
// 1. Load Polymer before any code that touches the DOM.
var script = document.createElement("script");
script.src = "/base/bower_components/webcomponentsjs/webcomponents.js";
document.getElementsByTagName("head")[0].appendChild(script);
// Delay Jasmine specs until WebComponentsReady
var POLYMER_READY = false;
beforeEach(function(done) {
window.addEventListener('polymer-ready', function () {
You can’t perform that action at this time.