├── basic-applications
├── java-app
│ ├── _cfg
│ │ └── .gitkeep
│ ├── .gitignore
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── README.md
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── src
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── hyperledger
│ │ │ │ └── fabric
│ │ │ │ └── javaapp
│ │ │ │ └── AppTest.java
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── example
│ │ │ └── App.java
│ ├── .project
│ ├── .classpath
│ ├── build.gradle
│ ├── gradlew.bat
│ └── gradlew
└── ts-app
│ ├── tsconfig.json
│ ├── tslint.json
│ ├── .editorconfig
│ ├── src
│ ├── util.ts
│ └── application.ts
│ ├── package.json
│ ├── .npmignore
│ └── .gitignore
├── basic-contract
├── java-contract
│ ├── .gitignore
│ ├── settings.gradle
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── .project
│ ├── .classpath
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── example
│ │ │ │ ├── MyAsset.java
│ │ │ │ └── MyAssetContract.java
│ │ └── test
│ │ │ └── java
│ │ │ └── org
│ │ │ └── example
│ │ │ └── MyAssetContractTest.java
│ ├── build.gradle
│ ├── gradlew.bat
│ └── gradlew
├── js-contract
│ ├── .eslintignore
│ ├── .vscode
│ │ ├── extensions.json
│ │ └── launch.json
│ ├── index.js
│ ├── .editorconfig
│ ├── .npmignore
│ ├── .eslintrc.js
│ ├── package.json
│ ├── .gitignore
│ ├── lib
│ │ └── my-asset-contract.js
│ └── test
│ │ └── my-asset-contract.js
└── ts-contract
│ ├── .vscode
│ ├── extensions.json
│ └── launch.json
│ ├── src
│ ├── index.ts
│ ├── my-asset.ts
│ ├── my-asset-contract.ts
│ └── my-asset-contract.spec.ts
│ ├── .editorconfig
│ ├── .npmignore
│ ├── tsconfig.json
│ ├── tslint.json
│ ├── .gitignore
│ └── package.json
├── hackathon-starter.code-workspace
├── basic-network
├── config
│ ├── channel.tx
│ └── genesis.block
├── stop.sh
├── crypto-config
│ ├── ordererOrganizations
│ │ └── example.com
│ │ │ ├── users
│ │ │ └── Admin@example.com
│ │ │ │ ├── tls
│ │ │ │ ├── server.key
│ │ │ │ ├── server.crt
│ │ │ │ └── ca.crt
│ │ │ │ └── msp
│ │ │ │ ├── keystore
│ │ │ │ └── 1deeab5433fa6e5f045eb763109d6165268fba153211af1281f00d45f54b1022_sk
│ │ │ │ ├── admincerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ │ ├── signcerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ │ ├── cacerts
│ │ │ │ └── ca.example.com-cert.pem
│ │ │ │ └── tlscacerts
│ │ │ │ └── tlsca.example.com-cert.pem
│ │ │ ├── orderers
│ │ │ └── orderer.example.com
│ │ │ │ ├── tls
│ │ │ │ ├── server.key
│ │ │ │ ├── ca.crt
│ │ │ │ └── server.crt
│ │ │ │ └── msp
│ │ │ │ ├── keystore
│ │ │ │ └── 4d2f776c0fef8eac3f460a7c3558dc7859c4fe458e262e674a6c23f242ea33d1_sk
│ │ │ │ ├── admincerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ │ ├── signcerts
│ │ │ │ └── orderer.example.com-cert.pem
│ │ │ │ ├── cacerts
│ │ │ │ └── ca.example.com-cert.pem
│ │ │ │ └── tlscacerts
│ │ │ │ └── tlsca.example.com-cert.pem
│ │ │ ├── ca
│ │ │ ├── a0606a4a860a1e31c90a23788da6f3b6b74925ed0d23061af4899409ba46ae6a_sk
│ │ │ └── ca.example.com-cert.pem
│ │ │ ├── tlsca
│ │ │ ├── 8d2186556c85d515e737d0c0da8d0d7672785b685cb503bcb95e53dcc279fba7_sk
│ │ │ └── tlsca.example.com-cert.pem
│ │ │ └── msp
│ │ │ ├── admincerts
│ │ │ └── Admin@example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ └── ca.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ └── tlsca.example.com-cert.pem
│ └── peerOrganizations
│ │ └── org1.example.com
│ │ ├── peers
│ │ └── peer0.org1.example.com
│ │ │ ├── tls
│ │ │ ├── server.key
│ │ │ ├── ca.crt
│ │ │ └── server.crt
│ │ │ └── msp
│ │ │ ├── keystore
│ │ │ └── 46be1d569fe68f33e517c9e0072a0ccfbfb42727480fb8c8d0223af321a7893d_sk
│ │ │ ├── admincerts
│ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ ├── signcerts
│ │ │ └── peer0.org1.example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ └── ca.org1.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ └── tlsca.org1.example.com-cert.pem
│ │ ├── users
│ │ ├── Admin@org1.example.com
│ │ │ ├── tls
│ │ │ │ ├── server.key
│ │ │ │ ├── server.crt
│ │ │ │ └── ca.crt
│ │ │ └── msp
│ │ │ │ ├── keystore
│ │ │ │ └── cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec_sk
│ │ │ │ ├── admincerts
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ │ ├── signcerts
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ │ ├── cacerts
│ │ │ │ └── ca.org1.example.com-cert.pem
│ │ │ │ └── tlscacerts
│ │ │ │ └── tlsca.org1.example.com-cert.pem
│ │ └── User1@org1.example.com
│ │ │ ├── tls
│ │ │ ├── server.key
│ │ │ ├── server.crt
│ │ │ └── ca.crt
│ │ │ └── msp
│ │ │ ├── keystore
│ │ │ └── c75bd6911aca808941c3557ee7c97e90f3952e379497dc55eb903f31b50abc83_sk
│ │ │ ├── signcerts
│ │ │ └── User1@org1.example.com-cert.pem
│ │ │ ├── admincerts
│ │ │ └── User1@org1.example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ └── ca.org1.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ └── tlsca.org1.example.com-cert.pem
│ │ ├── ca
│ │ ├── 4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
│ │ ├── org1.example.com-cert.pem
│ │ └── ca.org1.example.com-cert.pem
│ │ ├── tlsca
│ │ ├── ed3fd82393e95fc2c475afc113c8d2c591f745d1babc4d6d9cce0a1acc168acb_sk
│ │ └── tlsca.org1.example.com-cert.pem
│ │ └── msp
│ │ ├── admincerts
│ │ └── Admin@org1.example.com-cert.pem
│ │ ├── cacerts
│ │ └── ca.org1.example.com-cert.pem
│ │ └── tlscacerts
│ │ └── tlsca.org1.example.com-cert.pem
├── init.sh
├── teardown.sh
├── connection.yaml
├── README.md
├── start.sh
├── connection.json
├── generate.sh
├── crypto-config.yaml
├── configtx.yaml
└── docker-compose.yml
├── ci.sh
├── .circleci
└── config.yml
├── .build
└── makefile
├── .gitignore
├── README.md
└── LICENSE
/basic-applications/java-app/_cfg/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/.gitignore:
--------------------------------------------------------------------------------
1 | /.gradle/
2 | /build/
3 |
--------------------------------------------------------------------------------
/basic-applications/java-app/.gitignore:
--------------------------------------------------------------------------------
1 | _cfg/*
2 | build
3 | .gradle
4 | !.gitkeep
--------------------------------------------------------------------------------
/basic-contract/java-contract/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'MyJavaContract'
2 |
3 |
--------------------------------------------------------------------------------
/hackathon-starter.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": "."
5 | }
6 | ]
7 | }
--------------------------------------------------------------------------------
/basic-contract/js-contract/.eslintignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | coverage
6 |
--------------------------------------------------------------------------------
/basic-applications/java-app/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/basic-network/config/channel.tx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledgendary/hackathon-starter/master/basic-network/config/channel.tx
--------------------------------------------------------------------------------
/basic-applications/java-app/README.md:
--------------------------------------------------------------------------------
1 | This is based on the example in https://github.com/hyperledgendary/simple-fabric-client-java
2 |
--------------------------------------------------------------------------------
/basic-network/config/genesis.block:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledgendary/hackathon-starter/master/basic-network/config/genesis.block
--------------------------------------------------------------------------------
/basic-contract/js-contract/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "ibmblockchain.ibm-blockchain-platform"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "ibmblockchain.ibm-blockchain-platform"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/src/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | import { MyAssetContract } from './my-asset-contract';
6 | export { MyAssetContract } from './my-asset-contract';
7 |
8 | export const contracts: any[] = [ MyAssetContract ];
9 |
--------------------------------------------------------------------------------
/basic-applications/java-app/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/src/my-asset.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | import { Object, Property } from 'fabric-contract-api';
6 |
7 | @Object()
8 | export class MyAsset {
9 |
10 | @Property()
11 | public value: string;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const MyAssetContract = require('./lib/my-asset-contract');
8 |
9 | module.exports.MyAssetContract = MyAssetContract;
10 | module.exports.contracts = [ MyAssetContract ];
11 |
--------------------------------------------------------------------------------
/ci.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # SPDX-License-Identifier: Apache-2.0
4 | #
5 | function _exit(){
6 | printf "Exiting:%s\n" "$1"
7 | exit -1
8 | }
9 |
10 | # Where am I?
11 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
12 |
13 | make -f "${DIR}/.build/makefile" || exit "make failed"
--------------------------------------------------------------------------------
/basic-network/stop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright IBM Corp All Rights Reserved
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 | # Exit on first error, print all commands.
8 | set -ev
9 |
10 | # Shut down the Docker containers that might be currently running.
11 | docker-compose -f docker-compose.yml stop
12 |
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | jobs:
3 | build:
4 | docker:
5 | - image: debian:stretch
6 |
7 | steps:
8 | - checkout
9 |
10 | - run:
11 | name: Greeting
12 | command: echo Hello, world.
13 |
14 | - run:
15 | name: Print the Current Time
16 | command: date
--------------------------------------------------------------------------------
/basic-contract/js-contract/.editorconfig:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | root = true
6 |
7 | [*]
8 | indent_style = space
9 | indent_size = 4
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
14 |
15 | [*.md]
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/.editorconfig:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | root = true
6 |
7 | [*]
8 | indent_style = space
9 | indent_size = 4
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
14 |
15 | [*.md]
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg19ebRLtFBB+n9OCa
3 | KcXLds/nf306mSDnnrA7tlZVjaOhRANCAARmwt94D62Mckk7LGEk4/fW4OW4Lp4K
4 | cwGrQsprAG6Bqgje+qFPy7Hm3L6ihImTsQ3elNBrXSbSpf9jt7Qnv0kv
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgH/whD1mna09pbmG6
3 | txGQVIYDx1pZdM/Bkaq1eWYUZqChRANCAARYRRq90z+ioUM2U9OzPnvqvz9Jpza9
4 | JOEsG6UJyEzWB8R7bHr0XR1Dl8lodlLh3C5vTrb6vqtpNeVXVsd+VVyI
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgMvwKsTL9m2NygrLw
3 | dfrlMzyQlUaSPendFhF+2yLGaH2hRANCAATQBk6FZFnho5l4tIGKgKUe3lUOI1MJ
4 | 4jGfetXD2gLOUMMxohmsEbWUjija1c6A4ZIg8GZGPLvfo2NzngieUeWw
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqAuu2rihnWgQDlHI
3 | 7Gqyn+Bap3mMqbJ7UQLXIT6lwtmhRANCAATll9DA0DSgEYKvvNfgj9R+rUe3vjRG
4 | eRX7pUFx5objHjltHRrRlZ6yU/OYhFc6Kv1C+ou+fEZjdomJp1frmQ0U
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgf8ybpxd0cfNqWnfX
3 | KRoa6e/hEJGs0zMCkE+5si/xuV+hRANCAAQVyqoW6HkJdKKPgxrr+3JJcH2Fhmfa
4 | gVpUlY+fQkiGqPyuX28e43ODCgjVk1H18oaaui+ppmNxKDzuPGHuBlJ5
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright IBM Corp All Rights Reserved
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | # Exit on first error, print all commands.
9 | set -ev
10 | # delete previous creds
11 | rm -rf ~/.hfc-key-store/*
12 |
13 | # copy peer admin credentials into the keyValStore
14 | mkdir -p ~/.hfc-key-store
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/ca/a0606a4a860a1e31c90a23788da6f3b6b74925ed0d23061af4899409ba46ae6a_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgbIRfBJjk/t3HLnEz
3 | 32V4sCllmJtnliVv4UmLfrjZ+B6hRANCAASM01iiFoDgTsTd27nU+R1z7YZbqM4I
4 | Tlz13Mg+SQWsWn25IM6/IwtzNq5SSQZtJwpo7+gtS5IggDn7WJMi6Hy6
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/tlsca/8d2186556c85d515e737d0c0da8d0d7672785b685cb503bcb95e53dcc279fba7_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg6n+vdmDFdoXHLx81
3 | 4KX5d2rChT+6peumwVy6CK6Vld6hRANCAARrURUsnj4B4YrdiX0DZxm3Wt1/WPhG
4 | +Rbf+C/bi7MXOMxDC7dkyWXsBHzv1KHvWB/VYRZho/3fTNHf9B0gJyvF
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/ca/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgYMqNZRu/I7vdcjpm
3 | Tj+O9T4AYXi3MBNW4nzWHJN8nLqhRANCAATNLYBI3trLI/wFhYf+9MpnVb1R/vBF
4 | rbu/43J+R8u4E73sCcx0nRfYCA+dHf22ceuSjq3lMXraorVev5tg4Dc7
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/tlsca/ed3fd82393e95fc2c475afc113c8d2c591f745d1babc4d6d9cce0a1acc168acb_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgkcI0vNVNanWltD+I
3 | VHz5V1u01+X8VOG3a5ZTLRed0MmhRANCAAQH7XcNvPyU4R8q3xeEgk4x1MpH3kGd
4 | 3qksGJZAqmBdS8M2ntfKPewYs3aM/wQTI4rAKCREss1Tqxo+5xg+xM8F
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/.npmignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | # don't package the connection details
6 | local_fabric
7 |
8 | # don't package the tests
9 | test
10 | functionalTests
11 |
12 | # don't package config files
13 | .vscode
14 | .editorconfig
15 | .eslintignore
16 | .eslintrc.js
17 | .gitignore
18 | .npmignore
19 | .nyc_output
20 | coverage
21 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/.npmignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | # don't package the connection details
6 | local_fabric
7 |
8 | # don't package the tests
9 | test
10 | functionalTests
11 |
12 | # don't package config files
13 | .vscode
14 | .gitignore
15 | .npmignore
16 | tsconfig.json
17 | tslint.json
18 | .editorconfig
19 | .nyc_output
20 | coverage
21 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore/1deeab5433fa6e5f045eb763109d6165268fba153211af1281f00d45f54b1022_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgAKUK8aZ5PJMhPpx4
3 | 7mMQoJaha/3jhprXOSxj83ibaYShRANCAAQW58uZFcFkdzd3se9hJTiNHicmfN+Y
4 | mVY3oabQGb42w7yXBvVMNrhw/MA6CdsibVUXCEF36wTdMjMhawzYrO/V
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/keystore/4d2f776c0fef8eac3f460a7c3558dc7859c4fe458e262e674a6c23f242ea33d1_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg730zOAwSLJKj9wle
3 | jbxx4d0P2Qwl314A+znW9n6070mhRANCAARQ4kbOlqzGNLkQmZsUh78a04kkCjqa
4 | EmovJhP08G9VJ1pD9NCUw2WosRmAU/rBz0K2tSn9YOdn8zbMumgM+ORy
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/keystore/46be1d569fe68f33e517c9e0072a0ccfbfb42727480fb8c8d0223af321a7893d_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg46tw2jZtucld26uq
3 | RQAPPB1+y8BilJU2luj/OsMinWahRANCAAR4ocVupLNwdvuV3WwFatwgYMUUUWdt
4 | sc86apw/OpypM+3wRJQboZV5diuq08cmNjgTgdLbPJHqmfd8bnkRspq2
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgRgQr347ij6cjwX7m
3 | KjzbbD8Tlwdfu6FaubjWJWLGyqahRANCAARXV1+YrGwUpajujoM0EhohV5sII8Az
4 | 0L+wsG3iklGt72lYT3zsONdmhneCVzj4Og8y1OYFGps9XBhxS+lthjyn
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/c75bd6911aca808941c3557ee7c97e90f3952e379497dc55eb903f31b50abc83_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgJ8IrEgxfZzjGsyt+
3 | 0o27jvhwUJE2W1PrFeZi8LwHbiuhRANCAAQv9KiY1U7dHmeex6ZDiKb9RRnwjGzv
4 | +cfc0fVE59Un6bueIN/VmaG9PKInOtSkj6fn784ohf9n9WEO4AhH9Ass
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/basic-applications/java-app/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by the Gradle 'init' task.
3 | *
4 | * The settings file is used to specify which projects to include in your build.
5 | *
6 | * Detailed information about configuring a multi-project build in Gradle can be found
7 | * in the user guide at https://docs.gradle.org/5.1.1/userguide/multi_project_builds.html
8 | */
9 |
10 | rootProject.name = 'org.example.javaapp'
11 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "fabric:node",
9 | "request": "launch",
10 | "name": "Debug Smart Contract"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "target": "es2017",
5 | "moduleResolution": "node",
6 | "module": "commonjs",
7 | "declaration": true,
8 | "experimentalDecorators": true,
9 | "emitDecoratorMetadata": true,
10 | "sourceMap": true
11 | },
12 | "include": [
13 | "./src/**/*"
14 | ],
15 | "exclude": [
16 | "./src/**/*.spec.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/basic-applications/java-app/src/test/java/org/hyperledger/fabric/javaapp/AppTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This Java source file was generated by the Gradle 'init' task.
3 | */
4 | package org.hyperledger.fabric.javaapp;
5 |
6 | import org.junit.Test;
7 | import static org.junit.Assert.*;
8 |
9 | public class AppTest {
10 | // @Test public void testAppHasAGreeting() {
11 | // App classUnderTest = new App();
12 | // assertNotNull("app should have a greeting", classUnderTest.getGreeting());
13 | // }
14 | }
15 |
--------------------------------------------------------------------------------
/basic-network/teardown.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright IBM Corp All Rights Reserved
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 | # Exit on first error, print all commands.
8 | set -e
9 |
10 | # Shut down the Docker containers for the system tests.
11 | docker-compose -f docker-compose.yml kill && docker-compose -f docker-compose.yml down
12 |
13 | # remove the local state
14 | rm -f ~/.hfc-key-store/*
15 |
16 | # remove chaincode docker images
17 | docker rm $(docker ps -aq)
18 | docker rmi $(docker images dev-* -q)
19 |
20 | # Your system is now clean
21 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "target": "es2017",
5 | "moduleResolution": "node",
6 | "module": "commonjs",
7 | "declaration": true,
8 | "experimentalDecorators": true,
9 | "emitDecoratorMetadata": true
10 | },
11 | "include": [
12 | "./src/**/*", "../../../go/src/github.com/hyperledger/fabric-chaincode-node/fabric-contract-api/lib/annotations/propertyaccessor.js"
13 | ],
14 | "exclude": [
15 | "./src/**/*.spec.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "fabric:node",
9 | "request": "launch",
10 | "name": "Debug Smart Contract",
11 | "preLaunchTask": "tsc: build - tsconfig.json",
12 | "outFiles": [
13 | "${workspaceFolder}/dist/**/*.js"
14 | ]
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "error",
3 | "extends": [
4 | "tslint:recommended"
5 | ],
6 | "jsRules": {},
7 | "rules": {
8 | "indent": [true, "spaces", 4],
9 | "quotemark": [true, "single"],
10 | "semicolon": [true, "always"],
11 | "no-console": false,
12 | "curly": true,
13 | "triple-equals": true,
14 | "no-string-throw": true,
15 | "no-var-keyword": true,
16 | "no-trailing-whitespace": true,
17 | "object-literal-key-quotes": [true, "as-needed"],
18 | "max-line-length": false
19 | },
20 | "rulesDirectory": []
21 | }
22 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "error",
3 | "extends": [
4 | "tslint:recommended"
5 | ],
6 | "jsRules": {},
7 | "rules": {
8 | "indent": [true, "spaces", 4],
9 | "linebreak-style": [true, "LF"],
10 | "quotemark": [true, "single"],
11 | "semicolon": [true, "always"],
12 | "no-console": false,
13 | "curly": true,
14 | "triple-equals": true,
15 | "no-string-throw": true,
16 | "no-var-keyword": true,
17 | "no-trailing-whitespace": true,
18 | "object-literal-key-quotes": [true, "as-needed"]
19 | },
20 | "rulesDirectory": []
21 | }
22 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MyJavaContract
4 | Project java_ created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/basic-applications/java-app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.example.javaapp
4 | Project java-app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.build/makefile:
--------------------------------------------------------------------------------
1 | .PHONY: all
2 |
3 | ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
4 |
5 | all: basic-applications basic-contract
6 |
7 | digibank:
8 | cd ${ROOhoneT_DIR}/../organization/$@/application-java; mvn clean compile package
9 | cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
10 | cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
11 | cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint
12 |
13 | magnetocorp:
14 | cd ${ROOT_DIR}/../organization/$@/application-java; mvn clean compile package
15 | cd ${ROOT_DIR}/../organization/$@/contract-java; ./gradlew clean build shadowJar
16 | cd ${ROOT_DIR}/../organization/$@/application; npm install && npm run lint
17 | cd ${ROOT_DIR}/../organization/$@/contract; npm install && npm run lint
--------------------------------------------------------------------------------
/basic-applications/ts-app/.editorconfig:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed under the Apache License, Version 2.0 (the "License");
3 | # you may not use this file except in compliance with the License.
4 | # You may obtain a copy of the License at
5 | #
6 | # http://www.apache.org/licenses/LICENSE-2.0
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | # See the License for the specific language governing permissions and
12 | # limitations under the License.
13 | #
14 |
15 | root = true
16 |
17 | [*]
18 | indent_style = space
19 | indent_size = 4
20 | end_of_line = lf
21 | charset = utf-8
22 | trim_trailing_whitespace = true
23 | insert_final_newline = true
24 |
25 | [*.md]
26 | trim_trailing_whitespace = false
27 |
--------------------------------------------------------------------------------
/basic-network/connection.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | name: basic-network
3 | version: 1.0.0
4 | client:
5 | organization: Org1
6 | connection:
7 | timeout:
8 | peer:
9 | endorser: '300'
10 | orderer: '300'
11 | channels:
12 | mychannel:
13 | orderers:
14 | - orderer.example.com
15 | peers:
16 | peer0.org1.example.com: {}
17 | organizations:
18 | Org1:
19 | mspid: Org1MSP
20 | peers:
21 | - peer0.org1.example.com
22 | certificateAuthorities:
23 | - ca.example.com
24 | orderers:
25 | orderer.example.com:
26 | url: grpc://localhost:7050
27 | peers:
28 | peer0.org1.example.com:
29 | url: grpc://localhost:7051
30 | certificateAuthorities:
31 | ca.example.com:
32 | url: http://localhost:7054
33 | caName: ca.example.com
34 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/msp/admincerts/Admin@example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICCTCCAbCgAwIBAgIQVMXz1cejr3sGgDsXuIBK3zAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowVjELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI
8 | zj0DAQcDQgAEFufLmRXBZHc3d7HvYSU4jR4nJnzfmJlWN6Gm0Bm+NsO8lwb1TDa4
9 | cPzAOgnbIm1VFwhBd+sE3TIzIWsM2Kzv1aNNMEswDgYDVR0PAQH/BAQDAgeAMAwG
10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgoGBqSoYKHjHJCiN4jabztrdJJe0NIwYa
11 | 9ImUCbpGrmowCgYIKoZIzj0EAwIDRwAwRAIgId+xpuBHjfWvL8aAsDbmMjXAoOYy
12 | BgazcJh446kZaDACIDeyvsH5Xwes5w5Sksv7mb6/kr4ceCy00h1Vlt5bwPiu
13 | -----END CERTIFICATE-----
14 |
--------------------------------------------------------------------------------
/basic-applications/java-app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/basic-network/README.md:
--------------------------------------------------------------------------------
1 | NOTE _ THIS IS FORKED FROM THE HYPERLEDGER FABRIC_SAMPLES REPO
2 |
3 |
4 | ## Basic Network Config
5 |
6 | Note that this basic configuration uses pre-generated certificates and
7 | key material, and also has predefined transactions to initialize a
8 | channel named "mychannel".
9 |
10 | To regenerate this material, simply run ``generate.sh``.
11 |
12 | To start the network, run ``start.sh``.
13 | To stop it, run ``stop.sh``
14 | To completely remove all incriminating evidence of the network
15 | on your system, run ``teardown.sh``.
16 |
17 | 
This work is licensed under a Creative Commons Attribution 4.0 International License
18 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/ca/org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICFjCCAb2gAwIBAgIUNDCk4a9Z/oaid+BBpYAGT8A18f8wCgYIKoZIzj0EAwIw
3 | aDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRQwEgYDVQQK
4 | EwtIeXBlcmxlZGdlcjEPMA0GA1UECxMGRmFicmljMRkwFwYDVQQDExBmYWJyaWMt
5 | Y2Etc2VydmVyMB4XDTE3MDgzMTE1MzcwMFoXDTMyMDgyNzE1MzcwMFowaDELMAkG
6 | A1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRQwEgYDVQQKEwtIeXBl
7 | cmxlZGdlcjEPMA0GA1UECxMGRmFicmljMRkwFwYDVQQDExBmYWJyaWMtY2Etc2Vy
8 | dmVyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExzMhy+KdVYhr6sqA32pAKwM6
9 | DrPal71NXVNzF/Mdep2jlbhSMu73gwz+q4Hy+SoPnyuIYCpCy5rJhXwEnoQJvaNF
10 | MEMwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYE
11 | FNLXRcya9ZgImWIPbPPsrdTIDuPEMAoGCCqGSM49BAMCA0cAMEQCIGL9qKSaPG6U
12 | IMvw1zolTgimpIxwulGOuQeVybPwYI3oAiBCmOSz5PfASGh8VtCUCCwE+Ef1xQGI
13 | q6Zjh87nj/eyqQ==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/admincerts/Admin@example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICCTCCAbCgAwIBAgIQVMXz1cejr3sGgDsXuIBK3zAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowVjELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI
8 | zj0DAQcDQgAEFufLmRXBZHc3d7HvYSU4jR4nJnzfmJlWN6Gm0Bm+NsO8lwb1TDa4
9 | cPzAOgnbIm1VFwhBd+sE3TIzIWsM2Kzv1aNNMEswDgYDVR0PAQH/BAQDAgeAMAwG
10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgoGBqSoYKHjHJCiN4jabztrdJJe0NIwYa
11 | 9ImUCbpGrmowCgYIKoZIzj0EAwIDRwAwRAIgId+xpuBHjfWvL8aAsDbmMjXAoOYy
12 | BgazcJh446kZaDACIDeyvsH5Xwes5w5Sksv7mb6/kr4ceCy00h1Vlt5bwPiu
13 | -----END CERTIFICATE-----
14 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/signcerts/Admin@example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICCTCCAbCgAwIBAgIQVMXz1cejr3sGgDsXuIBK3zAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowVjELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI
8 | zj0DAQcDQgAEFufLmRXBZHc3d7HvYSU4jR4nJnzfmJlWN6Gm0Bm+NsO8lwb1TDa4
9 | cPzAOgnbIm1VFwhBd+sE3TIzIWsM2Kzv1aNNMEswDgYDVR0PAQH/BAQDAgeAMAwG
10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgoGBqSoYKHjHJCiN4jabztrdJJe0NIwYa
11 | 9ImUCbpGrmowCgYIKoZIzj0EAwIDRwAwRAIgId+xpuBHjfWvL8aAsDbmMjXAoOYy
12 | BgazcJh446kZaDACIDeyvsH5Xwes5w5Sksv7mb6/kr4ceCy00h1Vlt5bwPiu
13 | -----END CERTIFICATE-----
14 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts/Admin@example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICCTCCAbCgAwIBAgIQVMXz1cejr3sGgDsXuIBK3zAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowVjELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI
8 | zj0DAQcDQgAEFufLmRXBZHc3d7HvYSU4jR4nJnzfmJlWN6Gm0Bm+NsO8lwb1TDa4
9 | cPzAOgnbIm1VFwhBd+sE3TIzIWsM2Kzv1aNNMEswDgYDVR0PAQH/BAQDAgeAMAwG
10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgoGBqSoYKHjHJCiN4jabztrdJJe0NIwYa
11 | 9ImUCbpGrmowCgYIKoZIzj0EAwIDRwAwRAIgId+xpuBHjfWvL8aAsDbmMjXAoOYy
12 | BgazcJh446kZaDACIDeyvsH5Xwes5w5Sksv7mb6/kr4ceCy00h1Vlt5bwPiu
13 | -----END CERTIFICATE-----
14 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICDDCCAbOgAwIBAgIRAK30hdRcBxQJYNPqPkiFo3IwCgYIKoZIzj0EAwIwaTEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt
5 | cGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJaMFgxCzAJBgNV
6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
7 | c2NvMRwwGgYDVQQDExNvcmRlcmVyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYI
8 | KoZIzj0DAQcDQgAEUOJGzpasxjS5EJmbFIe/GtOJJAo6mhJqLyYT9PBvVSdaQ/TQ
9 | lMNlqLEZgFP6wc9CtrUp/WDnZ/M2zLpoDPjkcqNNMEswDgYDVR0PAQH/BAQDAgeA
10 | MAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgoGBqSoYKHjHJCiN4jabztrdJJe0N
11 | IwYa9ImUCbpGrmowCgYIKoZIzj0EAwIDRwAwRAIgHsU1f4jzuul6zYGY/Xn/H5X5
12 | gDe7/u8dZxJfWwXOGNsCICbXt6yezSzacOFQDkvAPz5/3OYI5YKLSTl+Wilfa/qy
13 | -----END CERTIFICATE-----
14 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGDCCAb+gAwIBAgIQFSxnLAGsu04zrFkAEwzn6zAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV1dfmKxsFKWo7o6DNBIaIVebCCPAM9C/
9 | sLBt4pJRre9pWE987DjXZoZ3glc4+DoPMtTmBRqbPVwYcUvpbYY8p6NNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDRwAwRAIgXMy26AEU
12 | /GUMPfCMs/nQjQME1ZxBHAYZtKEuRR361JsCIEg9BOZdIoioRivJC+ZUzvJUnkXu
13 | o2HkWiuxLsibGxtE
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICLjCCAdWgAwIBAgIQHuAANpa/kDL7CPyNttctRjAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowaTELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFtcGxlLmNv
8 | bTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIzTWKIWgOBOxN3budT5HXPthluo
9 | zghOXPXcyD5JBaxafbkgzr8jC3M2rlJJBm0nCmjv6C1LkiCAOftYkyLofLqjXzBd
10 | MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMB
11 | Af8wKQYDVR0OBCIEIKBgakqGCh4xyQojeI2m87a3SSXtDSMGGvSJlAm6Rq5qMAoG
12 | CCqGSM49BAMCA0cAMEQCIGShwWIKXmf3oJY3Oow7pKA0SSe89UsRLy2HMxxNzgWx
13 | AiB097hBfmM2JEZsEZfMbEM2U7edQIDyCoPOgm5ha9wDNw==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/msp/cacerts/ca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICLjCCAdWgAwIBAgIQHuAANpa/kDL7CPyNttctRjAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowaTELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFtcGxlLmNv
8 | bTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIzTWKIWgOBOxN3budT5HXPthluo
9 | zghOXPXcyD5JBaxafbkgzr8jC3M2rlJJBm0nCmjv6C1LkiCAOftYkyLofLqjXzBd
10 | MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMB
11 | Af8wKQYDVR0OBCIEIKBgakqGCh4xyQojeI2m87a3SSXtDSMGGvSJlAm6Rq5qMAoG
12 | CCqGSM49BAMCA0cAMEQCIGShwWIKXmf3oJY3Oow7pKA0SSe89UsRLy2HMxxNzgWx
13 | AiB097hBfmM2JEZsEZfMbEM2U7edQIDyCoPOgm5ha9wDNw==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICKzCCAdKgAwIBAgIQHYv3zMnbbON0eufj3s78FTAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowVjELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYI
8 | KoZIzj0DAQcDQgAEZsLfeA+tjHJJOyxhJOP31uDluC6eCnMBq0LKawBugaoI3vqh
9 | T8ux5ty+ooSJk7EN3pTQa10m0qX/Y7e0J79JL6NsMGowDgYDVR0PAQH/BAQDAgWg
10 | MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMCsG
11 | A1UdIwQkMCKAII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zCefunMAoGCCqG
12 | SM49BAMCA0cAMEQCIEcK5iAxpGN1wtC5w+590RJrLzD7DOzVCUIxAdJp80BUAiA/
13 | XMFE+lHMJmqeoqmXG14Z/70xmHChlyHxm6lFR2I6gw==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGDCCAb+gAwIBAgIQFSxnLAGsu04zrFkAEwzn6zAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV1dfmKxsFKWo7o6DNBIaIVebCCPAM9C/
9 | sLBt4pJRre9pWE987DjXZoZ3glc4+DoPMtTmBRqbPVwYcUvpbYY8p6NNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDRwAwRAIgXMy26AEU
12 | /GUMPfCMs/nQjQME1ZxBHAYZtKEuRR361JsCIEg9BOZdIoioRivJC+ZUzvJUnkXu
13 | o2HkWiuxLsibGxtE
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/signcerts/peer0.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGjCCAcCgAwIBAgIRAPlwF/rUZUP9mqN4wSml4iswCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAxMWcGVlcjAub3JnMS5leGFtcGxlLmNvbTBZ
8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABHihxW6ks3B2+5XdbAVq3CBgxRRRZ22x
9 | zzpqnD86nKkz7fBElBuhlXl2K6rTxyY2OBOB0ts8keqZ93xueRGymrajTTBLMA4G
10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIEI5qg3Ndtru
11 | uLoM2nAYUdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQD4j0Rn
12 | e1rrd0FSCzsR6u+IuuPK5dI/kR/bh7+VLf0TNgIgCfUtkJvfvzVEwZLFoFyjoHtr
13 | tvwzNUS1U0hEqIaDeo4=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGDCCAb+gAwIBAgIQFSxnLAGsu04zrFkAEwzn6zAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV1dfmKxsFKWo7o6DNBIaIVebCCPAM9C/
9 | sLBt4pJRre9pWE987DjXZoZ3glc4+DoPMtTmBRqbPVwYcUvpbYY8p6NNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDRwAwRAIgXMy26AEU
12 | /GUMPfCMs/nQjQME1ZxBHAYZtKEuRR361JsCIEg9BOZdIoioRivJC+ZUzvJUnkXu
13 | o2HkWiuxLsibGxtE
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGDCCAb+gAwIBAgIQFSxnLAGsu04zrFkAEwzn6zAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV1dfmKxsFKWo7o6DNBIaIVebCCPAM9C/
9 | sLBt4pJRre9pWE987DjXZoZ3glc4+DoPMtTmBRqbPVwYcUvpbYY8p6NNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDRwAwRAIgXMy26AEU
12 | /GUMPfCMs/nQjQME1ZxBHAYZtKEuRR361JsCIEg9BOZdIoioRivJC+ZUzvJUnkXu
13 | o2HkWiuxLsibGxtE
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGTCCAb+gAwIBAgIQPyhm+v0ZIqCo6MATzLc+5jAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZVc2VyMUBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL/SomNVO3R5nnsemQ4im/UUZ8Ixs7/nH
9 | 3NH1ROfVJ+m7niDf1ZmhvTyiJzrUpI+n5+/OKIX/Z/VhDuAIR/QLLKNNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDSAAwRQIhAJk63AHS
12 | CEvJh64Yx5CnWDgDYNoj0jsi+gGheIxbUYgMAiAi/qPG7KEuuDBL4LlZRfkeatMW
13 | ZKPD7ikt+vOYgVnqlA==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/msp/tlscacerts/tlsca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/admincerts/User1@org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICGTCCAb+gAwIBAgIQPyhm+v0ZIqCo6MATzLc+5jAKBggqhkjOPQQDAjBzMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0MzJa
6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZVc2VyMUBvcmcxLmV4YW1wbGUuY29tMFkw
8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL/SomNVO3R5nnsemQ4im/UUZ8Ixs7/nH
9 | 3NH1ROfVJ+m7niDf1ZmhvTyiJzrUpI+n5+/OKIX/Z/VhDuAIR/QLLKNNMEswDgYD
10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgQjmqDc122u64
11 | ugzacBhR0UUE0xqtGy3d26xqVzZeSXwwCgYIKoZIzj0EAwIDSAAwRQIhAJk63AHS
12 | CEvJh64Yx5CnWDgDYNoj0jsi+gGheIxbUYgMAiAi/qPG7KEuuDBL4LlZRfkeatMW
13 | ZKPD7ikt+vOYgVnqlA==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/cacerts/ca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICLjCCAdWgAwIBAgIQHuAANpa/kDL7CPyNttctRjAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowaTELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFtcGxlLmNv
8 | bTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIzTWKIWgOBOxN3budT5HXPthluo
9 | zghOXPXcyD5JBaxafbkgzr8jC3M2rlJJBm0nCmjv6C1LkiCAOftYkyLofLqjXzBd
10 | MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMB
11 | Af8wKQYDVR0OBCIEIKBgakqGCh4xyQojeI2m87a3SSXtDSMGGvSJlAm6Rq5qMAoG
12 | CCqGSM49BAMCA0cAMEQCIGShwWIKXmf3oJY3Oow7pKA0SSe89UsRLy2HMxxNzgWx
13 | AiB097hBfmM2JEZsEZfMbEM2U7edQIDyCoPOgm5ha9wDNw==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICOjCCAeGgAwIBAgIQZbszPe722f2AcfnwpG2ENDAKBggqhkjOPQQDAjB2MQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz
5 | Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0
6 | MzJaMFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
7 | Ew1TYW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29t
8 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5ZfQwNA0oBGCr7zX4I/Ufq1Ht740
9 | RnkV+6VBceaG4x45bR0a0ZWeslPzmIRXOir9QvqLvnxGY3aJiadX65kNFKNsMGow
10 | DgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAM
11 | BgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIO0/2COT6V/CxHWvwRPI0sWR90XRurxN
12 | bZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIF2V2t75M9bgjQ3pktVEYnCS4u0S
13 | Izw6ZNSy8q/i6C6cAiB4V0ejzQYtp5C25F2xMD+JSlwrhBAOJNK1AkTzj9mgWg==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICOzCCAeGgAwIBAgIQat+rcnuTNMrNDQULaEwq7zAKBggqhkjOPQQDAjB2MQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz
5 | Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0
6 | MzJaMFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
7 | Ew1TYW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZVc2VyMUBvcmcxLmV4YW1wbGUuY29t
8 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFcqqFuh5CXSij4Ma6/tySXB9hYZn
9 | 2oFaVJWPn0JIhqj8rl9vHuNzgwoI1ZNR9fKGmrovqaZjcSg87jxh7gZSeaNsMGow
10 | DgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAM
11 | BgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIO0/2COT6V/CxHWvwRPI0sWR90XRurxN
12 | bZzOChrMForLMAoGCCqGSM49BAMCA0gAMEUCIQCWp1joCFbOhXbZ2sPW1e6gJBNG
13 | ZK+JY6Lm0bGk4vBk6QIgLQ5nzPRWHJNRaqIbigk0OLBKQtzv/Nfbsi6DnhNQoZU=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICLjCCAdWgAwIBAgIQHuAANpa/kDL7CPyNttctRjAKBggqhkjOPQQDAjBpMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
5 | bGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowaTELMAkGA1UE
6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
7 | Y28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFtcGxlLmNv
8 | bTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIzTWKIWgOBOxN3budT5HXPthluo
9 | zghOXPXcyD5JBaxafbkgzr8jC3M2rlJJBm0nCmjv6C1LkiCAOftYkyLofLqjXzBd
10 | MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMB
11 | Af8wKQYDVR0OBCIEIKBgakqGCh4xyQojeI2m87a3SSXtDSMGGvSJlAm6Rq5qMAoG
12 | CCqGSM49BAMCA0cAMEQCIGShwWIKXmf3oJY3Oow7pKA0SSe89UsRLy2HMxxNzgWx
13 | AiB097hBfmM2JEZsEZfMbEM2U7edQIDyCoPOgm5ha9wDNw==
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICRDCCAeqgAwIBAgIRAIk/1HQ6XgI0p64PQwvUA3owCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UE
8 | AxMTY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
9 | BM0tgEje2ssj/AWFh/70ymdVvVH+8EWtu7/jcn5Hy7gTvewJzHSdF9gID50d/bZx
10 | 65KOreUxetqitV6/m2DgNzujXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG
11 | BgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIEI5qg3NdtruuLoM2nAY
12 | UdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQDufxsHbxkSP/y+
13 | oM2xZGgHL5XSTJVBqBryk1rd08Af6QIgLiAwtR7iKRbf1pKKCkt66MZzItZXC0po
14 | /45uf29T/sc=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/tlscacerts/tlsca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICNTCCAdugAwIBAgIQT0WLBisbcQ6AkirTJApb1TAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowbDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt
8 | cGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGtRFSyePgHhit2JfQNn
9 | Gbda3X9Y+Eb5Ft/4L9uLsxc4zEMLt2TJZewEfO/Uoe9YH9VhFmGj/d9M0d/0HSAn
10 | K8WjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB
11 | /wQFMAMBAf8wKQYDVR0OBCIEII0hhlVshdUV5zfQwNqNDXZyeFtoXLUDvLleU9zC
12 | efunMAoGCCqGSM49BAMCA0gAMEUCIQDxLfsMRqPJuoH77vahGkE6EYMqvzjVI2Ob
13 | aV1DZJfUdwIgHuHXPvKvcoYZgAo7Xc57Uqs6hSpMs0CjzcfLXYiwoVc=
14 | -----END CERTIFICATE-----
15 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICRDCCAeqgAwIBAgIRAIk/1HQ6XgI0p64PQwvUA3owCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UE
8 | AxMTY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
9 | BM0tgEje2ssj/AWFh/70ymdVvVH+8EWtu7/jcn5Hy7gTvewJzHSdF9gID50d/bZx
10 | 65KOreUxetqitV6/m2DgNzujXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG
11 | BgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIEI5qg3NdtruuLoM2nAY
12 | UdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQDufxsHbxkSP/y+
13 | oM2xZGgHL5XSTJVBqBryk1rd08Af6QIgLiAwtR7iKRbf1pKKCkt66MZzItZXC0po
14 | /45uf29T/sc=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICWTCCAf+gAwIBAgIQLwiilHvhB1gOg5eGs5O9YDAKBggqhkjOPQQDAjBsMQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4
5 | YW1wbGUuY29tMB4XDTE3MDgzMTA5MTQzMloXDTI3MDgyOTA5MTQzMlowWDELMAkG
6 | A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu
7 | Y2lzY28xHDAaBgNVBAMTE29yZGVyZXIuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIB
8 | BggqhkjOPQMBBwNCAARYRRq90z+ioUM2U9OzPnvqvz9Jpza9JOEsG6UJyEzWB8R7
9 | bHr0XR1Dl8lodlLh3C5vTrb6vqtpNeVXVsd+VVyIo4GWMIGTMA4GA1UdDwEB/wQE
10 | AwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIw
11 | ADArBgNVHSMEJDAigCCNIYZVbIXVFec30MDajQ12cnhbaFy1A7y5XlPcwnn7pzAn
12 | BgNVHREEIDAeghNvcmRlcmVyLmV4YW1wbGUuY29tggdvcmRlcmVyMAoGCCqGSM49
13 | BAMCA0gAMEUCIQDwjzlscwNhuVcxF+FQy3PNwxsSRSOsQqjmFbMFNDSG6wIgfNO0
14 | Mp/QtUShzWepgh1nm8MmDNcnVOOeb4JJy6Gd3Ss=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICRDCCAeqgAwIBAgIRAIk/1HQ6XgI0p64PQwvUA3owCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UE
8 | AxMTY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
9 | BM0tgEje2ssj/AWFh/70ymdVvVH+8EWtu7/jcn5Hy7gTvewJzHSdF9gID50d/bZx
10 | 65KOreUxetqitV6/m2DgNzujXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG
11 | BgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIEI5qg3NdtruuLoM2nAY
12 | UdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQDufxsHbxkSP/y+
13 | oM2xZGgHL5XSTJVBqBryk1rd08Af6QIgLiAwtR7iKRbf1pKKCkt66MZzItZXC0po
14 | /45uf29T/sc=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICRDCCAeqgAwIBAgIRAIk/1HQ6XgI0p64PQwvUA3owCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UE
8 | AxMTY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
9 | BM0tgEje2ssj/AWFh/70ymdVvVH+8EWtu7/jcn5Hy7gTvewJzHSdF9gID50d/bZx
10 | 65KOreUxetqitV6/m2DgNzujXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG
11 | BgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIEI5qg3NdtruuLoM2nAY
12 | UdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQDufxsHbxkSP/y+
13 | oM2xZGgHL5XSTJVBqBryk1rd08Af6QIgLiAwtR7iKRbf1pKKCkt66MZzItZXC0po
14 | /45uf29T/sc=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICRDCCAeqgAwIBAgIRAIk/1HQ6XgI0p64PQwvUA3owCgYIKoZIzj0EAwIwczEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkxNDMy
6 | WjBzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
7 | U2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UE
8 | AxMTY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
9 | BM0tgEje2ssj/AWFh/70ymdVvVH+8EWtu7/jcn5Hy7gTvewJzHSdF9gID50d/bZx
10 | 65KOreUxetqitV6/m2DgNzujXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG
11 | BgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIEI5qg3NdtruuLoM2nAY
12 | UdFFBNMarRst3dusalc2Xkl8MAoGCCqGSM49BAMCA0gAMEUCIQDufxsHbxkSP/y+
13 | oM2xZGgHL5XSTJVBqBryk1rd08Af6QIgLiAwtR7iKRbf1pKKCkt66MZzItZXC0po
14 | /45uf29T/sc=
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICZjCCAg2gAwIBAgIQenbZk7+46tsIJy8JAgySaDAKBggqhkjOPQQDAjB2MQsw
3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz
5 | Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xNzA4MzEwOTE0MzJaFw0yNzA4MjkwOTE0
6 | MzJaMFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
7 | Ew1TYW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29t
8 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0AZOhWRZ4aOZeLSBioClHt5VDiNT
9 | CeIxn3rVw9oCzlDDMaIZrBG1lI4o2tXOgOGSIPBmRjy736Njc54InlHlsKOBlzCB
10 | lDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC
11 | MAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAg7T/YI5PpX8LEda/BE8jSxZH3RdG6
12 | vE1tnM4KGswWisswKAYDVR0RBCEwH4IWcGVlcjAub3JnMS5leGFtcGxlLmNvbYIF
13 | cGVlcjAwCgYIKoZIzj0EAwIDRwAwRAIgU9GgYioYa1Mdhhe5MHyZGXfr4G8gBxwe
14 | dqlWU/mGaPsCIGQpA0VoBrP3Neso3htfZnlWKcbrtCD29HBWmT7ImZT1
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-network/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICSTCCAfCgAwIBAgIRALOo7o5dtcd8yGpCqowtoIUwCgYIKoZIzj0EAwIwdjEL
3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs
5 | c2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwODMxMDkxNDMyWhcNMjcwODI5MDkx
6 | NDMyWjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE
7 | BxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G
8 | A1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
9 | AwEHA0IABAftdw28/JThHyrfF4SCTjHUykfeQZ3eqSwYlkCqYF1Lwzae18o97Biz
10 | doz/BBMjisAoJESyzVOrGj7nGD7EzwWjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV
11 | HSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIO0/2COT6V/C
12 | xHWvwRPI0sWR90XRurxNbZzOChrMForLMAoGCCqGSM49BAMCA0cAMEQCIGd4ZaLj
13 | 1R4C25obVTI/pWriqWlXXAV7h2ZQfD41nNMYAiAO858VYb4xyLUkF9XGtZJpux4x
14 | 0ClsWNgEp49nBBsecw==
15 | -----END CERTIFICATE-----
16 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/src/main/java/org/example/MyAsset.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | package org.example;
6 |
7 | import org.hyperledger.fabric.contract.annotation.Contract;
8 | import org.hyperledger.fabric.contract.annotation.DataType;
9 | import org.hyperledger.fabric.contract.annotation.Property;
10 | import org.json.JSONObject;
11 |
12 | @DataType()
13 | public class MyAsset {
14 |
15 | @Property()
16 | private String value;
17 |
18 | public MyAsset(){
19 | }
20 |
21 | public String getValue() {
22 | return value;
23 | }
24 |
25 | public void setValue(String value) {
26 | this.value = value;
27 | }
28 |
29 | public String toJSONString() {
30 | return new JSONObject(this).toString();
31 | }
32 |
33 | public static MyAsset fromJSONString(String json) {
34 | String value = new JSONObject(json).getString("value");
35 | MyAsset asset = new MyAsset();
36 | asset.setValue(value);
37 | return asset;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | module.exports = {
6 | env: {
7 | node: true,
8 | mocha: true
9 | },
10 | parserOptions: {
11 | ecmaVersion: 8,
12 | sourceType: 'script'
13 | },
14 | extends: "eslint:recommended",
15 | rules: {
16 | indent: ['error', 4],
17 | quotes: ['error', 'single'],
18 | semi: ['error', 'always'],
19 | 'no-unused-vars': ['error', { args: 'none' }],
20 | 'no-console': 'off',
21 | curly: 'error',
22 | eqeqeq: 'error',
23 | 'no-throw-literal': 'error',
24 | strict: 'error',
25 | 'no-var': 'error',
26 | 'dot-notation': 'error',
27 | 'no-tabs': 'error',
28 | 'no-trailing-spaces': 'error',
29 | 'no-use-before-define': 'error',
30 | 'no-useless-call': 'error',
31 | 'no-with': 'error',
32 | 'operator-linebreak': 'error',
33 | yoda: 'error',
34 | 'quote-props': ['error', 'as-needed']
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/src/util.ts:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | import { URL } from 'url';
6 |
7 |
8 | // Checks if URL is local
9 | export const isLocalhostURL = (url: string): boolean => {
10 | const parsedURL: URL = new URL(url);
11 | const localhosts: string[] = [
12 | 'localhost',
13 | '127.0.0.1',
14 | ];
15 | return localhosts.indexOf(parsedURL.hostname) !== -1;
16 | };
17 |
18 | // Used for determining whether to use discovery
19 | export const hasLocalhostURLs = (profile: any): boolean => {
20 | const urls: string[] = [];
21 | for (const nodeType of ['orderers', 'peers', 'certificateAuthorities']) {
22 | if (!profile[nodeType]) {
23 | continue;
24 | }
25 | const nodes: any = profile[nodeType];
26 | for (const nodeName in nodes) {
27 | if (!nodes[nodeName].url) {
28 | continue;
29 | }
30 | urls.push(nodes[nodeName].url);
31 | }
32 | }
33 | return urls.some((url: string) => this.isLocalhostURL(url));
34 | };
35 |
--------------------------------------------------------------------------------
/basic-network/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright IBM Corp All Rights Reserved
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 | # Exit on first error, print all commands.
8 | set -ev
9 |
10 | # don't rewrite paths for Windows Git Bash users
11 | export MSYS_NO_PATHCONV=1
12 |
13 | docker-compose -f docker-compose.yml down
14 |
15 | docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
16 | docker ps -a
17 |
18 | # wait for Hyperledger Fabric to start
19 | # incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=
20 | export FABRIC_START_TIMEOUT=10
21 | #echo ${FABRIC_START_TIMEOUT}
22 | sleep ${FABRIC_START_TIMEOUT}
23 |
24 | # Create the channel
25 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
26 | # Join peer0.org1.example.com to the channel.
27 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b mychannel.block
28 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.github.johnrengelman.shadow' version '2.0.3'
3 | id 'java'
4 | }
5 |
6 | version '0.0.1'
7 |
8 | sourceCompatibility = 1.8
9 |
10 | repositories {
11 | mavenLocal()
12 | mavenCentral()
13 | maven {
14 | url 'https://jitpack.io'
15 | }
16 | maven {
17 | url "https://nexus.hyperledger.org/content/repositories/snapshots/"
18 | }
19 |
20 | }
21 |
22 | dependencies {
23 | compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '1.4.2'
24 | compile group: 'org.json', name: 'json', version: '20180813'
25 | testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
26 | testImplementation 'org.assertj:assertj-core:3.11.1'
27 | testImplementation 'org.mockito:mockito-core:2.+'
28 | }
29 |
30 | shadowJar {
31 | baseName = 'chaincode'
32 | version = null
33 | classifier = null
34 |
35 | manifest {
36 | attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
37 | }
38 | }
39 |
40 | test {
41 | useJUnitPlatform()
42 | testLogging {
43 | events "passed", "skipped", "failed"
44 | }
45 | }
46 |
47 |
48 | tasks.withType(JavaCompile) {
49 | options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-parameters"
50 | }
51 |
--------------------------------------------------------------------------------
/basic-network/connection.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "basic-network",
3 | "version": "1.0.0",
4 | "client": {
5 | "organization": "Org1",
6 | "connection": {
7 | "timeout": {
8 | "peer": {
9 | "endorser": "300"
10 | },
11 | "orderer": "300"
12 | }
13 | }
14 | },
15 | "channels": {
16 | "mychannel": {
17 | "orderers": [
18 | "orderer.example.com"
19 | ],
20 | "peers": {
21 | "peer0.org1.example.com": {}
22 | }
23 | }
24 | },
25 | "organizations": {
26 | "Org1": {
27 | "mspid": "Org1MSP",
28 | "peers": [
29 | "peer0.org1.example.com"
30 | ],
31 | "certificateAuthorities": [
32 | "ca.example.com"
33 | ]
34 | }
35 | },
36 | "orderers": {
37 | "orderer.example.com": {
38 | "url": "grpc://localhost:7050"
39 | }
40 | },
41 | "peers": {
42 | "peer0.org1.example.com": {
43 | "url": "grpc://localhost:7051"
44 | }
45 | },
46 | "certificateAuthorities": {
47 | "ca.example.com": {
48 | "url": "http://localhost:7054",
49 | "caName": "ca.example.com"
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/basic-network/generate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright IBM Corp All Rights Reserved
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 | export PATH=$GOPATH/src/github.com/hyperledger/fabric/build/bin:${PWD}/../bin:${PWD}:$PATH
8 | export FABRIC_CFG_PATH=${PWD}
9 | CHANNEL_NAME=mychannel
10 |
11 | # remove previous crypto material and config transactions
12 | rm -fr config/*
13 | rm -fr crypto-config/*
14 |
15 | # generate crypto material
16 | cryptogen generate --config=./crypto-config.yaml
17 | if [ "$?" -ne 0 ]; then
18 | echo "Failed to generate crypto material..."
19 | exit 1
20 | fi
21 |
22 | # generate genesis block for orderer
23 | configtxgen -profile OneOrgOrdererGenesis -outputBlock ./config/genesis.block
24 | if [ "$?" -ne 0 ]; then
25 | echo "Failed to generate orderer genesis block..."
26 | exit 1
27 | fi
28 |
29 | # generate channel configuration transaction
30 | configtxgen -profile OneOrgChannel -outputCreateChannelTx ./config/channel.tx -channelID $CHANNEL_NAME
31 | if [ "$?" -ne 0 ]; then
32 | echo "Failed to generate channel configuration transaction..."
33 | exit 1
34 | fi
35 |
36 | # generate anchor peer transaction
37 | configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./config/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
38 | if [ "$?" -ne 0 ]; then
39 | echo "Failed to generate anchor peer update for Org1MSP..."
40 | exit 1
41 | fi
42 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MyJavaScriptContract",
3 | "version": "0.0.1",
4 | "description": "Basic JavaScript Contract",
5 | "main": "index.js",
6 | "engines": {
7 | "node": ">=8",
8 | "npm": ">=5"
9 | },
10 | "scripts": {
11 | "lint": "eslint .",
12 | "pretest": "npm run lint",
13 | "test": "nyc mocha --recursive",
14 | "start": "fabric-chaincode-node start"
15 | },
16 | "engineStrict": true,
17 | "author": "",
18 | "license": "Apache-2.0",
19 | "dependencies": {
20 | "fabric-contract-api": "1.4.2",
21 | "fabric-shim": "1.4.2"
22 | },
23 | "devDependencies": {
24 | "chai": "^4.2.0",
25 | "chai-as-promised": "^7.1.1",
26 | "eslint": "^5.9.0",
27 | "mocha": "^5.2.0",
28 | "nyc": "^14.0.0",
29 | "sinon": "^7.1.1",
30 | "sinon-chai": "^3.3.0",
31 | "winston": "^3.2.1"
32 | },
33 | "nyc": {
34 | "exclude": [
35 | ".eslintrc.js",
36 | "coverage/**",
37 | "test/**"
38 | ],
39 | "reporter": [
40 | "text-summary",
41 | "html"
42 | ],
43 | "all": true,
44 | "check-coverage": true,
45 | "statements": 100,
46 | "branches": 100,
47 | "functions": 100,
48 | "lines": 100
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/.gitignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | # Logs
6 | logs
7 | *.log
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 |
24 | # nyc test coverage
25 | .nyc_output
26 |
27 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28 | .grunt
29 |
30 | # Bower dependency directory (https://bower.io/)
31 | bower_components
32 |
33 | # node-waf configuration
34 | .lock-wscript
35 |
36 | # Compiled binary addons (https://nodejs.org/api/addons.html)
37 | build/Release
38 |
39 | # Dependency directories
40 | node_modules/
41 | jspm_packages/
42 |
43 | # TypeScript v1 declaration files
44 | typings/
45 |
46 | # Optional npm cache directory
47 | .npm
48 |
49 | # Optional eslint cache
50 | .eslintcache
51 |
52 | # Optional REPL history
53 | .node_repl_history
54 |
55 | # Output of 'npm pack'
56 | *.tgz
57 |
58 | # Yarn Integrity file
59 | .yarn-integrity
60 |
61 | # dotenv environment variables file
62 | .env
63 |
64 | # parcel-bundler cache (https://parceljs.org/)
65 | .cache
66 |
67 | # next.js build output
68 | .next
69 |
70 | # nuxt.js build output
71 | .nuxt
72 |
73 | # vuepress build output
74 | .vuepress/dist
75 |
76 | # Serverless directories
77 | .serverless
78 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/.gitignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | # Logs
6 | logs
7 | *.log
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 |
24 | # nyc test coverage
25 | .nyc_output
26 |
27 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28 | .grunt
29 |
30 | # Bower dependency directory (https://bower.io/)
31 | bower_components
32 |
33 | # node-waf configuration
34 | .lock-wscript
35 |
36 | # Compiled binary addons (https://nodejs.org/api/addons.html)
37 | build/Release
38 |
39 | # Dependency directories
40 | node_modules/
41 | jspm_packages/
42 |
43 | # TypeScript v1 declaration files
44 | typings/
45 |
46 | # Optional npm cache directory
47 | .npm
48 |
49 | # Optional eslint cache
50 | .eslintcache
51 |
52 | # Optional REPL history
53 | .node_repl_history
54 |
55 | # Output of 'npm pack'
56 | *.tgz
57 |
58 | # Yarn Integrity file
59 | .yarn-integrity
60 |
61 | # dotenv environment variables file
62 | .env
63 |
64 | # parcel-bundler cache (https://parceljs.org/)
65 | .cache
66 |
67 | # next.js build output
68 | .next
69 |
70 | # nuxt.js build output
71 | .nuxt
72 |
73 | # vuepress build output
74 | .vuepress/dist
75 |
76 | # Serverless directories
77 | .serverless
78 |
79 | # Compiled TypeScript files
80 | dist
81 |
82 |
--------------------------------------------------------------------------------
/basic-applications/java-app/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by the Gradle 'init' task.
3 | *
4 | * This generated file contains a sample Java project to get you started.
5 | * For more details take a look at the Java Quickstart chapter in the Gradle
6 | * user guide available at https://docs.gradle.org/5.1.1/userguide/tutorial_java_projects.html
7 | */
8 |
9 | plugins {
10 | // Apply the java plugin to add support for Java
11 | id 'java'
12 |
13 | // Apply the application plugin to add support for building an application
14 | id 'application'
15 | }
16 |
17 | repositories {
18 | // Use jcenter for resolving your dependencies.
19 | // You can declare any Maven/Ivy/file repository here.
20 | jcenter()
21 | mavenLocal()
22 | maven { url 'https://jitpack.io' }
23 | maven {
24 | url 'https://nexus.hyperledger.org/content/repositories/snapshots/'
25 | }
26 |
27 | maven {
28 | url 'https://oss.sonatype.org/content/repositories/snapshots/'
29 | }
30 |
31 | }
32 |
33 | sourceSets {
34 | main {
35 | resources {
36 | srcDirs 'src/main/java'
37 | exclude '**/*.java'
38 | }
39 | }
40 | }
41 |
42 | dependencies {
43 | // This dependency is found on compile classpath of this component and consumers.
44 | implementation 'com.google.guava:guava:26.0-jre'
45 |
46 | // Use JUnit test framework
47 | testImplementation 'junit:junit:4.12'
48 |
49 | implementation 'org.hyperledger.fabric-gateway-java:fabric-gateway-java:1.4.0-SNAPSHOT'
50 |
51 | // implementation 'com.github.everit-org.json-schema:org.everit.json.schema:1.9.0'
52 | }
53 |
54 | // Define the main class for the application
55 | mainClassName = 'org.example.App'
56 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "typescript",
3 | "version": "0.0.3",
4 | "description": "",
5 | "main": "dist/index.js",
6 | "typings": "dist/index.d.ts",
7 | "engines": {
8 | "node": ">=8",
9 | "npm": ">=5"
10 | },
11 | "scripts": {
12 | "lint": "tslint -c tslint.json 'src/**/*.ts'",
13 | "pretest": "npm run lint",
14 | "test": "nyc mocha -r ts-node/register src/**/*.spec.ts",
15 | "start": "node dist/application.js",
16 | "build": "tsc",
17 | "build:watch": "tsc -w",
18 | "prepublishOnly": "npm run build"
19 | },
20 | "engineStrict": true,
21 | "author": "",
22 | "license": "",
23 | "dependencies": {
24 | "@types/js-yaml": "^3.11.2",
25 | "fabric-ca-client": "^1.4.1",
26 | "fabric-client": "^1.4.1",
27 | "fabric-network": "^1.4.1",
28 | "js-yaml": "^3.13.1",
29 | "jsome": "^2.5.0"
30 | },
31 | "devDependencies": {
32 | "@types/chai": "^4.1.4",
33 | "@types/mocha": "^5.2.3",
34 | "@types/node": "^10.3.6",
35 | "@types/sinon": "^5.0.1",
36 | "@types/sinon-chai": "^3.2.0",
37 | "chai": "^4.1.2",
38 | "mocha": "^5.2.0",
39 | "nyc": "^12.0.2",
40 | "sinon": "^6.0.0",
41 | "sinon-chai": "^3.2.0",
42 | "ts-node": "^7.0.0",
43 | "tslint": "^5.10.0",
44 | "typescript": "latest"
45 | },
46 | "nyc": {
47 | "extension": [
48 | ".ts",
49 | ".tsx"
50 | ],
51 | "exclude": [
52 | "coverage/**",
53 | "dist/**"
54 | ],
55 | "reporter": [
56 | "text-summary",
57 | "html"
58 | ],
59 | "all": true,
60 | "check-coverage": true,
61 | "statements": 100,
62 | "branches": 100,
63 | "functions": 100,
64 | "lines": 100
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/lib/my-asset-contract.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const { Contract } = require('fabric-contract-api');
8 |
9 | class MyAssetContract extends Contract {
10 |
11 | async myAssetExists(ctx, myAssetId) {
12 | const buffer = await ctx.stub.getState(myAssetId);
13 | return (!!buffer && buffer.length > 0);
14 | }
15 |
16 | async createMyAsset(ctx, myAssetId, value) {
17 | const exists = await this.myAssetExists(ctx, myAssetId);
18 | if (exists) {
19 | throw new Error(`The my asset ${myAssetId} already exists`);
20 | }
21 | const asset = { value };
22 | const buffer = Buffer.from(JSON.stringify(asset));
23 | await ctx.stub.putState(myAssetId, buffer);
24 | }
25 |
26 | async readMyAsset(ctx, myAssetId) {
27 | const exists = await this.myAssetExists(ctx, myAssetId);
28 | if (!exists) {
29 | throw new Error(`The my asset ${myAssetId} does not exist`);
30 | }
31 | const buffer = await ctx.stub.getState(myAssetId);
32 | const asset = JSON.parse(buffer.toString());
33 | return asset;
34 | }
35 |
36 | async updateMyAsset(ctx, myAssetId, newValue) {
37 | const exists = await this.myAssetExists(ctx, myAssetId);
38 | if (!exists) {
39 | throw new Error(`The my asset ${myAssetId} does not exist`);
40 | }
41 | const asset = { value: newValue };
42 | const buffer = Buffer.from(JSON.stringify(asset));
43 | await ctx.stub.putState(myAssetId, buffer);
44 | }
45 |
46 | async deleteMyAsset(ctx, myAssetId) {
47 | const exists = await this.myAssetExists(ctx, myAssetId);
48 | if (!exists) {
49 | throw new Error(`The my asset ${myAssetId} does not exist`);
50 | }
51 | await ctx.stub.deleteState(myAssetId);
52 | }
53 |
54 | }
55 |
56 | module.exports = MyAssetContract;
57 |
--------------------------------------------------------------------------------
/basic-contract/ts-contract/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MyTypeScriptContract",
3 | "version": "0.0.1",
4 | "description": "Basic TypeScript Smart Contract",
5 | "main": "dist/index.js",
6 | "typings": "dist/index.d.ts",
7 | "engines": {
8 | "node": ">=8",
9 | "npm": ">=5"
10 | },
11 | "scripts": {
12 | "lint": "tslint -c tslint.json 'src/**/*.ts'",
13 | "pretest": "npm run lint",
14 | "test": "nyc mocha -r ts-node/register src/**/*.spec.ts",
15 | "start": "fabric-chaincode-node start",
16 | "build": "tsc",
17 | "build:watch": "tsc -w",
18 | "prepublishOnly": "npm run build"
19 | },
20 | "engineStrict": true,
21 | "author": "",
22 | "license": "Apache-2.0",
23 | "dependencies": {
24 | "fabric-contract-api": "1.4.2",
25 | "fabric-shim": "1.4.2"
26 | },
27 | "devDependencies": {
28 | "@types/chai": "^4.1.7",
29 | "@types/chai-as-promised": "^7.1.0",
30 | "@types/mocha": "^5.2.5",
31 | "@types/node": "^10.12.10",
32 | "@types/sinon": "^5.0.7",
33 | "@types/sinon-chai": "^3.2.1",
34 | "chai": "^4.2.0",
35 | "chai-as-promised": "^7.1.1",
36 | "mocha": "^5.2.0",
37 | "nyc": "^14.0.0",
38 | "sinon": "^7.1.1",
39 | "sinon-chai": "^3.3.0",
40 | "winston": "^3.2.1",
41 | "ts-node": "^7.0.1",
42 | "tslint": "^5.11.0",
43 | "typescript": "^3.1.6"
44 | },
45 | "nyc": {
46 | "extension": [
47 | ".ts",
48 | ".tsx"
49 | ],
50 | "exclude": [
51 | "coverage/**",
52 | "dist/**"
53 | ],
54 | "reporter": [
55 | "text-summary",
56 | "html"
57 | ],
58 | "all": true,
59 | "check-coverage": true,
60 | "statements": 100,
61 | "branches": 100,
62 | "functions": 100,
63 | "lines": 100
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/basic-applications/java-app/src/main/java/org/example/App.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import java.nio.file.Path;
4 | import java.nio.file.Paths;
5 |
6 | import org.hyperledger.fabric.gateway.Contract;
7 | import org.hyperledger.fabric.gateway.Gateway;
8 | import org.hyperledger.fabric.gateway.Network;
9 | import org.hyperledger.fabric.gateway.Wallet;
10 |
11 | public interface App {
12 | static void main(String[] args) throws Exception {
13 |
14 | String rootDir = "./_cfg";
15 | System.out.println("+++ Running with root dir "+ Paths.get(rootDir).toAbsolutePath());
16 | // Create a new file system based wallet for managing identities.
17 | Path walletPath = Paths.get(rootDir,"local_fabric_wallet");
18 | Wallet wallet = Wallet.createFileSystemWallet(walletPath);
19 |
20 | // load a CCP
21 | Path networkConfigPath = Paths.get(rootDir,"local_fabric_connection.json");
22 | System.out.println("+++ Using: "+networkConfigPath.toAbsolutePath());
23 | System.out.println(" : "+walletPath.toAbsolutePath());
24 |
25 |
26 | System.out.println("+++ Creating a Builder");
27 | Gateway.Builder builder = Gateway.createBuilder();
28 | builder.discovery(true);
29 | builder.identity(wallet, "admin").networkConfig(networkConfigPath);
30 |
31 | System.out.println("+++ Connecting");
32 | // create a gateway connection
33 | try (Gateway gateway = builder.connect()) {
34 |
35 | System.out.println( gateway.getIdentity().getMspId());
36 |
37 | // get the network and contract
38 | System.out.println("+++ Getting network");
39 | Network network = gateway.getNetwork("mychannel");
40 | System.out.println("+++ Getting contract");
41 | Contract contract = network.getContract("BasicContract");
42 |
43 | byte[] result = contract.evaluateTransaction("readMyAsset", "001");
44 | System.out.println(new String(result));
45 |
46 | } catch (Exception ex) {
47 | ex.printStackTrace();
48 | }
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/basic-applications/ts-app/.npmignore:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed under the Apache License, Version 2.0 (the "License");
3 | # you may not use this file except in compliance with the License.
4 | # You may obtain a copy of the License at
5 | #
6 | # http://www.apache.org/licenses/LICENSE-2.0
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | # See the License for the specific language governing permissions and
12 | # limitations under the License.
13 | #
14 |
15 | # Logs
16 | logs
17 | *.log
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # Coverage directory used by tools like istanbul
32 | coverage
33 |
34 | # nyc test coverage
35 | .nyc_output
36 |
37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38 | .grunt
39 |
40 | # Bower dependency directory (https://bower.io/)
41 | bower_components
42 |
43 | # node-waf configuration
44 | .lock-wscript
45 |
46 | # Compiled binary addons (https://nodejs.org/api/addons.html)
47 | build/Release
48 |
49 | # Dependency directories
50 | node_modules/
51 | jspm_packages/
52 |
53 | # TypeScript v1 declaration files
54 | typings/
55 |
56 | # Optional npm cache directory
57 | .npm
58 |
59 | # Optional eslint cache
60 | .eslintcache
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 |
74 | # parcel-bundler cache (https://parceljs.org/)
75 | .cache
76 |
77 | # next.js build output
78 | .next
79 |
80 | # nuxt.js build output
81 | .nuxt
82 |
83 | # vuepress build output
84 | .vuepress/dist
85 |
86 | # Serverless directories
87 | .serverless
88 |
89 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/.gitignore:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed under the Apache License, Version 2.0 (the "License");
3 | # you may not use this file except in compliance with the License.
4 | # You may obtain a copy of the License at
5 | #
6 | # http://www.apache.org/licenses/LICENSE-2.0
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | # See the License for the specific language governing permissions and
12 | # limitations under the License.
13 | #
14 |
15 | # Logs
16 | logs
17 | *.log
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # Coverage directory used by tools like istanbul
32 | coverage
33 |
34 | # nyc test coverage
35 | .nyc_output
36 |
37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38 | .grunt
39 |
40 | # Bower dependency directory (https://bower.io/)
41 | bower_components
42 |
43 | # node-waf configuration
44 | .lock-wscript
45 |
46 | # Compiled binary addons (https://nodejs.org/api/addons.html)
47 | build/Release
48 |
49 | # Dependency directories
50 | node_modules/
51 | jspm_packages/
52 |
53 | # TypeScript v1 declaration files
54 | typings/
55 |
56 | # Optional npm cache directory
57 | .npm
58 |
59 | # Optional eslint cache
60 | .eslintcache
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 |
74 | # parcel-bundler cache (https://parceljs.org/)
75 | .cache
76 |
77 | # next.js build output
78 | .next
79 |
80 | # nuxt.js build output
81 | .nuxt
82 |
83 | # vuepress build output
84 | .vuepress/dist
85 |
86 | # Serverless directories
87 | .serverless
88 |
89 | # Compiled TypeScript files
90 | dist
91 |
92 | _cfg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 |
26 | # Logs
27 | logs
28 | *.log
29 | npm-debug.log*
30 | yarn-debug.log*
31 | yarn-error.log*
32 | lerna-debug.log*
33 |
34 | # Diagnostic reports (https://nodejs.org/api/report.html)
35 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
36 |
37 | # Runtime data
38 | pids
39 | *.pid
40 | *.seed
41 | *.pid.lock
42 |
43 | # Directory for instrumented libs generated by jscoverage/JSCover
44 | lib-cov
45 |
46 | # Coverage directory used by tools like istanbul
47 | coverage
48 | *.lcov
49 |
50 | # nyc test coverage
51 | .nyc_output
52 |
53 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
54 | .grunt
55 |
56 | # Bower dependency directory (https://bower.io/)
57 | bower_components
58 |
59 | # node-waf configuration
60 | .lock-wscript
61 |
62 | # Compiled binary addons (https://nodejs.org/api/addons.html)
63 | build/Release
64 |
65 | # Dependency directories
66 | node_modules/
67 | jspm_packages/
68 |
69 | # TypeScript v1 declaration files
70 | typings/
71 |
72 | # TypeScript cache
73 | *.tsbuildinfo
74 |
75 | # Optional npm cache directory
76 | .npm
77 |
78 | # Optional eslint cache
79 | .eslintcache
80 |
81 | # Optional REPL history
82 | .node_repl_history
83 |
84 | # Output of 'npm pack'
85 | *.tgz
86 |
87 | # Yarn Integrity file
88 | .yarn-integrity
89 |
90 | # dotenv environment variables file
91 | .env
92 | .env.test
93 |
94 | # parcel-bundler cache (https://parceljs.org/)
95 | .cache
96 |
97 | # next.js build output
98 | .next
99 |
100 | # nuxt.js build output
101 | .nuxt
102 |
103 | # vuepress build output
104 | .vuepress/dist
105 |
106 | # Serverless directories
107 | .serverless/
108 |
109 | # FuseBox cache
110 | .fusebox/
111 |
112 | # DynamoDB Local files
113 | .dynamodb/
--------------------------------------------------------------------------------
/basic-contract/ts-contract/src/my-asset-contract.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | import { Context, Contract, Info, Returns, Transaction } from 'fabric-contract-api';
6 | import { MyAsset } from './my-asset';
7 |
8 | @Info({title: 'MyAssetContract', description: 'Basic TypeScript Smart Contract' })
9 | export class MyAssetContract extends Contract {
10 |
11 | @Transaction(false)
12 | @Returns('boolean')
13 | public async myAssetExists(ctx: Context, myAssetId: string): Promise {
14 | const buffer = await ctx.stub.getState(myAssetId);
15 | return (!!buffer && buffer.length > 0);
16 | }
17 |
18 | @Transaction()
19 | public async createMyAsset(ctx: Context, myAssetId: string, value: string): Promise {
20 | const exists = await this.myAssetExists(ctx, myAssetId);
21 | if (exists) {
22 | throw new Error(`The my asset ${myAssetId} already exists`);
23 | }
24 | const myAsset = new MyAsset();
25 | myAsset.value = value;
26 | const buffer = Buffer.from(JSON.stringify(myAsset));
27 | await ctx.stub.putState(myAssetId, buffer);
28 | }
29 |
30 | @Transaction(false)
31 | @Returns('MyAsset')
32 | public async readMyAsset(ctx: Context, myAssetId: string): Promise {
33 | const exists = await this.myAssetExists(ctx, myAssetId);
34 | if (!exists) {
35 | throw new Error(`The my asset ${myAssetId} does not exist`);
36 | }
37 | const buffer = await ctx.stub.getState(myAssetId);
38 | const myAsset = JSON.parse(buffer.toString()) as MyAsset;
39 | return myAsset;
40 | }
41 |
42 | @Transaction()
43 | public async updateMyAsset(ctx: Context, myAssetId: string, newValue: string): Promise {
44 | const exists = await this.myAssetExists(ctx, myAssetId);
45 | if (!exists) {
46 | throw new Error(`The my asset ${myAssetId} does not exist`);
47 | }
48 | const myAsset = new MyAsset();
49 | myAsset.value = newValue;
50 | const buffer = Buffer.from(JSON.stringify(myAsset));
51 | await ctx.stub.putState(myAssetId, buffer);
52 | }
53 |
54 | @Transaction()
55 | public async deleteMyAsset(ctx: Context, myAssetId: string): Promise {
56 | const exists = await this.myAssetExists(ctx, myAssetId);
57 | if (!exists) {
58 | throw new Error(`The my asset ${myAssetId} does not exist`);
59 | }
60 | await ctx.stub.deleteState(myAssetId);
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/basic-applications/java-app/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/basic-applications/ts-app/src/application.ts:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | // Bring key classes into scope, most importantly Fabric SDK network class
8 | import { FileSystemWallet, Gateway } from 'fabric-network';
9 | import * as fs from 'fs';
10 | import * as path from 'path';
11 | import { hasLocalhostURLs } from './util';
12 |
13 | const root = path.resolve(__dirname, '../_cfg');
14 |
15 | // A wallet stores a collection of identities for use
16 | const wallet = new FileSystemWallet(path.join(root, 'local_fabric_wallet'));
17 | const gatewayConnectionProfileFile = path.join(root, 'local_fabric_connection.json');
18 |
19 | async function main() {
20 |
21 | // A gateway defines the peers used to access Fabric networks
22 | const gateway = new Gateway();
23 |
24 | // Main try/catch block
25 | try {
26 |
27 | // define the identity to use
28 | const identityLabel = 'admin';
29 |
30 | // Load connection profile; will be used to locate a gateway
31 | const gatewayprofile = JSON.parse(fs.readFileSync(gatewayConnectionProfileFile, 'utf8'));
32 |
33 | // Set connection options; use 'admin' identity from application wallet
34 | const connectionOptions = {
35 | discovery: {
36 | asLocalhost: hasLocalhostURLs(gatewayprofile),
37 | enabled: true,
38 | },
39 | identity:identityLabel,
40 | wallet,
41 | };
42 |
43 | // Connect to gateway using application specified parameters
44 | await gateway.connect(gatewayprofile, connectionOptions);
45 |
46 | console.log('Connected to Fabric gateway.');
47 |
48 | // Get addressability to PaperNet network
49 | const network = await gateway.getNetwork('mychannel');
50 |
51 | // Get addressability to commercial paper contract
52 | const contract = await network.getContract('MyTypeScriptContract');
53 |
54 | // read the asset that under id 001 (if it's there...)
55 | let response = await contract.evaluateTransaction('readMyAsset', '001');
56 | console.log(`readMyAsset: ${response.toString('utf8')}`);
57 |
58 | response = await contract.submitTransaction('updateMyAsset','001','A valuable asset');
59 | console.log(`updateMyAsset: ${response.toString('utf8')}`);
60 |
61 | response = await contract.evaluateTransaction('readMyAsset', '001');
62 | console.log(`readMyAsset: ${response.toString('utf8')}`);
63 |
64 | } catch (error) {
65 | console.log(`Error processing transaction. ${error}`);
66 | console.log(error.stack);
67 | } finally {
68 | // Disconnect from the gateway
69 | console.log('\nDisconnect from Fabric gateway.');
70 | gateway.disconnect();
71 | }
72 | }
73 |
74 | // invoke the main function, can catch any error that might escape
75 | main().then(() => {
76 | console.log('\n...done');
77 | }).catch((e) => {
78 | process.exit(-1);
79 | });
80 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/src/main/java/org/example/MyAssetContract.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 | package org.example;
5 |
6 | import org.hyperledger.fabric.contract.Context;
7 | import org.hyperledger.fabric.contract.ContractInterface;
8 | import org.hyperledger.fabric.contract.annotation.Contract;
9 | import org.hyperledger.fabric.contract.annotation.Default;
10 | import org.hyperledger.fabric.contract.annotation.Transaction;
11 |
12 | import org.hyperledger.fabric.contract.annotation.Contact;
13 | import org.hyperledger.fabric.contract.annotation.Info;
14 | import org.hyperledger.fabric.contract.annotation.License;
15 | import static java.nio.charset.StandardCharsets.UTF_8;
16 |
17 | @Contract(name = "MyAssetContract",
18 | info = @Info(title = "MyAsset contract",
19 | description = "Basic Java Smart Contract",
20 | version = "0.0.1",
21 | license =
22 | @License(name = "SPDX-License-Identifier: Apache-2.0",
23 | url = ""),
24 | contact = @Contact(email = "MyJavaContract@example.com",
25 | name = "MyJavaContract",
26 | url = "http://MyJavaContract.me")))
27 | @Default
28 | public class MyAssetContract implements ContractInterface {
29 | public MyAssetContract() {
30 |
31 | }
32 | @Transaction()
33 | public boolean myAssetExists(Context ctx, String myAssetId) {
34 | byte[] buffer = ctx.getStub().getState(myAssetId);
35 | return (buffer != null && buffer.length > 0);
36 | }
37 |
38 | @Transaction()
39 | public void createMyAsset(Context ctx, String myAssetId, String value) {
40 | boolean exists = myAssetExists(ctx,myAssetId);
41 | if (exists) {
42 | throw new RuntimeException("The asset "+myAssetId+" already exists");
43 | }
44 | MyAsset asset = new MyAsset();
45 | asset.setValue(value);
46 | ctx.getStub().putState(myAssetId, asset.toJSONString().getBytes(UTF_8));
47 | }
48 |
49 | @Transaction()
50 | public MyAsset readMyAsset(Context ctx, String myAssetId) {
51 | boolean exists = myAssetExists(ctx,myAssetId);
52 | if (!exists) {
53 | throw new RuntimeException("The asset "+myAssetId+" does not exist");
54 | }
55 |
56 | MyAsset newAsset = MyAsset.fromJSONString(new String(ctx.getStub().getState(myAssetId),UTF_8));
57 | return newAsset;
58 | }
59 |
60 | @Transaction()
61 | public void updateMyAsset(Context ctx, String myAssetId, String newValue) {
62 | boolean exists = myAssetExists(ctx,myAssetId);
63 | if (!exists) {
64 | throw new RuntimeException("The asset "+myAssetId+" does not exist");
65 | }
66 | MyAsset asset = new MyAsset();
67 | asset.setValue(newValue);
68 |
69 | ctx.getStub().putState(myAssetId, asset.toJSONString().getBytes(UTF_8));
70 | }
71 |
72 | @Transaction()
73 | public void deleteMyAsset(Context ctx, String myAssetId) {
74 | boolean exists = myAssetExists(ctx,myAssetId);
75 | if (!exists) {
76 | throw new RuntimeException("The asset "+myAssetId+" does not exist");
77 | }
78 | ctx.getStub().delState(myAssetId);
79 | }
80 |
81 | }
--------------------------------------------------------------------------------
/basic-network/crypto-config.yaml:
--------------------------------------------------------------------------------
1 | # Copyright IBM Corp. All Rights Reserved.
2 | #
3 | # SPDX-License-Identifier: Apache-2.0
4 | #
5 |
6 | # ---------------------------------------------------------------------------
7 | # "OrdererOrgs" - Definition of organizations managing orderer nodes
8 | # ---------------------------------------------------------------------------
9 | OrdererOrgs:
10 | # ---------------------------------------------------------------------------
11 | # Orderer
12 | # ---------------------------------------------------------------------------
13 | - Name: Orderer
14 | Domain: example.com
15 | # ---------------------------------------------------------------------------
16 | # "Specs" - See PeerOrgs below for complete description
17 | # ---------------------------------------------------------------------------
18 | Specs:
19 | - Hostname: orderer
20 | # ---------------------------------------------------------------------------
21 | # "PeerOrgs" - Definition of organizations managing peer nodes
22 | # ---------------------------------------------------------------------------
23 | PeerOrgs:
24 | # ---------------------------------------------------------------------------
25 | # Org1
26 | # ---------------------------------------------------------------------------
27 | - Name: Org1
28 | Domain: org1.example.com
29 | # ---------------------------------------------------------------------------
30 | # "Specs"
31 | # ---------------------------------------------------------------------------
32 | # Uncomment this section to enable the explicit definition of hosts in your
33 | # configuration. Most users will want to use Template, below
34 | #
35 | # Specs is an array of Spec entries. Each Spec entry consists of two fields:
36 | # - Hostname: (Required) The desired hostname, sans the domain.
37 | # - CommonName: (Optional) Specifies the template or explicit override for
38 | # the CN. By default, this is the template:
39 | #
40 | # "{{.Hostname}}.{{.Domain}}"
41 | #
42 | # which obtains its values from the Spec.Hostname and
43 | # Org.Domain, respectively.
44 | # ---------------------------------------------------------------------------
45 | # Specs:
46 | # - Hostname: foo # implicitly "foo.org1.example.com"
47 | # CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above
48 | # - Hostname: bar
49 | # - Hostname: baz
50 | # ---------------------------------------------------------------------------
51 | # "Template"
52 | # ---------------------------------------------------------------------------
53 | # Allows for the definition of 1 or more hosts that are created sequentially
54 | # from a template. By default, this looks like "peer%d" from 0 to Count-1.
55 | # You may override the number of nodes (Count), the starting index (Start)
56 | # or the template used to construct the name (Hostname).
57 | #
58 | # Note: Template and Specs are not mutually exclusive. You may define both
59 | # sections and the aggregate nodes will be created for you. Take care with
60 | # name collisions
61 | # ---------------------------------------------------------------------------
62 | Template:
63 | Count: 1
64 | # Start: 5
65 | # Hostname: {{.Prefix}}{{.Index}} # default
66 | # ---------------------------------------------------------------------------
67 | # "Users"
68 | # ---------------------------------------------------------------------------
69 | # Count: The number of user accounts _in addition_ to Admin
70 | # ---------------------------------------------------------------------------
71 | Users:
72 | Count: 1
73 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Hackathon Starter
2 |
3 | This repo contains a number of starter applications and smart contracts to help you get started quickly.
4 |
5 | ## Step 0: Have a development environment
6 |
7 | You'll need a development environment; Ubuntu or CentOS are good choices; especially if you can run them in VMs.
8 |
9 | - One option is to use vagrant to setup your own VM - [use this example](https://github.com/hyperledgendary/fabric-devenv) from [@jtonline](https://twitter.com/jtonline)
10 | - If you have a CentOS or Ubuntu system - here some scripts that show the fastest way to get setup
11 | - [Ubuntu](https://gist.github.com/mbwhite/9d0ff3c3f35e8bc9a33d32bd6899f11b)
12 | - [CentOS](https://gist.github.com/mbwhite/0cc46aba41569551a214827f89895eeb)
13 |
14 | ## Step 1: Install VSCode
15 |
16 | Get the following extensions depending on your preference of langauge
17 |
18 | - [Java Language support](https://marketplace.visualstudio.com/items?itemName=redhat.java)
19 | - [Java Debugger](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug)
20 | - [TSLint](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin)
21 | - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
22 |
23 | And the essential
24 | - [Blockchain Extension](https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform)
25 |
26 | `code --install-extension ibmblockchain.ibm-blockchain-platform`
27 |
28 | ## Step 2: Clone this repo
29 |
30 | Clone this repo using git
31 |
32 | ```
33 | cd a/suitable/directory/for/coding
34 | git clone https://github.com/hyperledgendary/hackathon-starter.git
35 | ```
36 |
37 | Open VSCode, within that open the workspace that is within the `hackathon-starter` directory.
38 |
39 | ## Step 3: Plan your project
40 |
41 | Do you have a domain in mind? Supply chain for example, or financial asset transfer?
42 | It is important to have a domain and scenario in mind, most scenarions are asset based in some way hence the starter applications are based around assets.
43 |
44 | Within the solution, there will be contracts and applications. There are basic examples of both of these within this repo and in different langauges. The basic examples are designed to work with each other.
45 |
46 | ## Step 4: Tutorials
47 |
48 | Here are some suggested tutorials to start to understand what you can do.
49 |
50 | - Within the IBM Blockchain Platform Extension there are some starter tutorials; worth doing these as they show you how the extension can help you develop.
51 | - It is worth reviewing this longer tutorial https://hyperledger-fabric.readthedocs.io/en/latest/developapps/developing_applications.html
52 |
53 |
54 | ## Practical Notes and Queries
55 |
56 | The VSCode extension will ONLY see Contract packages at the root of the workspace. Therefore if you wish to use one of the examples, add the folder directory to the top of the root of the workspace. (right click in the workspace and select 'Add Folder to Workspace...' and then navigate to the contract to use).
57 |
58 | When running a client application example, export the Connection Profile and Local wallet to a directory local to the application. For example a `_cfg` directory within the application. Load the Connection Profile and wallet from there into the application.
59 |
60 | It is recommended to use the VSCode extensions to start a running Fabric Infrastructure and to use that to install the contracts.
61 |
62 | In the applications there is a `_cfg` directory, the examples are setup to assume that you've exported the connection profile and wallet from VSCode to that directory.
63 |
64 | ## API References
65 |
66 | - [Contract JavaDoc API Reference](https://fabric-chaincode-java.github.io/)
67 | - [Contract Node.js API Reference](https://fabric-shim.github.io/release-1.4/index.html)
68 | - [Client application JavaDoc API Reference](https://fabric-gateway-java.github.io/)
69 | - [Client application Node.js API Reference](https://fabric-sdk-node.github.io/release-1.4/index.html)
70 |
71 |
--------------------------------------------------------------------------------
/basic-contract/js-contract/test/my-asset-contract.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const { ChaincodeStub, ClientIdentity } = require('fabric-shim');
8 | const { MyAssetContract } = require('..');
9 | const winston = require('winston');
10 |
11 | const chai = require('chai');
12 | const chaiAsPromised = require('chai-as-promised');
13 | const sinon = require('sinon');
14 | const sinonChai = require('sinon-chai');
15 |
16 | chai.should();
17 | chai.use(chaiAsPromised);
18 | chai.use(sinonChai);
19 |
20 | class TestContext {
21 |
22 | constructor() {
23 | this.stub = sinon.createStubInstance(ChaincodeStub);
24 | this.clientIdentity = sinon.createStubInstance(ClientIdentity);
25 | this.logging = {
26 | getLogger: sinon.stub().returns(sinon.createStubInstance(winston.createLogger().constructor)),
27 | setLevel: sinon.stub(),
28 | };
29 | }
30 |
31 | }
32 |
33 | describe('MyAssetContract', () => {
34 |
35 | let contract;
36 | let ctx;
37 |
38 | beforeEach(() => {
39 | contract = new MyAssetContract();
40 | ctx = new TestContext();
41 | ctx.stub.getState.withArgs('1001').resolves(Buffer.from('{"value":"my asset 1001 value"}'));
42 | ctx.stub.getState.withArgs('1002').resolves(Buffer.from('{"value":"my asset 1002 value"}'));
43 | });
44 |
45 | describe('#myAssetExists', () => {
46 |
47 | it('should return true for a my asset', async () => {
48 | await contract.myAssetExists(ctx, '1001').should.eventually.be.true;
49 | });
50 |
51 | it('should return false for a my asset that does not exist', async () => {
52 | await contract.myAssetExists(ctx, '1003').should.eventually.be.false;
53 | });
54 |
55 | });
56 |
57 | describe('#createMyAsset', () => {
58 |
59 | it('should create a my asset', async () => {
60 | await contract.createMyAsset(ctx, '1003', 'my asset 1003 value');
61 | ctx.stub.putState.should.have.been.calledOnceWithExactly('1003', Buffer.from('{"value":"my asset 1003 value"}'));
62 | });
63 |
64 | it('should throw an error for a my asset that already exists', async () => {
65 | await contract.createMyAsset(ctx, '1001', 'myvalue').should.be.rejectedWith(/The my asset 1001 already exists/);
66 | });
67 |
68 | });
69 |
70 | describe('#readMyAsset', () => {
71 |
72 | it('should return a my asset', async () => {
73 | await contract.readMyAsset(ctx, '1001').should.eventually.deep.equal({ value: 'my asset 1001 value' });
74 | });
75 |
76 | it('should throw an error for a my asset that does not exist', async () => {
77 | await contract.readMyAsset(ctx, '1003').should.be.rejectedWith(/The my asset 1003 does not exist/);
78 | });
79 |
80 | });
81 |
82 | describe('#updateMyAsset', () => {
83 |
84 | it('should update a my asset', async () => {
85 | await contract.updateMyAsset(ctx, '1001', 'my asset 1001 new value');
86 | ctx.stub.putState.should.have.been.calledOnceWithExactly('1001', Buffer.from('{"value":"my asset 1001 new value"}'));
87 | });
88 |
89 | it('should throw an error for a my asset that does not exist', async () => {
90 | await contract.updateMyAsset(ctx, '1003', 'my asset 1003 new value').should.be.rejectedWith(/The my asset 1003 does not exist/);
91 | });
92 |
93 | });
94 |
95 | describe('#deleteMyAsset', () => {
96 |
97 | it('should delete a my asset', async () => {
98 | await contract.deleteMyAsset(ctx, '1001');
99 | ctx.stub.deleteState.should.have.been.calledOnceWithExactly('1001');
100 | });
101 |
102 | it('should throw an error for a my asset that does not exist', async () => {
103 | await contract.deleteMyAsset(ctx, '1003').should.be.rejectedWith(/The my asset 1003 does not exist/);
104 | });
105 |
106 | });
107 |
108 | });
--------------------------------------------------------------------------------
/basic-contract/ts-contract/src/my-asset-contract.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | import { Context } from 'fabric-contract-api';
6 | import { ChaincodeStub, ClientIdentity } from 'fabric-shim';
7 | import { MyAssetContract } from '.';
8 |
9 | import * as chai from 'chai';
10 | import * as chaiAsPromised from 'chai-as-promised';
11 | import * as sinon from 'sinon';
12 | import * as sinonChai from 'sinon-chai';
13 | import winston = require('winston');
14 |
15 | chai.should();
16 | chai.use(chaiAsPromised);
17 | chai.use(sinonChai);
18 |
19 | class TestContext implements Context {
20 | public stub: sinon.SinonStubbedInstance = sinon.createStubInstance(ChaincodeStub);
21 | public clientIdentity: sinon.SinonStubbedInstance = sinon.createStubInstance(ClientIdentity);
22 | public logging = {
23 | getLogger: sinon.stub().returns(sinon.createStubInstance(winston.createLogger().constructor)),
24 | setLevel: sinon.stub(),
25 | };
26 | }
27 |
28 | describe('MyAssetContract', () => {
29 |
30 | let contract: MyAssetContract;
31 | let ctx: TestContext;
32 |
33 | beforeEach(() => {
34 | contract = new MyAssetContract();
35 | ctx = new TestContext();
36 | ctx.stub.getState.withArgs('1001').resolves(Buffer.from('{"value":"my asset 1001 value"}'));
37 | ctx.stub.getState.withArgs('1002').resolves(Buffer.from('{"value":"my asset 1002 value"}'));
38 | });
39 |
40 | describe('#myAssetExists', () => {
41 |
42 | it('should return true for a my asset', async () => {
43 | await contract.myAssetExists(ctx, '1001').should.eventually.be.true;
44 | });
45 |
46 | it('should return false for a my asset that does not exist', async () => {
47 | await contract.myAssetExists(ctx, '1003').should.eventually.be.false;
48 | });
49 |
50 | });
51 |
52 | describe('#createMyAsset', () => {
53 |
54 | it('should create a my asset', async () => {
55 | await contract.createMyAsset(ctx, '1003', 'my asset 1003 value');
56 | ctx.stub.putState.should.have.been.calledOnceWithExactly('1003', Buffer.from('{"value":"my asset 1003 value"}'));
57 | });
58 |
59 | it('should throw an error for a my asset that already exists', async () => {
60 | await contract.createMyAsset(ctx, '1001', 'myvalue').should.be.rejectedWith(/The my asset 1001 already exists/);
61 | });
62 |
63 | });
64 |
65 | describe('#readMyAsset', () => {
66 |
67 | it('should return a my asset', async () => {
68 | await contract.readMyAsset(ctx, '1001').should.eventually.deep.equal({ value: 'my asset 1001 value' });
69 | });
70 |
71 | it('should throw an error for a my asset that does not exist', async () => {
72 | await contract.readMyAsset(ctx, '1003').should.be.rejectedWith(/The my asset 1003 does not exist/);
73 | });
74 |
75 | });
76 |
77 | describe('#updateMyAsset', () => {
78 |
79 | it('should update a my asset', async () => {
80 | await contract.updateMyAsset(ctx, '1001', 'my asset 1001 new value');
81 | ctx.stub.putState.should.have.been.calledOnceWithExactly('1001', Buffer.from('{"value":"my asset 1001 new value"}'));
82 | });
83 |
84 | it('should throw an error for a my asset that does not exist', async () => {
85 | await contract.updateMyAsset(ctx, '1003', 'my asset 1003 new value').should.be.rejectedWith(/The my asset 1003 does not exist/);
86 | });
87 |
88 | });
89 |
90 | describe('#deleteMyAsset', () => {
91 |
92 | it('should delete a my asset', async () => {
93 | await contract.deleteMyAsset(ctx, '1001');
94 | ctx.stub.deleteState.should.have.been.calledOnceWithExactly('1001');
95 | });
96 |
97 | it('should throw an error for a my asset that does not exist', async () => {
98 | await contract.deleteMyAsset(ctx, '1003').should.be.rejectedWith(/The my asset 1003 does not exist/);
99 | });
100 |
101 | });
102 |
103 | });
104 |
--------------------------------------------------------------------------------
/basic-network/configtx.yaml:
--------------------------------------------------------------------------------
1 | # Copyright IBM Corp. All Rights Reserved.
2 | #
3 | # SPDX-License-Identifier: Apache-2.0
4 | #
5 |
6 | ---
7 | ################################################################################
8 | #
9 | # Section: Organizations
10 | #
11 | # - This section defines the different organizational identities which will
12 | # be referenced later in the configuration.
13 | #
14 | ################################################################################
15 | Organizations:
16 |
17 | # SampleOrg defines an MSP using the sampleconfig. It should never be used
18 | # in production but may be used as a template for other definitions
19 | - &OrdererOrg
20 | # DefaultOrg defines the organization which is used in the sampleconfig
21 | # of the fabric.git development environment
22 | Name: OrdererOrg
23 |
24 | # ID to load the MSP definition as
25 | ID: OrdererMSP
26 |
27 | # MSPDir is the filesystem path which contains the MSP configuration
28 | MSPDir: crypto-config/ordererOrganizations/example.com/msp
29 |
30 | - &Org1
31 | # DefaultOrg defines the organization which is used in the sampleconfig
32 | # of the fabric.git development environment
33 | Name: Org1MSP
34 |
35 | # ID to load the MSP definition as
36 | ID: Org1MSP
37 |
38 | MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
39 |
40 | AnchorPeers:
41 | # AnchorPeers defines the location of peers which can be used
42 | # for cross org gossip communication. Note, this value is only
43 | # encoded in the genesis block in the Application section context
44 | - Host: peer0.org1.example.com
45 | Port: 7051
46 |
47 | ################################################################################
48 | #
49 | # SECTION: Application
50 | #
51 | # - This section defines the values to encode into a config transaction or
52 | # genesis block for application related parameters
53 | #
54 | ################################################################################
55 | Application: &ApplicationDefaults
56 |
57 | # Organizations is the list of orgs which are defined as participants on
58 | # the application side of the network
59 | Organizations:
60 |
61 | ################################################################################
62 | #
63 | # SECTION: Orderer
64 | #
65 | # - This section defines the values to encode into a config transaction or
66 | # genesis block for orderer related parameters
67 | #
68 | ################################################################################
69 | Orderer: &OrdererDefaults
70 |
71 | # Orderer Type: The orderer implementation to start
72 | # Available types are "solo" and "kafka"
73 | OrdererType: solo
74 |
75 | Addresses:
76 | - orderer.example.com:7050
77 |
78 | # Batch Timeout: The amount of time to wait before creating a batch
79 | BatchTimeout: 2s
80 |
81 | # Batch Size: Controls the number of messages batched into a block
82 | BatchSize:
83 |
84 | # Max Message Count: The maximum number of messages to permit in a batch
85 | MaxMessageCount: 10
86 |
87 | # Absolute Max Bytes: The absolute maximum number of bytes allowed for
88 | # the serialized messages in a batch.
89 | AbsoluteMaxBytes: 99 MB
90 |
91 | # Preferred Max Bytes: The preferred maximum number of bytes allowed for
92 | # the serialized messages in a batch. A message larger than the preferred
93 | # max bytes will result in a batch larger than preferred max bytes.
94 | PreferredMaxBytes: 512 KB
95 |
96 | Kafka:
97 | # Brokers: A list of Kafka brokers to which the orderer connects
98 | # NOTE: Use IP:port notation
99 | Brokers:
100 | - 127.0.0.1:9092
101 |
102 | # Organizations is the list of orgs which are defined as participants on
103 | # the orderer side of the network
104 | Organizations:
105 |
106 | ################################################################################
107 | #
108 | # Profile
109 | #
110 | # - Different configuration profiles may be encoded here to be specified
111 | # as parameters to the configtxgen tool
112 | #
113 | ################################################################################
114 | Profiles:
115 |
116 | OneOrgOrdererGenesis:
117 | Orderer:
118 | <<: *OrdererDefaults
119 | Organizations:
120 | - *OrdererOrg
121 | Consortiums:
122 | SampleConsortium:
123 | Organizations:
124 | - *Org1
125 | OneOrgChannel:
126 | Consortium: SampleConsortium
127 | Application:
128 | <<: *ApplicationDefaults
129 | Organizations:
130 | - *Org1
131 |
132 |
--------------------------------------------------------------------------------
/basic-network/docker-compose.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright IBM Corp All Rights Reserved
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 | version: '2'
7 |
8 | networks:
9 | basic:
10 |
11 | services:
12 | ca.example.com:
13 | image: hyperledger/fabric-ca
14 | environment:
15 | - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
16 | - FABRIC_CA_SERVER_CA_NAME=ca.example.com
17 | - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
18 | - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
19 | ports:
20 | - "7054:7054"
21 | command: sh -c 'fabric-ca-server start -b admin:adminpw'
22 | volumes:
23 | - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
24 | container_name: ca.example.com
25 | networks:
26 | - basic
27 |
28 | orderer.example.com:
29 | container_name: orderer.example.com
30 | image: hyperledger/fabric-orderer
31 | environment:
32 | - FABRIC_LOGGING_SPEC=info
33 | - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
34 | - ORDERER_GENERAL_GENESISMETHOD=file
35 | - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
36 | - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
37 | - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
38 | working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
39 | command: orderer
40 | ports:
41 | - 7050:7050
42 | volumes:
43 | - ./config/:/etc/hyperledger/configtx
44 | - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer
45 | - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peerOrg1
46 | networks:
47 | - basic
48 |
49 | peer0.org1.example.com:
50 | container_name: peer0.org1.example.com
51 | image: hyperledger/fabric-peer
52 | environment:
53 | - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
54 | - CORE_PEER_ID=peer0.org1.example.com
55 | - FABRIC_LOGGING_SPEC=info
56 | - CORE_CHAINCODE_LOGGING_LEVEL=info
57 | - CORE_PEER_LOCALMSPID=Org1MSP
58 | - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
59 | - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
60 | # # the following setting starts chaincode containers on the same
61 | # # bridge network as the peers
62 | # # https://docs.docker.com/compose/networking/
63 | - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic
64 | - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
65 | - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
66 | # The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
67 | # provide the credentials for ledger to connect to CouchDB. The username and password must
68 | # match the username and password set for the associated CouchDB.
69 | - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
70 | - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
71 | working_dir: /opt/gopath/src/github.com/hyperledger/fabric
72 | command: peer node start
73 | # command: peer node start --peer-chaincodedev=true
74 | ports:
75 | - 7051:7051
76 | - 7053:7053
77 | volumes:
78 | - /var/run/:/host/var/run/
79 | - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/msp/peer
80 | - ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
81 | - ./config:/etc/hyperledger/configtx
82 | depends_on:
83 | - orderer.example.com
84 | - couchdb
85 | networks:
86 | - basic
87 |
88 | couchdb:
89 | container_name: couchdb
90 | image: hyperledger/fabric-couchdb
91 | # Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
92 | # for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.
93 | environment:
94 | - COUCHDB_USER=
95 | - COUCHDB_PASSWORD=
96 | ports:
97 | - 5984:5984
98 | networks:
99 | - basic
100 |
101 | cli:
102 | container_name: cli
103 | image: hyperledger/fabric-tools
104 | tty: true
105 | environment:
106 | - GOPATH=/opt/gopath
107 | - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
108 | - FABRIC_LOGGING_SPEC=info
109 | - CORE_PEER_ID=cli
110 | - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
111 | - CORE_PEER_LOCALMSPID=Org1MSP
112 | - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
113 | - CORE_CHAINCODE_KEEPALIVE=10
114 | working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
115 | command: /bin/bash
116 | volumes:
117 | - /var/run/:/host/var/run/
118 | - ./../basic-contract/:/opt/gopath/src/github.com/
119 | - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
120 | networks:
121 | - basic
122 | #depends_on:
123 | # - orderer.example.com
124 | # - peer0.org1.example.com
125 | # - couchdb
126 |
--------------------------------------------------------------------------------
/basic-applications/java-app/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/basic-contract/java-contract/src/test/java/org/example/MyAssetContractTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache License 2.0
3 | */
4 |
5 | package org.example;
6 | import static java.nio.charset.StandardCharsets.UTF_8;
7 | import static org.junit.jupiter.api.Assertions.assertEquals;
8 | import static org.junit.jupiter.api.Assertions.assertFalse;
9 | import static org.junit.jupiter.api.Assertions.assertThrows;
10 | import static org.junit.jupiter.api.Assertions.assertTrue;
11 | import static org.mockito.Mockito.mock;
12 | import static org.mockito.Mockito.verify;
13 | import static org.mockito.Mockito.when;
14 |
15 | import java.nio.charset.StandardCharsets;
16 |
17 | import org.hyperledger.fabric.contract.Context;
18 | import org.hyperledger.fabric.shim.ChaincodeStub;
19 | import org.junit.jupiter.api.Nested;
20 | import org.junit.jupiter.api.Test;
21 |
22 |
23 | public final class MyAssetContractTest {
24 |
25 | @Nested
26 | class AssetExists {
27 | @Test
28 | public void noProperAsset() {
29 |
30 | MyAssetContract contract = new MyAssetContract();
31 | Context ctx = mock(Context.class);
32 | ChaincodeStub stub = mock(ChaincodeStub.class);
33 | when(ctx.getStub()).thenReturn(stub);
34 |
35 | when(stub.getState("10001")).thenReturn(new byte[] {});
36 | boolean result = contract.myAssetExists(ctx,"10001");
37 |
38 | assertFalse(result);
39 | }
40 |
41 | @Test
42 | public void assetExists() {
43 |
44 | MyAssetContract contract = new MyAssetContract();
45 | Context ctx = mock(Context.class);
46 | ChaincodeStub stub = mock(ChaincodeStub.class);
47 | when(ctx.getStub()).thenReturn(stub);
48 |
49 | when(stub.getState("10001")).thenReturn(new byte[] {42});
50 | boolean result = contract.myAssetExists(ctx,"10001");
51 |
52 | assertTrue(result);
53 |
54 | }
55 |
56 | @Test
57 | public void noKey() {
58 | MyAssetContract contract = new MyAssetContract();
59 | Context ctx = mock(Context.class);
60 | ChaincodeStub stub = mock(ChaincodeStub.class);
61 | when(ctx.getStub()).thenReturn(stub);
62 |
63 | when(stub.getState("10002")).thenReturn(null);
64 | boolean result = contract.myAssetExists(ctx,"10002");
65 |
66 | assertFalse(result);
67 |
68 | }
69 |
70 | }
71 |
72 | @Nested
73 | class AssetCreates {
74 |
75 | @Test
76 | public void newAssetCreate() {
77 | MyAssetContract contract = new MyAssetContract();
78 | Context ctx = mock(Context.class);
79 | ChaincodeStub stub = mock(ChaincodeStub.class);
80 | when(ctx.getStub()).thenReturn(stub);
81 |
82 | String json = "{\"value\":\"TheAsset\"}";
83 |
84 | contract.createMyAsset(ctx, "10001", "TheAsset");
85 |
86 | verify(stub).putState("10001", json.getBytes(UTF_8));
87 | }
88 |
89 | @Test
90 | public void alreadyExists() {
91 | MyAssetContract contract = new MyAssetContract();
92 | Context ctx = mock(Context.class);
93 | ChaincodeStub stub = mock(ChaincodeStub.class);
94 | when(ctx.getStub()).thenReturn(stub);
95 |
96 | when(stub.getState("10002")).thenReturn(new byte[] { 42 });
97 |
98 | Exception thrown = assertThrows(RuntimeException.class, () -> {
99 | contract.createMyAsset(ctx, "10002", "TheAsset");
100 | });
101 |
102 | assertEquals(thrown.getMessage(), "The asset 10002 already exists");
103 |
104 | }
105 |
106 | }
107 |
108 | @Test
109 | public void assetRead() {
110 | MyAssetContract contract = new MyAssetContract();
111 | Context ctx = mock(Context.class);
112 | ChaincodeStub stub = mock(ChaincodeStub.class);
113 | when(ctx.getStub()).thenReturn(stub);
114 |
115 | MyAsset asset = new MyAsset();
116 | asset.setValue("Valuable");
117 |
118 | String json = asset.toJSONString();
119 | when(stub.getState("10001")).thenReturn(json.getBytes(StandardCharsets.UTF_8));
120 |
121 | MyAsset returnedAsset = contract.readMyAsset(ctx, "10001");
122 | assertEquals(returnedAsset.getValue(), asset.getValue());
123 | }
124 |
125 | @Nested
126 | class AssetUpdates {
127 | @Test
128 | public void updateExisting() {
129 | MyAssetContract contract = new MyAssetContract();
130 | Context ctx = mock(Context.class);
131 | ChaincodeStub stub = mock(ChaincodeStub.class);
132 | when(ctx.getStub()).thenReturn(stub);
133 | when(stub.getState("10001")).thenReturn(new byte[] { 42 });
134 |
135 | contract.updateMyAsset(ctx, "10001", "updates");
136 |
137 | String json = "{\"value\":\"updates\"}";
138 | verify(stub).putState("10001", json.getBytes(UTF_8));
139 | }
140 |
141 | @Test
142 | public void updateMissing() {
143 | MyAssetContract contract = new MyAssetContract();
144 | Context ctx = mock(Context.class);
145 | ChaincodeStub stub = mock(ChaincodeStub.class);
146 | when(ctx.getStub()).thenReturn(stub);
147 |
148 | when(stub.getState("10001")).thenReturn(null);
149 |
150 | Exception thrown = assertThrows(RuntimeException.class, () -> {
151 | contract.updateMyAsset(ctx, "10001", "TheAsset");
152 | });
153 |
154 | assertEquals(thrown.getMessage(), "The asset 10001 does not exist");
155 | }
156 |
157 | }
158 |
159 | @Test
160 | public void assetDelete() {
161 | MyAssetContract contract = new MyAssetContract();
162 | Context ctx = mock(Context.class);
163 | ChaincodeStub stub = mock(ChaincodeStub.class);
164 | when(ctx.getStub()).thenReturn(stub);
165 | when(stub.getState("10001")).thenReturn(null);
166 |
167 | Exception thrown = assertThrows(RuntimeException.class, () -> {
168 | contract.deleteMyAsset(ctx, "10001");
169 | });
170 |
171 | assertEquals(thrown.getMessage(), "The asset 10001 does not exist");
172 | }
173 |
174 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------