Skip to content

Instantly share code, notes, and snippets.

@kctam
kctam / crypto-config.yaml
Created December 10, 2018 13:40
Hyperledger Fabric Multi-Channel Setup: crypto-config.yaml
OrdererOrgs:
- Name: Orderer
Domain: example.com
Specs:
- Hostname: orderer
PeerOrgs:
- Name: Org1
Domain: org1.example.com
EnableNodeOUs: true
Template:
@kctam
kctam / configtx.yaml
Created December 10, 2018 13:41
Hyperledger Fabric Multi-Channel Setup
---
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/example.com/msp
- &Org1
Name: Org1MSP
@kctam
kctam / sacc.go
Created December 10, 2018 14:01
Hyperledger Fabric Multi-Channel Network: chaincode
/*
* Copyright IBM Corp All Rights Reserved
*
* SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"fmt"
@kctam
kctam / PAXImplementation.sol
Created December 16, 2018 14:40
Exploring an ERC20 Token
pragma solidity ^0.4.24;
pragma experimental "v0.5.0";
import "./zeppelin/SafeMath.sol";
/**
* @title PAXImplementation
* @dev this contract is a Pausable ERC20 token with Burn and Mint
@kctam
kctam / enrollAdmin.js
Created March 28, 2019 09:40
Direct adopted from fabric-samples/fabcar/
/*
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
const FabricCAServices = require('fabric-ca-client');
const { FileSystemWallet, X509WalletMixin } = require('fabric-network');
const fs = require('fs');
const path = require('path');
@kctam
kctam / registerUser.js
Created March 28, 2019 09:43
adopted from fabric-samples/fabcar
/*
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
const { FileSystemWallet, Gateway, X509WalletMixin } = require('fabric-network');
const fs = require('fs');
const path = require('path');
'use strict';
const { FileSystemWallet, Gateway } = require('fabric-network');
const fs = require('fs');
const path = require('path');
const { KJUR, KEYUTIL, X509 } = require('jsrsasign');
const CryptoJS = require('crypto-js');
const ccpPath = path.resolve(__dirname, '..', 'basic-network', 'connection.json');
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/hyperledger/fabric/core/chaincode/shim"
sc "github.com/hyperledger/fabric/protos/peer"
)
'use strict';
const { FileSystemWallet, Gateway } = require('fabric-network');
const fs = require('fs');
const path = require('path');
const { KJUR, KEYUTIL } = require('jsrsasign');
const CryptoJS = require('crypto-js');
const ccpPath = path.resolve(__dirname, '..', 'basic-network', 'connection.json');
@kctam
kctam / emarket.sol
Created May 19, 2019 02:32
marketplace with no token
pragma solidity ^0.5.6;
contract Emarket {
struct Item {
string description;
address seller;
address buyer;
uint price;
bool sold;