Skip to content

Instantly share code, notes, and snippets.

@sykesm
sykesm / go.mod
Created July 22, 2020 15:52
errInvalidUTF8 is not a proto.Error
module proto-utf8
go 1.14
require (
github.com/golang/protobuf v1.4.2
google.golang.org/protobuf v1.25.0
)
@sykesm
sykesm / config.md
Last active October 11, 2019 19:40
Config Discussion

Fabric Configuration

Fabric configuration is currently implemented around a configuration library called [viper][viper]. Viper reads configuration from files, environment variables, and flags, and exposes an API that uses dot qualified keys to reference the configuration values (think System Properties on steroids).

When configuration is read from files, the segments of the configuration key are used to walk config file stanzas to the data. Values read from the configuration file can be overridden by setting an environment variable that

@sykesm
sykesm / launcher.slide
Created August 16, 2019 17:54
updated launcher proposal
External Chaincode Launcher
Roadmap
Matthew Sykes
IBM
sykesmat@us.ibm.com
* Why?
@sykesm
sykesm / launching.md
Last active May 17, 2019 07:54
Process based launch propsoal

Goals

  • Provide Fabric operators with a mechanism to build and launch chaincode outside of Docker
  • Begin the process of decoupling and extracting chaincode build processing from the peer

Background

Our current chaincode deployment model looks a lot like a PaaS; chaincode developers write code in the language of their choice and push it to the peer for execution. The peer, on demand, transforms the code into an executable package, launches the chaincode in an execution environment, and routes requests to the running chaincode.

Unfortunately, we have implemented this by hard coding the logic for packaging, building, and running chaincode inside Docker containers. In addition to making it difficult to experiment with new chaincode types, the implementation requires operators to grant the peer access to a Docker daemon. Since Docker daemon access enables the peer to perform a number of privileged actions, it's strongly discouraged in security conscious environments. This binding also prevents operators

@sykesm
sykesm / pluginfactory.go
Last active February 25, 2019 14:03
Possible use of reflection to address interface compatibility issues with vending of bccsp plugin.
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package factory
import (
"errors"
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package simple
import (
"fmt"
#!/bin/bash -ex
pwd
# /Users/cfdojo/workspace/fabric/standalone
killall orderer peer
rm -rf output peer1 peer2
mkdir -p output/crypto
cryptogen generate --config testdata/crypto-config.yaml --output output/crypto
@sykesm
sykesm / inconsolata-dz.css
Last active March 4, 2018 15:40
Blink Shell Inconsolata-dz for Powerline
@font-face {
font-family: "Inconsolata-dz for Powerline";
font-style: normal;
font-weight: normal;
src: url(data:font/opentype;charset-utf-8;base64,T1RUTwALAIAAAwAwQ0ZGIFWjzGQAAAo0AABX1kZGVE1bUJ1iAABkjAAAABxHREVGAVoABAAAYgwAAAAgT1MvMl4Wx0gAAAEgAAAAYGNtYXD6yx74AAAGnAAAA3ZoZWFk/OhPcgAAALwAAAA2aGhlYQboAW4AAAD0AAAAJGhtdHg1ZDKaAABiLAAAAl5tYXhwAS1QAAAAARgAAAAGbmFtZUgkeAsAAAGAAAAFHHBvc3T/hgAzAAAKFAAAACAAAQAAAAECjz7UcWpfDzz1AAsD6AAAAADNuYSFAAAAAM25hIX/4P8tAnYDxwAAAAgAAgAAAAAAAAABAAADx/8zAMgCV//g/+ECdgABAAAAAAAAAAAAAAAAAAAAAgAAUAABLQAAAAMCVwH0AAUACAKKArwAAACMAooCvAAAAeAAMQECAAACCwYJAwADAAAAgAAALwAAAWsAAAAAAAAAAFBmRWQAQAAg4LMDNP9MAAADxwDNAAAAEwAAAAACEQLSACAAIAABAAAAEgDeAAEAAAAAAAAAmwE4AAEAAAAAAAEAHAIOAAEAAAAAAAIAAgIxAAEAAAAAAAMAKgKKAAEAAAAAAAQAHALvAAEAAAAAAAUAEAMuAAEAAAAAAAYAGgN1AAEAAAAAABAAHAPKAAEAAAAAABIAHAQhAAMAAQQJAAABNgAAAAMAAQQJAAEAOAHUAAMAAQQJAAIABAIrAAMAAQQJAAMAVAI0AAMAAQQJAAQAOAK1AAMAAQQJAAUAIAMMAAMAAQQJAAYANAM/AAMAAQQJABAAOAOQAAMAAQQJABIAOAPnAEMAcgBlAGEAdABlAGQAIABiAHkAIABSAGEAcABoACAATABlAHYAaQBlAG4AIAB1AHMA

Keybase proof

I hereby claim:

  • I am sykesm on github.
  • I am sykesm (https://keybase.io/sykesm) on keybase.
  • I have a public key whose fingerprint is 4884 F32E 7A73 3714 3FCA 540D BDBE CC3A C6E8 562A

To claim this, I am signing this object:

@sykesm
sykesm / transform-leases.pl
Last active April 22, 2022 07:59
Transform dnsmasq leases to ISC lease file format.
#!/usr/bin/perl
use NetAddr::IP;
use POSIX qw(strftime);
my $dnsmasq_leases_path = '/var/run/dnsmasq-dhcp.leases';
my $dhcpd_leases_path = '/var/run/dhcpd.leases';
my $network_names_path = '/opt/vyatta/config/active/service/dhcp-server/shared-network-name';
my %networks_by_subnet;