Skip to content

Instantly share code, notes, and snippets.

@kctam
kctam / crypto-config.yaml
Created April 7, 2019 05:55
3node2channel setup
OrdererOrgs:
- Name: Orderer
Domain: example.com
Specs:
- Hostname: orderer
PeerOrgs:
- Name: Org1
Domain: org1.example.com
Template:
Count: 1
@kctam
kctam / configtx.yaml
Created April 7, 2019 05:57
3node2channel setup
---
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: ./crypto-config/ordererOrganizations/example.com/msp
- &Org1
Name: Org1MSP
@kctam
kctam / docker-compose-base.yml
Created April 7, 2019 06:01
3node2channel setup
version: '2'
services:
orderer:
image: hyperledger/fabric-orderer
environment:
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=deployment_fabric
- ORDERER_HOME=/var/hyperledger/orderer
- ORDERER_GENERAL_LOGLEVEL=debug
@kctam
kctam / docker-compose-orderer.yml
Created April 7, 2019 06:03
3node2channel setup
version: '2'
networks:
fabric:
services:
orderer.example.com:
extends:
file: docker-compose-base.yml
@kctam
kctam / docker-compose-node1.yml
Created April 7, 2019 06:03
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org1.example.com:
extends:
file: docker-compose-base.yml
service: peer
@kctam
kctam / docker-compose-node2.yml
Created April 7, 2019 06:04
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org2.example.com:
extends:
file: docker-compose-base.yml
service: peer
@kctam
kctam / docker-compose-node3.yml
Created April 7, 2019 06:05
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org3.example.com:
extends:
file: docker-compose-base.yml
service: peer
@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;
@kctam
kctam / emarket.t.sol
Created May 19, 2019 02:34
marketplace with no token
pragma solidity ^0.5.6;
import "ds-test/test.sol";
import "./Emarket.sol";
contract EmarketTest is DSTest {
Emarket emarket;
function setUp() public {
@kctam
kctam / emarketwithcoin.sol
Created May 19, 2019 02:45
marketplace with token
pragma solidity ^0.5.6;
import "ds-token/token.sol";
contract Emarketwithcoin {
struct Item {
string description;
address seller;
address buyer;
uint price;