├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github
├── COMMIT_STYLEGUIDE.md
├── CONTRIBUTING.md
├── PULL_REQUEST_TEMPLATE.md
└── settings.yml
├── LICENSE
├── README.md
├── attributebased
├── .gitignore
├── javascript
│ ├── .gitignore
│ ├── enrollAdmin.js
│ ├── index.html
│ ├── index.js
│ ├── invoke.js
│ ├── package-lock.json
│ ├── package.json
│ ├── query.js
│ ├── registerUser.js
│ └── yarn.lock
└── startFabric.sh
├── basic-network
├── .env
├── README.md
├── config
│ ├── channel.tx
│ └── genesis.block
├── configtx.yaml
├── connection.json
├── connection.yaml
├── crypto-config.yaml
├── crypto-config
│ ├── ordererOrganizations
│ │ └── example.com
│ │ │ ├── ca
│ │ │ ├── a0606a4a860a1e31c90a23788da6f3b6b74925ed0d23061af4899409ba46ae6a_sk
│ │ │ └── ca.example.com-cert.pem
│ │ │ ├── msp
│ │ │ ├── admincerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ │ └── ca.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ │ └── tlsca.example.com-cert.pem
│ │ │ ├── orderers
│ │ │ └── orderer.example.com
│ │ │ │ ├── msp
│ │ │ │ ├── admincerts
│ │ │ │ │ └── Admin@example.com-cert.pem
│ │ │ │ ├── cacerts
│ │ │ │ │ └── ca.example.com-cert.pem
│ │ │ │ ├── keystore
│ │ │ │ │ └── 4d2f776c0fef8eac3f460a7c3558dc7859c4fe458e262e674a6c23f242ea33d1_sk
│ │ │ │ ├── signcerts
│ │ │ │ │ └── orderer.example.com-cert.pem
│ │ │ │ └── tlscacerts
│ │ │ │ │ └── tlsca.example.com-cert.pem
│ │ │ │ └── tls
│ │ │ │ ├── ca.crt
│ │ │ │ ├── server.crt
│ │ │ │ └── server.key
│ │ │ ├── tlsca
│ │ │ ├── 8d2186556c85d515e737d0c0da8d0d7672785b685cb503bcb95e53dcc279fba7_sk
│ │ │ └── tlsca.example.com-cert.pem
│ │ │ └── users
│ │ │ └── Admin@example.com
│ │ │ ├── msp
│ │ │ ├── admincerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ │ └── ca.example.com-cert.pem
│ │ │ ├── keystore
│ │ │ │ └── 1deeab5433fa6e5f045eb763109d6165268fba153211af1281f00d45f54b1022_sk
│ │ │ ├── signcerts
│ │ │ │ └── Admin@example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ │ └── tlsca.example.com-cert.pem
│ │ │ └── tls
│ │ │ ├── ca.crt
│ │ │ ├── server.crt
│ │ │ └── server.key
│ └── peerOrganizations
│ │ └── org1.example.com
│ │ ├── ca
│ │ ├── 4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
│ │ ├── ca.org1.example.com-cert.pem
│ │ └── 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
│ │ ├── peers
│ │ └── peer0.org1.example.com
│ │ │ ├── msp
│ │ │ ├── admincerts
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ │ └── ca.org1.example.com-cert.pem
│ │ │ ├── keystore
│ │ │ │ └── 46be1d569fe68f33e517c9e0072a0ccfbfb42727480fb8c8d0223af321a7893d_sk
│ │ │ ├── signcerts
│ │ │ │ └── peer0.org1.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ │ └── tlsca.org1.example.com-cert.pem
│ │ │ └── tls
│ │ │ ├── ca.crt
│ │ │ ├── server.crt
│ │ │ └── server.key
│ │ ├── tlsca
│ │ ├── ed3fd82393e95fc2c475afc113c8d2c591f745d1babc4d6d9cce0a1acc168acb_sk
│ │ └── tlsca.org1.example.com-cert.pem
│ │ └── users
│ │ ├── Admin@org1.example.com
│ │ ├── msp
│ │ │ ├── admincerts
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ ├── cacerts
│ │ │ │ └── ca.org1.example.com-cert.pem
│ │ │ ├── keystore
│ │ │ │ └── cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec_sk
│ │ │ ├── signcerts
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ └── tlscacerts
│ │ │ │ └── tlsca.org1.example.com-cert.pem
│ │ └── tls
│ │ │ ├── ca.crt
│ │ │ ├── server.crt
│ │ │ └── server.key
│ │ └── User1@org1.example.com
│ │ ├── msp
│ │ ├── admincerts
│ │ │ └── User1@org1.example.com-cert.pem
│ │ ├── cacerts
│ │ │ └── ca.org1.example.com-cert.pem
│ │ ├── keystore
│ │ │ └── c75bd6911aca808941c3557ee7c97e90f3952e379497dc55eb903f31b50abc83_sk
│ │ ├── signcerts
│ │ │ └── User1@org1.example.com-cert.pem
│ │ └── tlscacerts
│ │ │ └── tlsca.org1.example.com-cert.pem
│ │ └── tls
│ │ ├── ca.crt
│ │ ├── server.crt
│ │ └── server.key
├── docker-compose.yml
├── generate.sh
├── init.sh
├── start.sh
├── stop.sh
└── teardown.sh
├── chaincode
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── data
│ ├── policy.json
│ ├── resource.json
│ └── subject.json
├── index.js
├── ledger-api
│ ├── state.js
│ └── statelist.js
├── lib
│ ├── Policy.js
│ ├── PolicyList.js
│ ├── Resource.js
│ ├── ResourceList.js
│ ├── Subject.js
│ ├── SubjectList.js
│ └── attributebased.js
└── package.json
├── images
└── architecture3.png
├── scripts
└── bootstrap.sh
├── startFabric.sh
├── test
├── benchmark
│ ├── addpolicy.js
│ ├── addresource.js
│ ├── addsubject.js
│ ├── config-composite-rate.yaml
│ ├── config-feedback-rate.yaml
│ ├── config-iroha.yaml
│ ├── config-linear-rate.yaml
│ ├── config-old.yaml
│ ├── config-record-replay-rate.yaml
│ ├── config-sawtooth-feedback.yaml
│ ├── config-sawtooth.yaml
│ ├── config-zookeeper.yaml
│ ├── config.yaml
│ ├── config_linear.yaml
│ ├── config_long.yaml
│ ├── init.js
│ ├── pdp.js
│ └── query.js
├── reports
│ ├── report-20190829T232319.html
│ ├── report-20190829T232820.html
│ ├── report-20190829T233204.html
│ ├── report-20190829T233523.html
│ ├── report-20190829T233924.html
│ ├── report-20190829T234116.html
│ ├── report-20190829T234652.html
│ ├── report-20190830T021422.html
│ ├── report-20190830T022030.html
│ ├── report-20190830T022510.html
│ ├── report-20190830T022747.html
│ ├── report-20190903T042108.html
│ ├── report-20190903T042650.html
│ ├── report-20190903T043128.html
│ ├── report-20190903T044032.html
│ ├── report-20190903T045209.html
│ ├── report-20190903T045614.html
│ ├── report-20190903T050032.html
│ ├── report-20190903T051004.html
│ ├── report-20190903T052113.html
│ ├── report-20190903T052653.html
│ ├── report-20190903T052900.html
│ ├── report-20190906T205152.html
│ ├── report-20190906T205650.html
│ ├── report-20190906T210005.html
│ ├── report-20190906T210422.html
│ ├── report-20190906T210633.html
│ ├── report-20190906T215205.html
│ ├── report-20190907T003650.html
│ ├── report-20190907T005855.html
│ ├── report-20190909T042500.html
│ ├── report-20190913T191813.html
│ ├── report-20190915T210201.html
│ ├── report-20190915T214331.html
│ ├── report-20190915T220840.html
│ ├── report-20190915T221824.html
│ ├── report-20190915T222515.html
│ ├── report-20190915T223311.html
│ ├── report-20190915T224216.html
│ ├── report-20190915T225210.html
│ ├── report-20190915T230148.html
│ ├── report-20190915T231033.html
│ ├── report-20190915T231741.html
│ ├── report-20190915T232423.html
│ ├── report-20190915T233351.html
│ ├── report-20190916T175121.html
│ ├── report-20190916T175927.html
│ ├── report-20190916T180543.html
│ ├── report-20190916T182029.html
│ ├── report-20190916T183749.html
│ ├── report-20190916T184453.html
│ ├── report-20190916T184918.html
│ ├── report-20190916T185434.html
│ ├── report-20190916T185934.html
│ ├── report-20190916T194329.html
│ ├── report-20190916T204200.html
│ ├── report-20190916T205522.html
│ ├── report-20190916T214604.html
│ ├── report-20190916T215324.html
│ ├── report-20190916T215901.html
│ ├── report-20190916T220453.html
│ ├── report-20190916T221800.html
│ ├── report-20190916T223950.html
│ ├── report-20190916T232327.html
│ ├── report-20190916T233037.html
│ ├── report-20190917T031418.html
│ ├── report-20190917T032003.html
│ ├── report-20190917T032437.html
│ ├── report-20190917T033026.html
│ ├── report-20190917T033455.html
│ ├── report-20190917T034235.html
│ ├── report-20190917T034925.html
│ ├── report-20190917T035657.html
│ ├── report-20190917T040340.html
│ ├── report-20190917T041224.html
│ ├── report-20190917T041840.html
│ ├── report-20190917T042954.html
│ ├── report-20190917T043635.html
│ ├── report-20190917T044353.html
│ ├── report-20190917T045052.html
│ ├── report-20190917T191813.html
│ ├── report-20190917T205031.html
│ ├── report-20190918T165330.html
│ ├── report-20190918T170245.html
│ ├── report-20190918T171211.html
│ ├── report-20190918T172022.html
│ ├── report-20190918T172945.html
│ ├── report-20190918T173838.html
│ ├── report-20190918T175717.html
│ ├── report-20190918T180111.html
│ ├── report-20190918T180510.html
│ └── report-20190918T181152.html
└── src
│ └── contract
│ └── fabric
│ └── attributeBased
│ └── node
│ ├── attributebased.js
│ └── package.json
└── travis.yaml
/.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 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | coverage
6 |
--------------------------------------------------------------------------------
/.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 | "space-infix-ops": ["error", {"int32Hint": false}],
17 | indent: ['error', 4],
18 | 'linebreak-style': ['error', 'unix'],
19 | quotes: ['error', 'single'],
20 | semi: ['error', 'always'],
21 | 'no-unused-vars': ['error', { args: 'none' }],
22 | 'no-console': 'off',
23 | curly: 'error',
24 | eqeqeq: 'error',
25 | 'no-throw-literal': 'error',
26 | strict: 'error',
27 | 'no-var': 'error',
28 | 'dot-notation': 'error',
29 | 'no-tabs': 'error',
30 | 'no-trailing-spaces': 'error',
31 | 'no-use-before-define': 'error',
32 | 'no-useless-call': 'error',
33 | 'no-with': 'error',
34 | 'operator-linebreak': 'error',
35 | yoda: 'error',
36 | 'quote-props': ['error', 'as-needed']
37 | }
38 | };
39 |
--------------------------------------------------------------------------------
/.github/COMMIT_STYLEGUIDE.md:
--------------------------------------------------------------------------------
1 | feat: A new feature
2 |
3 | fix: A bug fix
4 |
5 | wip: While working on a fix/feature
6 |
7 | docs: Documentation only changes
8 |
9 | style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
10 |
11 | refactor: A code change that neither fixes a bug or adds a feature
12 |
13 | test: Adding missing tests
14 |
15 | chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to contribute for this project?
2 |
3 |
4 | If you want to purpose a bug fix:
5 | 1) Fork the project & clone locally.
6 | 2) Create an upstream remote and sync your local copy before you branch.
7 | 3) Choose an issue (by asking the mantainer).
8 | 4) If you’d like to create a new issue, please go through our issue list first (open as well as closed) and make sure the issues you are reporting do not replicate the existing issues.
9 | 5) Branch for each separate piece of work.
10 | 6) Do the work, write good commit messages.
11 | 7) Push to your origin repository.
12 | 8) Create a new Pull Request in GitHub.
13 | 9) Respond to any code review feedback.
14 |
15 | That's it!
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description
2 | Include a summary of the change and relevant motivation/context. List any dependencies that are required for this change.
3 |
4 | Fixes # [ISSUE]
5 |
6 | ### Type of Change:
7 | **Delete irrelevant options.**
8 |
9 | - Code
10 | - Quality Assurance
11 | - User Interface
12 | - Outreach
13 | - Documentation
14 |
15 | **Code/Quality Assurance Only**
16 | - Bug fix (non-breaking change which fixes an issue)
17 | - This change requires a documentation update (software upgrade on readme file)
18 | - New feature (non-breaking change which adds functionality pre-approved by mentors)
19 |
20 |
21 | ### How Has This Been Tested?
22 | Describe the tests you ran to verify your changes.
23 | If to run your tests you have to take specific steps, please provide instructions or GIFs so we can reproduce. List any relevant details for your test.
24 |
25 |
26 | ### Checklist:
27 | **Delete irrelevant options.**
28 |
29 | - [ ] I have performed a self-review of my own code or materials
30 | - [ ] I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
31 | - [ ] I have made corresponding changes to the documentation
32 |
33 | **Code/Quality Assurance Only**
34 | - [ ] My changes generate no errors
35 | - [ ] My changes generate no warnings
36 | - [ ] I have added tests to my feature/fix
37 | - [ ] The tests I added pass locally
--------------------------------------------------------------------------------
/.github/settings.yml:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | repository:
6 | name: hyperledger-fabric-based-access-control
7 | archived: true
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Hyperledger-Fabric-Based-Acess-Control
2 | [](https://travis-ci.com/RafaelAPB/Hyperledger-Fabric-Based-Acess-Control)
3 | [](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=RafaelAPB/Hyperledger-Fabric-Based-Acess-Control&utm_campaign=Badge_Grade)
4 |
5 | Welcome to the [Hyperledger Fabric Based Access Control project](https://wiki.hyperledger.org/display/INTERN/Hyperledger+Fabric+Based+Access+Control).
6 |
7 | This project aims to mediate the access control flow coming from a centralized system, enhancing auditability and access control policy enforcement. It discourages illicit accesses, as the system administrators are not able to tamper the access logs (if applicable).
8 |
9 | ## Paper
10 | This project yielded a scientific paper, currently available at arXiv: https://arxiv.org/pdf/2006.04384.pdf
11 |
12 | ### Pre-requisites
13 | Make sure following tools are installed:
14 |
15 | * NodeJS ^10.15 (tested with 10.18.1)
16 | * Docker (latest)
17 | * Docker-compose (latest)
18 |
19 | #### Installation steps
20 | 1. Install the [prerequesites](https://hyperledger-fabric.readthedocs.io/en/master/prereqs.html) and [fabric-samples](https://hyperledger-fabric.readthedocs.io/en/master/install.html).
21 | NOTE: Install Fabric v2.0 with ``curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.0 1.4.4 0.4.18
22 | ``
23 | 1. To avoid any conflict with previous network, remove all docker containers.
24 |
25 | * docker kill $(docker ps -q)
26 | * docker rm $(docker ps -aq)
27 |
28 | 3. Start the Fabric Network and javascript version of abacFabric chaincode by running:
29 | ``./startFabric``
30 |
31 | 4. You may run transactions against the ledger, specified at the end of script execution
32 |
33 | 2. Navigate to the ``abacFabric`` directory
34 |
35 | 4. Go to ``javascript`` and run ``npm install``. NOTE: The client is still being refactored
36 |
37 | ### Demonstration
38 |
39 | 6. To enroll an admin user, run ``node enrollAdmin.js``
40 |
41 | 7. With the enrolled admin, register another user with ``node registerUser.js``
42 |
43 | 8. Run ``node index.js`` file to run the web application. I your terminal you should see the message "app is listening on port 3000 ..."
44 |
45 | 9. In your browser go to the address ``localhost:3000``.
46 | Now you record subjects and resources attributes and policies in JSON format on the ledger. Query the stored data. And check the access permissions based on stored data and given rule.
47 |
48 | ### Shutting the network down
49 |
50 | 1. To stop the network, run ``./stopFabric``
51 |
52 | ### Test
53 | Tests from the older version are located in the ``test folder``
54 |
--------------------------------------------------------------------------------
/attributebased/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | /package-lock.json
3 | /hfc-key-store/
4 |
--------------------------------------------------------------------------------
/attributebased/javascript/.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 | wallet
80 | !wallet/.gitkeep
81 |
--------------------------------------------------------------------------------
/attributebased/javascript/enrollAdmin.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const FabricCAServices = require('fabric-ca-client');
8 | const { FileSystemWallet, X509WalletMixin } = require('fabric-network');
9 | const fs = require('fs');
10 | const path = require('path');
11 |
12 | const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
13 | const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
14 | const ccp = JSON.parse(ccpJSON);
15 |
16 | async function main() {
17 | try {
18 |
19 | // Create a new CA client for interacting with the CA.
20 | const caURL = ccp.certificateAuthorities['ca.example.com'].url;
21 | const ca = new FabricCAServices(caURL);
22 |
23 | // Create a new file system based wallet for managing identities.
24 | const walletPath = path.join(process.cwd(), 'wallet');
25 | const wallet = new FileSystemWallet(walletPath);
26 | console.log(`Wallet path: ${walletPath}`);
27 |
28 | // Check to see if we've already enrolled the admin user.
29 | const adminExists = await wallet.exists('admin');
30 | if (adminExists) {
31 | console.log('An identity for the admin user "admin" already exists in the wallet');
32 | return;
33 | }
34 |
35 | // Enroll the admin user, and import the new identity into the wallet.
36 | const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'adminpw' });
37 | const identity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes());
38 | wallet.import('admin', identity);
39 | console.log('Successfully enrolled admin user "admin" and imported it into the wallet');
40 |
41 | } catch (error) {
42 | console.error(`Failed to enroll admin user "admin": ${error}`);
43 | process.exit(1);
44 | }
45 | }
46 |
47 | main();
48 |
--------------------------------------------------------------------------------
/attributebased/javascript/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
35 |
36 |
37 | Record Subjects attributes
38 |
39 |
48 |
49 |
50 | Record Resources attributes
51 |
52 |
60 |
61 |
62 | Record policies
63 |
64 |
72 |
73 |
74 | Check access permissions
75 |
76 |
91 |
92 |
93 | Query attributes
94 |
95 |
100 |
101 |
102 | Query policy
103 |
104 |
109 |
110 |
111 | Query all data
112 |
113 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/attributebased/javascript/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | // {"user":{"active":true,"dob":"1989-06-06","banCount":1,"group":12,"department":"computer"}}
6 | // {"group":{"id":12}}
7 | // {"attributes":{"user":{"active":"Active","banCount":"Timesbanned","dob":"Dateofbirth","group":"GroupID"},"group":{"id":"GroupID"}},"rules":{"can-be-admin-of-group":{"attributes":{"user.active":{"comparison_type":"boolean","comparison":"boolAnd","value":true},"user.dob":{"comparison_type":"datetime","comparison":"isLessRecentThan","value":"-21Y"},"user.banCount":{"comparison_type":"numeric","comparison":"isLesserThanEqualTo","value":1},"user.group":{"comparison_target":"group","comparison_type":"numeric","comparison":"isStrictlyEqual","field":"id"}}}}}
8 |
9 | 'use strict';
10 | const { FileSystemWallet, Gateway } = require('fabric-network');
11 | const fs = require('fs');
12 | const path = require('path');
13 | const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
14 | const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
15 | const ccp = JSON.parse(ccpJSON);
16 | const express = require('express');
17 | const app = express();
18 | const bodyParser = require('body-parser');
19 | app.use(bodyParser.json());
20 | app.use(bodyParser.urlencoded({ extended: false }));
21 | async function main() {
22 | try {
23 |
24 | // Create a new file system based wallet for managing identities.
25 | const walletPath = path.join(process.cwd(), 'wallet');
26 | const wallet = new FileSystemWallet(walletPath);
27 | console.log(`Wallet path: ${walletPath}`);
28 |
29 | // Check to see if we've already enrolled the user.
30 | const userExists = await wallet.exists('user1');
31 | if (!userExists) {
32 | console.log('An identity for the user "user1" does not exist in the wallet');
33 | console.log('Run the registerUser.js application before retrying');
34 | return;
35 | }
36 | const gateway = new Gateway();
37 | await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } });
38 | const network = await gateway.getNetwork('mychannel');
39 | const contract = network.getContract('attributebased');
40 | app.get('/', (req, res) => {
41 | res.sendFile(__dirname + '/index.html');
42 | });
43 | app.post('/submit-subject', async(req,res) => {
44 | try{
45 | let subjectKey = req.body.subjectKey;
46 | console.log('this is subject key'+subjectKey);
47 | let subject = req.body.subject;
48 | console.log(typeof subject);
49 | let response = await contract.submitTransaction('recordSubject', subjectKey , JSON.stringify(subject));
50 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
51 | res.json(response.toString());
52 | }
53 | catch(e){
54 | res.end(e.message || e.toString());
55 | }
56 | });
57 | app.post('/submit-resource', async(req,res) => {
58 | try{
59 | let resourceKey = req.body.resourceKey;
60 | let resource = req.body.resource;
61 | let response = await contract.submitTransaction('recordResource', resourceKey , JSON.stringify(resource));
62 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
63 | res.json(response.toString());
64 | }
65 | catch(e){
66 | res.end(e.message || e.toString());
67 | }
68 | });
69 | app.post('/submit-policy', async(req,res) => {
70 | try{
71 | let policyKey = req.body.policyKey;
72 | let policy = req.body.policy;
73 | let response = await contract.submitTransaction('recordPolicy', policyKey , JSON.stringify(policy));
74 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
75 | res.json(response.toString());
76 | }
77 | catch(e){
78 | res.end(e.message || e.toString());
79 | }
80 | });
81 | app.post('/submit-pdp', async(req,res) => {
82 | try{
83 | let subjectKey = req.body.subjectKey;
84 | let resourceKey = req.body.resourceKey;
85 | let rule = req.body.rule;
86 | let policyKey = req.body.policyKey;
87 | let response = await contract.submitTransaction('PDP', subjectKey , resourceKey, rule, policyKey);
88 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
89 | res.json(response.toString());
90 | }
91 | catch(e){
92 | res.end(e.message || e.toString());
93 | }
94 | });
95 | app.post('/submit-queryAll', async(req,res) => {
96 | try{
97 | //let subjectKey = req.body.subjectKeyQuery;
98 | // console.log('this is subject key'+subjectKey);
99 | // let response = await contract.evaluateTransaction('queryUserAttribute', subjectKey);
100 | let response = await contract.evaluateTransaction('queryAll');
101 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
102 | res.send(JSON.parse(response));
103 | }
104 | catch(e){
105 | res.end(e.message || e.toString());
106 | }
107 | });
108 | app.post('/submit-queryAttribute', async(req,res) => {
109 | try{
110 | let attributeKey = req.body.attributeKeyQuery;
111 | let response = await contract.evaluateTransaction('queryAttribute', attributeKey);
112 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
113 | res.send(JSON.parse(response));
114 | }
115 | catch(e){
116 | res.end(e.message || e.toString());
117 | }
118 | });
119 | app.post('/submit-queryPolicy', async(req,res) => {
120 | try{
121 | let policyKey = req.body.policyKeyQuery;
122 | let response = await contract.evaluateTransaction('queryPolicies', policyKey);
123 | console.log(`Transaction has been submitted, result is: ${response.toString()}`);
124 | res.send(JSON.parse(response));
125 | }
126 | catch(e){
127 | res.end(e.message || e.toString());
128 | }
129 | });
130 | } catch (error) {
131 | console.log('----->error\n');
132 | console.error(`Failed to evaluate transaction: ${error}`);
133 | process.exit(1);
134 | }
135 | }
136 | main();
137 | const port= process.env.PORT || 3000;
138 | app.listen(port, () => console.log(`app is listening on port ${port} ...`));
--------------------------------------------------------------------------------
/attributebased/javascript/invoke.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const {FileSystemWallet, Gateway} = require('fabric-network');
8 | const fs = require('fs');
9 | const path = require('path');
10 |
11 | const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
12 | const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
13 | const ccp = JSON.parse(ccpJSON);
14 |
15 | async function main() {
16 | try {
17 |
18 | // Create a new file system based wallet for managing identities.
19 | const walletPath = path.join(process.cwd(), 'wallet');
20 | const wallet = new FileSystemWallet(walletPath);
21 | console.log(`Wallet path: ${walletPath}`);
22 |
23 | // Check to see if we've already enrolled the user.
24 | const userExists = await wallet.exists('user1');
25 | if (!userExists) {
26 | console.log('An identity for the user "user1" does not exist in the wallet');
27 | console.log('Run the registerUser.js application before retrying');
28 | return;
29 | }
30 |
31 | // Create a new gateway for connecting to our peer node.
32 | const gateway = new Gateway();
33 | await gateway.connect(ccp, {wallet, identity: 'user1', discovery: {enabled: false}});
34 |
35 | // Get the network (channel) our contract is deployed to.
36 | const network = await gateway.getNetwork('mychannel');
37 |
38 | // Get the contract from the network.
39 | //TODO remove examples
40 | const contract = network.getContract('attributebased');
41 | let sara = {
42 | user: {
43 | active: true,
44 | dob: '1989-06-06',
45 | banCount: 1,
46 | group: 12,
47 | department: 'computer'
48 | }
49 | };
50 | let john = {
51 | user: {
52 | active: true,
53 | dob: '2006-05-12', // too young
54 | banCount: 4, // banned too many times
55 | group: 12
56 | }
57 | };
58 | let resource = {
59 | group: {
60 | id: 12
61 | }
62 | };
63 | <<<<<<< HEAD
64 | <<<<<<< HEAD
65 | <<<<<<< HEAD
66 | // Ask for subject key and subject values in json format
67 | //var policyKey = readline.question("What is policy key?");
68 | // var policy = readline.question("What is policy in json fromat?");
69 | // Store subject on the ledger
70 | // const result= await contract.submitTransaction('recordSubject', 'sara' , JSON.stringify(sara));
71 | const result= await contract.submitTransaction('recordResource', 'resource1' , JSON.stringify(resource));
72 | // const result= await contract.submitTransaction('recordPolicy', policyKey , JSON.stringify(policy));
73 |
74 | <<<<<<< HEAD
75 | const result= await contract.submitTransaction('PDP', 'sara', 'resource1', "can-be-admin-of-group", 'policy1' );
76 | console.log(`Transaction has been submitted, result is: ${result.toString()}`);
77 | =======
78 | // Ask for subject key and subject values in json format
79 | //var policyKey = readline.question("What is policy key?");
80 | // var policy = readline.question("What is policy in json fromat?");
81 | // Store subject on the ledger
82 | //const result= await contract.submitTransaction('recordSubject', 'sara' , JSON.stringify(sara));
83 | // const result= await contract.submitTransaction('recordResource', 'resource1' , JSON.stringify(resource));
84 | // const result= await contract.submitTransaction('recordPolicy', policyKey , JSON.stringify(policy));
85 |
86 | const result = await contract.submitTransaction('PDP', 'sara', 'resource1', 'can-be-admin-of-group', 'policy1');
87 | console.log(`Transaction has been submitted, result is: ${result.toString()}`);
88 | >>>>>>> 05456c3... lint invoke.js
89 | =======
90 | // Ask for subject key and subject values in json format
91 | //var policyKey = readline.question("What is policy key?");
92 | // var policy = readline.question("What is policy in json fromat?");
93 | // Store subject on the ledger
94 | //const result= await contract.submitTransaction('recordSubject', 'sara' , JSON.stringify(sara));
95 | //const result= await contract.submitTransaction('recordResource', 'resource1' , JSON.stringify(resource));
96 | // const result= await contract.submitTransaction('recordPolicy', policyKey , JSON.stringify(policy));
97 |
98 | const result = await contract.submitTransaction('PDP', 'initSubject', 'initResource', 'can-be-admin-of-group', 'initPolicy' );
99 | console.log(`Transaction has been submitted, result is: ${result.toString()}`);
100 | >>>>>>> 7f7d7fb... lint files
101 | =======
102 | //const result= await contract.submitTransaction('PDP', 'sara', 'resource1', "can-be-admin-of-group", 'policy1' );
103 | console.log(`Transaction has been submitted, result is: ${result.toString()}`);
104 | >>>>>>> f8ddfe2... init ledger
105 | =======
106 | // Ask for subject key and subject values in json format
107 | //var policyKey = readline.question("What is policy key?");
108 | // var policy = readline.question("What is policy in json fromat?");
109 | // Store subject on the ledger
110 | //const result= await contract.submitTransaction('recordSubject', 'sara' , JSON.stringify(sara));
111 | //const result= await contract.submitTransaction('recordResource', 'resource1' , JSON.stringify(resource));
112 | // const result= await contract.submitTransaction('recordPolicy', policyKey , JSON.stringify(policy));
113 |
114 | const result= await contract.submitTransaction('PDP', 'initSubject', 'initResource', 'can-be-admin-of-group', 'initPolicy' );
115 | console.log(`Transaction has been submitted, result is: ${result.toString()}`);
116 | >>>>>>> be638c3... eslint
117 |
118 | // console.log(result);
119 |
120 | // Disconnect from the gateway.
121 | await gateway.disconnect();
122 |
123 | } catch (error) {
124 | console.error(`Failed to submit transaction: ${error}`);
125 | process.exit(1);
126 | }
127 | }
128 |
129 | main();
130 |
--------------------------------------------------------------------------------
/attributebased/javascript/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "attributebased",
3 | "version": "0.1",
4 | "description": "Attribute based access control application implemented in JavaScript",
5 | "engines": {
6 | "node": "^8"
7 | },
8 | "scripts": {
9 | "lint": "eslint .",
10 | "test": "nyc mocha --recursive"
11 | },
12 | "engineStrict": true,
13 | "author": "Hyperledger",
14 | "license": "Apache-2.0",
15 | "dependencies": {
16 | "express": "^4.17.1",
17 | "fabric-ca-client": "~1.4.0",
18 | "fabric-network": "~1.4.0",
19 | "readline-sync": "^1.4.9"
20 | },
21 | "devDependencies": {
22 | "@theledger/fabric-mock-stub": "^4.0.0",
23 | "chai": "^4.2.0",
24 | "eslint": "^6.4.0",
25 | "mocha": "^5.2.0",
26 | "nyc": "^13.1.0",
27 | "sinon": "^7.1.1",
28 | "sinon-chai": "^3.3.0"
29 | },
30 | "nyc": {
31 | "exclude": [
32 | "coverage/**",
33 | "test/**"
34 | ],
35 | "reporter": [
36 | "text-summary",
37 | "html"
38 | ],
39 | "all": true,
40 | "check-coverage": false,
41 | "statements": 30,
42 | "branches": 30,
43 | "functions": 30,
44 | "lines": 30
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/attributebased/javascript/query.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const { FileSystemWallet, Gateway } = require('fabric-network');
8 | const fs = require('fs');
9 | const path = require('path');
10 |
11 | const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
12 | const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
13 | const ccp = JSON.parse(ccpJSON);
14 | const readline = require('readline-sync');
15 |
16 | async function main() {
17 | try {
18 |
19 | // Create a new file system based wallet for managing identities.
20 | const walletPath = path.join(process.cwd(), 'wallet');
21 | const wallet = new FileSystemWallet(walletPath);
22 | console.log(`Wallet path: ${walletPath}`);
23 |
24 | // Check to see if we've already enrolled the user.
25 | const userExists = await wallet.exists('user1');
26 | if (!userExists) {
27 | console.log('An identity for the user "user1" does not exist in the wallet');
28 | console.log('Run the registerUser.js application before retrying');
29 | return;
30 | }
31 |
32 | // Create a new gateway for connecting to our peer node.
33 | const gateway = new Gateway();
34 | await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } });
35 |
36 | // Get the network (channel) our contract is deployed to.
37 | const network = await gateway.getNetwork('mychannel');
38 |
39 | // Get the contract from the network.
40 | const contract = network.getContract('attributebased');
41 |
42 | //Ask for the attribute key and query based on requested key
43 | //var attributeKey = readline.question("What is the key you want to query?");
44 | //const result = await contract.evaluateTransaction('QueryUserAttribute', attributeKey);
45 | // const result = await contract.evaluateTransaction('queryAll');
46 | const result = await contract.evaluateTransaction('queryPolicies', 'initPolicy');
47 |
48 | console.log(`Transaction has been evaluated, result is: ${result.toString()}`);
49 | const result2 = await contract.evaluateTransaction('queryUserAttribute', 'initSubject');
50 | console.log(`Transaction has been evaluated, result is: ${result2.toString()}`);
51 |
52 |
53 |
54 | } catch (error) {
55 | console.log("----->error\n");
56 | console.error(`Failed to evaluate transaction: ${error}`);
57 | process.exit(1);
58 | }
59 | }
60 |
61 | main();
62 |
--------------------------------------------------------------------------------
/attributebased/javascript/registerUser.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const { FileSystemWallet, Gateway, X509WalletMixin } = require('fabric-network');
8 | const fs = require('fs');
9 | const path = require('path');
10 |
11 | const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
12 | const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
13 | const ccp = JSON.parse(ccpJSON);
14 |
15 | async function main() {
16 | try {
17 |
18 | // Create a new file system based wallet for managing identities.
19 | const walletPath = path.join(process.cwd(), 'wallet');
20 | const wallet = new FileSystemWallet(walletPath);
21 | console.log(`Wallet path: ${walletPath}`);
22 |
23 | // Check to see if we've already enrolled the user.
24 | const userExists = await wallet.exists('user1');
25 | if (userExists) {
26 | console.log('An identity for the user "user1" already exists in the wallet');
27 | return;
28 | }
29 |
30 | // Check to see if we've already enrolled the admin user.
31 | const adminExists = await wallet.exists('admin');
32 | if (!adminExists) {
33 | console.log('An identity for the admin user "admin" does not exist in the wallet');
34 | console.log('Run the enrollAdmin.js application before retrying');
35 | return;
36 | }
37 |
38 | // Create a new gateway for connecting to our peer node.
39 | const gateway = new Gateway();
40 | await gateway.connect(ccp, { wallet, identity: 'admin', discovery: { enabled: false } });
41 |
42 | // Get the CA client object from the gateway for interacting with the CA.
43 | const ca = gateway.getClient().getCertificateAuthority();
44 | const adminIdentity = gateway.getCurrentIdentity();
45 |
46 | // Register the user, enroll the user, and import the new identity into the wallet.
47 | const secret = await ca.register({ affiliation: 'org1.department1', enrollmentID: 'user1', role: 'client' }, adminIdentity);
48 | const enrollment = await ca.enroll({ enrollmentID: 'user1', enrollmentSecret: secret });
49 | const userIdentity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes());
50 | wallet.import('user1', userIdentity);
51 | console.log('Successfully registered and enrolled admin user "user1" and imported it into the wallet');
52 |
53 | } catch (error) {
54 | console.error(`Failed to register user "user1": ${error}`);
55 | process.exit(1);
56 | }
57 | }
58 |
59 | main();
60 |
--------------------------------------------------------------------------------
/attributebased/startFabric.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
8 | set -e
9 |
10 | # don't rewrite paths for Windows Git Bash users
11 | export MSYS_NO_PATHCONV=1
12 | starttime=$(date +%s)
13 | CC_SRC_LANGUAGE=${1:-"go"}
14 | CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]`
15 | if [ "$CC_SRC_LANGUAGE" = "javascript" ]; then
16 | CC_RUNTIME_LANGUAGE=node # chaincode runtime language is node.js
17 | CC_SRC_PATH=/opt/gopath/src/github.com/attributebased/javascript
18 | else
19 | echo The chaincode language ${CC_SRC_LANGUAGE} is not supported by this script
20 | echo Supported chaincode languages are: go, javascript, and typescript
21 | exit 1
22 | fi
23 |
24 |
25 | # clean the keystore
26 | rm -rf ./hfc-key-store
27 |
28 | # launch network; create channel and join peer to channel
29 | cd ../basic-network
30 | ./start.sh
31 |
32 |
33 | docker-compose -f ./docker-compose.yml up -d cli
34 | docker ps -a
35 |
36 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n attributebased -v 1.0 -p "$CC_SRC_PATH" -l "$CC_RUNTIME_LANGUAGE"
37 |
38 |
39 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n attributebased -l "$CC_RUNTIME_LANGUAGE" -v 1.0 -c '{"Args":[]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
40 | sleep 10
41 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n attributebased -c '{"function":"initLedger","Args":[]}'
42 |
43 | cat <
This work is licensed under a Creative Commons Attribution 4.0 International License
15 |
--------------------------------------------------------------------------------
/basic-network/config/channel.tx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledger-labs/hyperledger-fabric-based-access-control/4b7914596b0d61e9345255341bfb1a586f38f579/basic-network/config/channel.tx
--------------------------------------------------------------------------------
/basic-network/config/genesis.block:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledger-labs/hyperledger-fabric-based-access-control/4b7914596b0d61e9345255341bfb1a586f38f579/basic-network/config/genesis.block
--------------------------------------------------------------------------------
/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/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/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.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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/tlsca/ed3fd82393e95fc2c475afc113c8d2c591f745d1babc4d6d9cce0a1acc168acb_sk:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgkcI0vNVNanWltD+I
3 | VHz5V1u01+X8VOG3a5ZTLRed0MmhRANCAAQH7XcNvPyU4R8q3xeEgk4x1MpH3kGd
4 | 3qksGJZAqmBdS8M2ntfKPewYs3aM/wQTI4rAKCREss1Tqxo+5xg+xM8F
5 | -----END PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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/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/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/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-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/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-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/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/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/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 | - ./../chaincode/:/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-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-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/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-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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/chaincode/.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 |
--------------------------------------------------------------------------------
/chaincode/.eslintignore:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 |
5 | coverage
6 |
--------------------------------------------------------------------------------
/chaincode/.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 | "space-infix-ops": ["error", {"int32Hint": false}],
17 | indent: ['error', 4],
18 | 'linebreak-style': ['error', 'unix'],
19 | quotes: ['error', 'single'],
20 | semi: ['error', 'always'],
21 | 'no-unused-vars': ['error', { args: 'none' }],
22 | 'no-console': 'off',
23 | curly: 'error',
24 | eqeqeq: 'error',
25 | 'no-throw-literal': 'error',
26 | strict: 'error',
27 | 'no-var': 'error',
28 | 'dot-notation': 'error',
29 | 'no-tabs': 'error',
30 | 'no-trailing-spaces': 'error',
31 | 'no-use-before-define': 'error',
32 | 'no-useless-call': 'error',
33 | 'no-with': 'error',
34 | 'operator-linebreak': 'error',
35 | yoda: 'error',
36 | 'quote-props': ['error', 'as-needed']
37 | }
38 | };
39 |
--------------------------------------------------------------------------------
/chaincode/.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 |
--------------------------------------------------------------------------------
/chaincode/data/policy.json:
--------------------------------------------------------------------------------
1 | {
2 | "attributes": {
3 | "user": {
4 | "active": "Active",
5 | "banCount": "Times banned",
6 | "dob": "Date of birth",
7 | "group": "Group ID"
8 | },
9 | "group": {
10 | "id": "Group ID"
11 | }
12 | },
13 | "rules": {
14 | "can-be-admin-of-group": {
15 | "attributes": {
16 | "user.active": {
17 | "comparison_type": "boolean",
18 | "comparison": "boolAnd",
19 | "value": true
20 | },
21 | "user.dob": {
22 | "comparison_type": "datetime",
23 | "comparison": "isLessRecentThan",
24 | "value": "-21Y"
25 | },
26 | "user.banCount": {
27 | "comparison_type": "numeric",
28 | "comparison": "isLesserThanEqualTo",
29 | "value": 1
30 | },
31 | "user.group": {
32 | "comparison_target": "group",
33 | "comparison_type": "numeric",
34 | "comparison": "isStrictlyEqual",
35 | "field": "id"
36 | }
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/chaincode/data/resource.json:
--------------------------------------------------------------------------------
1 | {"group":{"id":12}}
2 |
--------------------------------------------------------------------------------
/chaincode/data/subject.json:
--------------------------------------------------------------------------------
1 | {"user":{"active":true,"dob":"1989-06-06","banCount":1,"group":12,"department":"computer"}}
2 |
--------------------------------------------------------------------------------
/chaincode/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | 'use strict';
6 |
7 | const abacFabric = require('./lib/attributebased');
8 |
9 | module.exports.AttributeBased = abacFabric;
10 | module.exports.contracts = [ abacFabric ];
11 |
--------------------------------------------------------------------------------
/chaincode/ledger-api/state.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | class State {
9 |
10 | constructor(stateClass, key) {
11 | this.class = stateClass;
12 | this.key = key;
13 | }
14 |
15 | getClass() {
16 | return this.class;
17 | }
18 |
19 | getKey() {
20 | return this.key;
21 | }
22 |
23 | serialize() {
24 | return State.serialize(this);
25 | }
26 |
27 | static serialize(object) {
28 | return Buffer.from(JSON.stringify(object));
29 | }
30 |
31 | static deserialize(data) {
32 | return JSON.parse(data.toString());
33 | //TODO create object from string?
34 | }
35 | }
36 |
37 | module.exports = State;
38 |
--------------------------------------------------------------------------------
/chaincode/ledger-api/statelist.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 |
5 | */
6 |
7 | 'use strict';
8 | const State = require('./state.js');
9 |
10 | class StateList {
11 |
12 | constructor(ctx, listName) {
13 | this.ctx = ctx;
14 | this.name = listName;
15 | }
16 |
17 | async addState(key, data) {
18 | //TODO: check if state to be added already exists
19 | await this.ctx.stub.putState(key, State.serialize(data));
20 | }
21 |
22 | async checkKey(key) {
23 | const iterator = await this.ctx.stub.getStateByRange('','');
24 | const allKeys = [];
25 |
26 |
27 | // eslint-disable-next-line no-constant-condition
28 | while (true) {
29 | let res = await iterator.next();
30 | if (res.value && res.value.value.toString()) {
31 | const Key = res.value.key;
32 | allKeys.push(Key);
33 | }
34 | if (res.done) {
35 | await iterator.close();
36 | break;
37 | }
38 | }
39 |
40 | allKeys.forEach(element => {
41 | if (element === key) {
42 | throw new Error(`${key} is already exist you can update subject attribute using UpdateSubject function`);
43 | }
44 | });
45 |
46 | return true;
47 | }
48 |
49 | async getState(key) {
50 | let data = await this.ctx.stub.getState(key);
51 | if (data && data.toString()) {
52 | return State.deserialize(data);
53 | } else {
54 | return null;
55 | }
56 | }
57 |
58 | async updateState(key,state) {
59 | await this.ctx.stub.putState(key, State.serialize(state));
60 | }
61 |
62 | }
63 |
64 | module.exports = StateList;
65 |
--------------------------------------------------------------------------------
/chaincode/lib/Policy.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | // Utility class for ledger state
9 | const State = require('./../ledger-api/state.js');
10 |
11 | class Policy extends State {
12 |
13 | constructor(obj) {
14 | super(Policy.getClass(), obj.key);
15 | Object.assign(this, obj);
16 | }
17 |
18 | getKey() {
19 | return this.key();
20 | }
21 |
22 | setKey(key) {
23 | this.key = key;
24 | }
25 |
26 | getData() {
27 | return this.data;
28 | }
29 |
30 | setData(data) {
31 | this.data = data;
32 | }
33 | static fromBuffer(buffer) {
34 | return State.deserialize(buffer);
35 | }
36 |
37 | toBuffer() {
38 | return Buffer.from(JSON.stringify(this));
39 | }
40 |
41 | static createInstance( key, data ) {
42 | return new Policy({ key, data });
43 | }
44 |
45 | static getClass() {
46 | return 'org.example.Policy';
47 | }
48 | }
49 |
50 | module.exports = Policy;
51 |
--------------------------------------------------------------------------------
/chaincode/lib/PolicyList.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | // Utility class for collections of ledger states -- a state list
9 | const StateList = require('./../ledger-api/statelist.js');
10 |
11 | class PolicyList extends StateList {
12 |
13 | constructor(ctx) {
14 | super(ctx, 'org.example.Policy');
15 | }
16 |
17 | async addPolicy(policy) {
18 | return this.addState(policy.key, policy.data);
19 | }
20 |
21 | async updatePolicy(key, policy) {
22 | return this.updateState(key, policy);
23 | }
24 |
25 | async getPolicy(key) {
26 | return this.getState(key);
27 | }
28 |
29 | }
30 |
31 |
32 | module.exports = PolicyList;
33 |
--------------------------------------------------------------------------------
/chaincode/lib/Resource.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | // Utility class for ledger state
9 | const State = require('./../ledger-api/state.js');
10 |
11 | class Resource extends State {
12 |
13 | constructor(obj) {
14 | super(Resource.getClass(), obj.key);
15 | Object.assign(this, obj);
16 | }
17 |
18 | getKey() {
19 | return this.key();
20 | }
21 |
22 |
23 | setKey(key) {
24 | this.key = key;
25 | }
26 |
27 | getData() {
28 | return this.data;
29 | }
30 |
31 | setData(data) {
32 | this.data = data;
33 | }
34 | static fromBuffer(buffer) {
35 | return Resource.deserialize(buffer);
36 | }
37 |
38 | toBuffer() {
39 | return Buffer.from(JSON.stringify(this));
40 | }
41 |
42 | static createInstance( key, data ) {
43 | return new Resource({ key, data });
44 | }
45 |
46 | static getClass() {
47 | return 'org.example.Resource';
48 | }
49 | }
50 |
51 | module.exports = Resource;
52 |
--------------------------------------------------------------------------------
/chaincode/lib/ResourceList.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | // Utility class for collections of ledger states -- a state list
9 | const StateList = require('./../ledger-api/statelist.js');
10 |
11 | class ResourceList extends StateList {
12 |
13 | constructor(ctx) {
14 | super(ctx, 'org.example.Resource');
15 | }
16 |
17 | async addResource(resource) {
18 | return this.addState(resource.key, resource.data);
19 | }
20 |
21 | async updateResource(key, resource) {
22 | return this.updateState(key, resource);
23 | }
24 |
25 | async getResource(key) {
26 | return this.getState(key);
27 | }
28 |
29 | }
30 |
31 |
32 | module.exports = ResourceList;
33 |
--------------------------------------------------------------------------------
/chaincode/lib/Subject.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | const State = require('./../ledger-api/state.js');
9 |
10 | class Subject extends State {
11 |
12 | constructor(obj) {
13 | super(Subject.getClass(), obj.key);
14 | Object.assign(this, obj);
15 | }
16 |
17 | getKey() {
18 | return this.key();
19 | }
20 |
21 | setKey(key) {
22 | this.key = key;
23 | }
24 |
25 | getData() {
26 | return this.data;
27 | }
28 |
29 | setData(data) {
30 | this.data = data;
31 | }
32 | static fromBuffer(buffer) {
33 | return Subject.deserialize(buffer);
34 | }
35 |
36 | toBuffer() {
37 | return Buffer.from(JSON.stringify(this));
38 | }
39 |
40 | static createInstance( key, data ) {
41 | return new Subject({ key, data } );
42 | }
43 |
44 | static getClass() {
45 | return 'org.example.Subject';
46 | }
47 | }
48 |
49 | module.exports = Subject;
50 |
--------------------------------------------------------------------------------
/chaincode/lib/SubjectList.js:
--------------------------------------------------------------------------------
1 | /*
2 | SPDX-License-Identifier: Apache-2.0
3 | Adapted from https://github.com/hyperledger/fabric-samples
4 | */
5 |
6 | 'use strict';
7 |
8 | // Utility class for collections of ledger states -- a state list
9 | const StateList = require('./../ledger-api/statelist.js');
10 |
11 | class SubjectList extends StateList {
12 |
13 | constructor(ctx) {
14 | super(ctx, 'org.example.Subject');
15 | }
16 |
17 | async addSubject(sub) {
18 | return this.addState(sub.key, sub.data);
19 | }
20 |
21 | async updateSubject(key, subject) {
22 | return this.updateState(key, subject);
23 | }
24 |
25 | async getSubject(key) {
26 | return this.getState(key);
27 | }
28 |
29 | }
30 |
31 |
32 | module.exports = SubjectList;
33 |
--------------------------------------------------------------------------------
/chaincode/lib/attributebased.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 | 'use strict';
5 | //import {subjectAttribute} from './lib/data/policy.json';
6 | const { Contract, Context } = require('fabric-contract-api');
7 | const NodeAbac = require('node-abac');
8 | const path = require('path');
9 | const fs = require('fs');
10 |
11 | const policyDataPath = path.join(process.cwd(), './data/policy.json');
12 | const policyDataJson = fs.readFileSync(policyDataPath, 'utf8');
13 | const Policy = require('./Policy.js');
14 | const PolicyList = require('./PolicyList.js');
15 |
16 | const subjectDataPath = path.join(process.cwd(), './data/subject.json');
17 | const subjectAttributeJSON = fs.readFileSync(subjectDataPath, 'utf8');
18 | const Subject = require('./Subject.js');
19 | const SubjectList = require('./SubjectList.js');
20 |
21 | const resourceDataPath = path.join(process.cwd(), './data/resource.json');
22 | const resourceJSON = fs.readFileSync(resourceDataPath, 'utf8');
23 | const Resource = require('./Resource.js');
24 | const ResourceList = require('./ResourceList.js');
25 |
26 | class abacContext extends Context {
27 |
28 | constructor() {
29 | super();
30 | // All Citius logs are held in a list
31 | this.subjectList = new SubjectList(this);
32 | this.policyList = new PolicyList(this);
33 | this.resourceList = new ResourceList(this);
34 | }
35 | }
36 |
37 | class abacFabric extends Contract {
38 | constructor() {
39 | // Unique namespace when multiple contracts per chaincode file
40 | super('org.example.abacFabric');
41 | }
42 |
43 | createContext() {
44 | return new abacContext();
45 | }
46 |
47 | // Initialize ledger
48 | async initLedger(ctx) {
49 | console.info('============= START : Initialize Ledger ===========');
50 | await this.recordPolicy(ctx,'initPolicy', policyDataJson);
51 | await this.recordSubject(ctx,'initSubject', subjectAttributeJSON);
52 | await this.recordResource(ctx, 'initResource', resourceJSON);
53 | console.info('============= END : Initialize Ledger ===========');
54 | }
55 | //Store subject attributes on the legder
56 | async recordSubject(ctx, subjectKey, subject) {
57 | let sub = Subject.createInstance(subjectKey, subject);
58 | await ctx.subjectList.addSubject(sub);
59 | }
60 |
61 | //Update the existing subject attributes
62 | async updateSubject(ctx, subjectKey, newSubject){
63 | await ctx.subjectList.updateSubject(subjectKey,newSubject);
64 | }
65 |
66 | async getSubject(ctx, subjectKey) {
67 | return await ctx.subjectList.getSubject(subjectKey);
68 |
69 | }
70 | //Store subject attributes on the legder
71 | async recordPolicy(ctx, policyKey, policyData) {
72 | let policy = Policy.createInstance(policyKey, policyData);
73 | return await ctx.policyList.addPolicy(policy);
74 | }
75 |
76 | //Update the existing subject attributes
77 | async updatePolicy(ctx, policyKey, newPolicy){
78 | await ctx.policyList.updatePolicy(policyKey,newPolicy);
79 | }
80 |
81 | async getPolicy(ctx, policyKey) {
82 | return await ctx.policyList.getPolicy(policyKey);
83 | }
84 | //Store subject attributes on the legder
85 | async recordResource(ctx, resourceKey, resourceData) {
86 | let resource = Resource.createInstance(resourceKey, resourceData);
87 | await ctx.resourceList.addResource(resource);
88 | }
89 |
90 | //Update the existing subject attributes
91 | async updateResource(ctx, resourceKey, newResource){
92 | await ctx.resourceList.updateResource(resourceKey,newResource);
93 | }
94 |
95 | async getResource(ctx, resourceKey) {
96 | return await ctx.resourceList.getResource(resourceKey);
97 | }
98 |
99 | // Policy Decision Point (PDP)
100 | async PDP (ctx, subjectKey, resourceKey, rule, policyKey){
101 | let policyBytes = await ctx.stub.getState(policyKey);
102 | if (!policyBytes || policyBytes.length === 0){
103 | throw new Error(`${policyKey} does not exist`);
104 | }
105 | let policy = policyBytes.toString();
106 | let policyParsed = JSON.parse(policy);
107 | while (typeof policyParsed === 'string'){
108 | policyParsed = JSON.parse(policyParsed);
109 | }
110 | const Abac = new NodeAbac(policyParsed);
111 |
112 | let subjectBytes = await ctx.stub.getState(subjectKey);
113 | if (!subjectBytes || subjectBytes.length === 0){
114 | throw new Error(`${subjectKey} does not exist`);
115 | }
116 | let subject = subjectBytes.toString();
117 | let subjectParsed = JSON.parse(subject);
118 | while(typeof subjectParsed === 'string'){
119 | subjectParsed = JSON.parse(subjectParsed);
120 | }
121 | let resourceBytes = await ctx.stub.getState(resourceKey);
122 | if (!resourceBytes || resourceBytes.length === 0){
123 | throw new Error(`${resourceKey} does not exist`);
124 | }
125 | let resourceParsed = JSON.parse(resourceBytes.toString());
126 | while(typeof resourceParsed === 'string'){
127 | resourceParsed = JSON.parse(resourceParsed);
128 | }
129 | return Abac.enforce(rule, subjectParsed, resourceParsed);
130 | }
131 |
132 | async decide (ctx, subjectKey, resourceKey, rule, policyKey){
133 | let policy = JSON.parse(await this.getPolicy(ctx,policyKey));
134 | if (!policy || policy.length === 0){
135 | throw new Error(`${policyKey} does not exist`);
136 | }
137 |
138 | const abacNode = new NodeAbac(policy);
139 |
140 | let subject = JSON.parse(await this.getSubject(ctx, subjectKey));
141 | if (!subject || subject.length === 0){
142 | throw new Error(`${subjectKey} does not exist`);
143 | }
144 |
145 | let resource = JSON.parse(await this.getResource(ctx,resourceKey));
146 | if (!resource || resource.length === 0){
147 | throw new Error(`${resourceKey} does not exist`);
148 | }
149 |
150 | return abacNode.enforce(rule, subject, resource);
151 | }
152 |
153 |
154 | //Query all data
155 | //TODO Update
156 | async queryAll(ctx) {
157 | const iterator = await ctx.stub.getStateByRange('','');
158 |
159 | const allResults = [];
160 | //let allKeys = [];
161 | // eslint-disable-next-line no-constant-condition
162 | while (true) {
163 | const res = await iterator.next();
164 |
165 | if (res.value && res.value.value.toString()) {
166 | console.log(res.value.value.toString('utf8'));
167 |
168 | const Key = res.value.key;
169 | let Record;
170 | try {
171 | Record = JSON.parse(res.value.value.toString('utf8'));
172 | } catch (err) {
173 | console.log(err);
174 | Record = res.value.value.toString('utf8');
175 | }
176 |
177 | allResults.push({ Key, Record });
178 | //allKeys.push(Key);
179 | }
180 | if (res.done) {
181 | console.log('end of data');
182 | await iterator.close();
183 | console.info(allResults);
184 | return JSON.stringify(allResults);
185 | }
186 | }
187 | }
188 | }
189 |
190 | module.exports = abacFabric;
191 |
--------------------------------------------------------------------------------
/chaincode/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "abacFabric",
3 | "version": "1.0.0",
4 | "description": "Attribute based access control contract implemented in JavaScript",
5 | "main": "index.js",
6 | "engines": {
7 | "node": ">=8",
8 | "npm": ">=5"
9 | },
10 | "scripts": {
11 | "lint": "eslint ./ --fix",
12 | "pretest": "npm run lint",
13 | "test": "nyc mocha --recursive",
14 | "start": "fabric-chaincode-node start"
15 | },
16 | "engineStrict": true,
17 | "author": "Hyperledger",
18 | "license": "Apache-2.0",
19 | "dependencies": {
20 | "fabric-contract-api": "2.0.0",
21 | "fabric-shim": "2.0.0",
22 | "node-abac": "0.0.7"
23 | },
24 | "devDependencies": {
25 | "chai": "^4.1.2",
26 | "eslint": "^4.19.1",
27 | "mocha": "^5.2.0",
28 | "nyc": "^12.0.2",
29 | "sinon": "^6.0.0",
30 | "sinon-chai": "^3.2.0"
31 | },
32 | "nyc": {
33 | "exclude": [
34 | "coverage/**",
35 | "test/**"
36 | ],
37 | "reporter": [
38 | "text-summary",
39 | "html"
40 | ],
41 | "all": true,
42 | "check-coverage": true,
43 | "statements": 100,
44 | "branches": 100,
45 | "functions": 100,
46 | "lines": 100
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/images/architecture3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledger-labs/hyperledger-fabric-based-access-control/4b7914596b0d61e9345255341bfb1a586f38f579/images/architecture3.png
--------------------------------------------------------------------------------
/scripts/bootstrap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright IBM Corp. All Rights Reserved.
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | # if version not passed in, default to latest released version
9 | export VERSION=1.4.0
10 | # if ca version not passed in, default to latest released version
11 | export CA_VERSION=$VERSION
12 | # current version of thirdparty images (couchdb, kafka and zookeeper) released
13 | export THIRDPARTY_IMAGE_VERSION=0.4.14
14 | export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')")
15 | export MARCH=$(uname -m)
16 |
17 | # ensure we're in the fabric-samples directory
18 | dir=`basename $PWD`
19 | if [ "${dir}" == "scripts" ]; then
20 | cd ..
21 | fi
22 |
23 | dir=`basename $PWD`
24 | if [ "${dir}" != "fabric-samples" ]; then
25 | echo "You should run this script from the fabric-samples root directory."
26 | exit 1
27 | fi
28 |
29 | printHelp() {
30 | echo "Usage: bootstrap.sh [] [] [][-d -b]"
31 | echo
32 | echo "-d - bypass docker image download"
33 | echo "-b - bypass download of platform-specific binaries"
34 | echo
35 | echo "e.g. bootstrap.sh 1.4.0 1.4.0 0.4.14"
36 | echo "would download docker images and binaries for version 1.4.0 (fabric) 1.4.0 (fabric-ca) 0.4.14 (thirdparty)"
37 | }
38 |
39 | dockerFabricPull() {
40 | local FABRIC_TAG=$1
41 | for IMAGES in peer orderer ccenv tools; do
42 | echo "==> FABRIC IMAGE: $IMAGES"
43 | echo
44 | docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
45 | docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
46 | done
47 | }
48 |
49 | dockerThirdPartyImagesPull() {
50 | local THIRDPARTY_TAG=$1
51 | for IMAGES in couchdb kafka zookeeper; do
52 | echo "==> THIRDPARTY DOCKER IMAGE: $IMAGES"
53 | echo
54 | docker pull hyperledger/fabric-$IMAGES:$THIRDPARTY_TAG
55 | docker tag hyperledger/fabric-$IMAGES:$THIRDPARTY_TAG hyperledger/fabric-$IMAGES
56 | done
57 | }
58 |
59 | dockerCaPull() {
60 | local CA_TAG=$1
61 | echo "==> FABRIC CA IMAGE"
62 | echo
63 | docker pull hyperledger/fabric-ca:$CA_TAG
64 | docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
65 | }
66 |
67 | # Incrementally downloads the .tar.gz file locally first, only decompressing it
68 | # after the download is complete. This is slower than binaryDownload() but
69 | # allows the download to be resumed.
70 | binaryIncrementalDownload() {
71 | local BINARY_FILE=$1
72 | local URL=$2
73 | curl -f -s -C - ${URL} -o ${BINARY_FILE} || rc=$?
74 | # Due to limitations in the current Nexus repo:
75 | # curl returns 33 when there's a resume attempt with no more bytes to download
76 | # curl returns 2 after finishing a resumed download
77 | # with -f curl returns 22 on a 404
78 | if [ "$rc" = 22 ]; then
79 | # looks like the requested file doesn't actually exist so stop here
80 | return 22
81 | fi
82 | if [ -z "$rc" ] || [ $rc -eq 33 ] || [ $rc -eq 2 ]; then
83 | # The checksum validates that RC 33 or 2 are not real failures
84 | echo "==> File downloaded. Verifying the md5sum..."
85 | localMd5sum=$(md5sum ${BINARY_FILE} | awk '{print $1}')
86 | remoteMd5sum=$(curl -s ${URL}.md5)
87 | if [ "$localMd5sum" == "$remoteMd5sum" ]; then
88 | echo "==> Extracting ${BINARY_FILE}..."
89 | tar xzf ./${BINARY_FILE} --overwrite
90 | echo "==> Done."
91 | rm -f ${BINARY_FILE} ${BINARY_FILE}.md5
92 | else
93 | echo "Download failed: the local md5sum is different from the remote md5sum. Please try again."
94 | rm -f ${BINARY_FILE} ${BINARY_FILE}.md5
95 | exit 1
96 | fi
97 | else
98 | echo "Failure downloading binaries (curl RC=$rc). Please try again and the download will resume from where it stopped."
99 | exit 1
100 | fi
101 | }
102 |
103 | # This will attempt to download the .tar.gz all at once, but will trigger the
104 | # binaryIncrementalDownload() function upon a failure, allowing for resume
105 | # if there are network failures.
106 | binaryDownload() {
107 | local BINARY_FILE=$1
108 | local URL=$2
109 | echo "===> Downloading: " ${URL}
110 | # Check if a previous failure occurred and the file was partially downloaded
111 | if [ -e ${BINARY_FILE} ]; then
112 | echo "==> Partial binary file found. Resuming download..."
113 | binaryIncrementalDownload ${BINARY_FILE} ${URL}
114 | else
115 | curl ${URL} | tar xz || rc=$?
116 | if [ ! -z "$rc" ]; then
117 | echo "==> There was an error downloading the binary file. Switching to incremental download."
118 | echo "==> Downloading file..."
119 | binaryIncrementalDownload ${BINARY_FILE} ${URL}
120 | else
121 | echo "==> Done."
122 | fi
123 | fi
124 | }
125 |
126 | binariesInstall() {
127 | echo "===> Downloading version ${FABRIC_TAG} platform specific fabric binaries"
128 | binaryDownload ${BINARY_FILE} https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/${BINARY_FILE}
129 | if [ $? -eq 22 ]; then
130 | echo
131 | echo "------> ${FABRIC_TAG} platform specific fabric binary is not available to download <----"
132 | echo
133 | fi
134 |
135 | echo "===> Downloading version ${CA_TAG} platform specific fabric-ca-client binary"
136 | binaryDownload ${CA_BINARY_FILE} https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/${ARCH}-${CA_VERSION}/${CA_BINARY_FILE}
137 | if [ $? -eq 22 ]; then
138 | echo
139 | echo "------> ${CA_TAG} fabric-ca-client binary is not available to download (Available from 1.1.0-rc1) <----"
140 | echo
141 | fi
142 | }
143 |
144 | dockerInstall() {
145 | which docker >& /dev/null
146 | NODOCKER=$?
147 | if [ "${NODOCKER}" == 0 ]; then
148 | echo "===> Pulling fabric Images"
149 | dockerFabricPull ${FABRIC_TAG}
150 | echo "===> Pulling fabric ca Image"
151 | dockerCaPull ${CA_TAG}
152 | echo "===> Pulling thirdparty docker images"
153 | dockerThirdPartyImagesPull ${THIRDPARTY_TAG}
154 | echo
155 | echo "===> List out hyperledger docker images"
156 | docker images | grep hyperledger*
157 | else
158 | echo "========================================================="
159 | echo "Docker not installed, bypassing download of Fabric images"
160 | echo "========================================================="
161 | fi
162 | }
163 |
164 | DOCKER=true
165 | SAMPLES=true
166 | BINARIES=true
167 |
168 | # Parse commandline args pull out
169 | # version and/or ca-version strings first
170 | if echo $1 | grep -q '\d'; then
171 | VERSION=$1;shift
172 | if echo $1 | grep -q '\d'; then
173 | CA_VERSION=$1;shift
174 | if echo $1 | grep -q '\d'; then
175 | THIRDPARTY_IMAGE_VERSION=$1;shift
176 | fi
177 | fi
178 | fi
179 |
180 | # prior to 1.1.0 architecture was determined by uname -m
181 | if [[ $VERSION =~ ^1\.[0]\.* ]]; then
182 | export FABRIC_TAG=${MARCH}-${VERSION}
183 | export CA_TAG=${MARCH}-${CA_VERSION}
184 | export THIRDPARTY_TAG=${MARCH}-${THIRDPARTY_IMAGE_VERSION}
185 | else
186 | # starting with 1.2.0, multi-arch images will be default
187 | : ${CA_TAG:="$CA_VERSION"}
188 | : ${FABRIC_TAG:="$VERSION"}
189 | : ${THIRDPARTY_TAG:="$THIRDPARTY_IMAGE_VERSION"}
190 | fi
191 |
192 | BINARY_FILE=hyperledger-fabric-${ARCH}-${VERSION}.tar.gz
193 | CA_BINARY_FILE=hyperledger-fabric-ca-${ARCH}-${CA_VERSION}.tar.gz
194 |
195 | # then parse opts
196 | while getopts "h?db" opt; do
197 | case "$opt" in
198 | h|\?)
199 | printHelp
200 | exit 0
201 | ;;
202 | d) DOCKER=false
203 | ;;
204 | b) BINARIES=false
205 | ;;
206 | esac
207 | done
208 |
209 | if [ "$BINARIES" == "true" ]; then
210 | echo
211 | echo "Installing Hyperledger Fabric binaries"
212 | echo
213 | binariesInstall
214 | fi
215 | if [ "$DOCKER" == "true" ]; then
216 | echo
217 | echo "Installing Hyperledger Fabric docker images"
218 | echo
219 | dockerInstall
220 | fi
221 |
--------------------------------------------------------------------------------
/startFabric.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
8 | set -e
9 |
10 | # don't rewrite paths for Windows Git Bash users
11 | export MSYS_NO_PATHCONV=1
12 | starttime=$(date +%s)
13 |
14 | # clean the keystore
15 | rm -rf ./hfc-key-store
16 |
17 | # launch network; create channel and join peer to channel
18 | cd basic-network
19 | ./start.sh
20 |
21 | docker-compose -f ./docker-compose.yml up -d cli
22 |
23 | #docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n abacFabric -v 1.0 -p "$CC_SRC_PATH" -l javascript
24 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer lifecycle chaincode package abac_fabric.tar.gz --lang node --path /opt/gopath/src/chaincode --label abacFabric
25 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer lifecycle chaincode install abac_fabric.tar.gz
26 | export PACKAGE_ID=$(docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer lifecycle chaincode queryinstalled 2>&1 | awk -F "[, ]+" '/Label: /{print $3}')
27 |
28 | #docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n abacFabric -l javascript -v 1.0 -c '{"Args":[]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
29 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer lifecycle chaincode approveformyorg --channelID mychannel --name abacFabric -v 1 --package-id $PACKAGE_ID --sequence 1 --signature-policy "AND ('Org1MSP.member')"
30 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name abacFabric -v 1 --sequence 1 --waitForEvent --signature-policy "AND ('Org1MSP.member')"
31 |
32 | docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n abacFabric -c '{"function":"initLedger","Args":[]}'
33 |
34 |
35 |
36 | cat <.txt"
40 | outputFormat: TEXT
41 | logEnd: true
42 | - type: record-rate
43 | opts:
44 | rateController:
45 | type: fixed-rate
46 | opts:
47 | tps: 50
48 | pathTemplate: "../tx_records_client.be.bin"
49 | outputFormat: BIN_BE
50 | logEnd: true
51 | - type: record-rate
52 | opts:
53 | rateController:
54 | type: fixed-rate
55 | opts:
56 | tps: 50
57 | pathTemplate: "../tx_records_client.le.bin"
58 | outputFormat: BIN_LE
59 | logEnd: true
60 | - type: replay-rate
61 | opts:
62 | pathTemplate: "../tx_records_client.txt"
63 | inputFormat: TEXT
64 | logWarnings: true
65 | defaultSleepTime: 50
66 | - type: replay-rate
67 | opts:
68 | pathTemplate: "../tx_records_client.be.bin"
69 | inputFormat: BIN_BE
70 | logWarnings: true
71 | defaultSleepTime: 50
72 | - type: replay-rate
73 | opts:
74 | pathTemplate: "../tx_records_client.le.bin"
75 | inputFormat: BIN_LE
76 | logWarnings: true
77 | defaultSleepTime: 50
78 | arguments:
79 | money: 10000
80 | callback: benchmark/simple/open.js
81 | monitor:
82 | type:
83 | - docker
84 | - process
85 | docker:
86 | name:
87 | - all
88 | process:
89 | - command: node
90 | arguments: local-client.js
91 | multiOutput: avg
92 | interval: 1
93 |
--------------------------------------------------------------------------------
/test/benchmark/config-sawtooth-feedback.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | name: simple
18 | description: This is an example benchmark for test
19 | clients:
20 | type: local
21 | number: 1
22 | rounds:
23 | - label: open
24 | txNumber:
25 | - 2000
26 | rateControl:
27 | - type: fixed-feedback-rate
28 | opts:
29 | tps: 30
30 | sleep_time: 200
31 | unfinished_per_client: 5
32 | arguments:
33 | money: 10000
34 | txnPerBatch: 1
35 | callback: benchmark/simple/open.js
36 | - label: query
37 | txNumber:
38 | - 5
39 | rateControl:
40 | - type: fixed-rate
41 | opts:
42 | tps: 1
43 | callback: benchmark/simple/query.js
44 | monitor:
45 | type: docker
46 | docker:
47 | name:
48 | - all
49 | interval: 1
50 |
--------------------------------------------------------------------------------
/test/benchmark/config-sawtooth.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | name: simple
18 | description: This is an example benchmark for test
19 | clients:
20 | type: local
21 | number: 1
22 | rounds:
23 | - label: open
24 | txNumber:
25 | - 50
26 | rateControl:
27 | - type: fixed-rate
28 | opts:
29 | tps: 10
30 | arguments:
31 | money: 10000
32 | txnPerBatch: 10
33 | callback: benchmark/simple/open.js
34 | - label: query
35 | txNumber:
36 | - 5
37 | rateControl:
38 | - type: fixed-rate
39 | opts:
40 | tps: 1
41 | callback: benchmark/simple/query.js
42 | monitor:
43 | type: docker
44 | docker:
45 | name:
46 | - all
47 | interval: 1
48 |
--------------------------------------------------------------------------------
/test/benchmark/config-zookeeper.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | name: simple
18 | description: This is an example benchmark for test, to test the backend DLT's
19 | performance with simple account opening & querying transactions
20 | clients:
21 | type: zookeeper
22 | zoo:
23 | server: 10.229.42.159:2181
24 | clientsPerHost: 5
25 | rounds:
26 | - label: open
27 | txNumber:
28 | - 2000
29 | rateControl:
30 | - type: fixed-rate
31 | opts:
32 | tps: 200
33 | arguments:
34 | money: 10000
35 | callback: benchmark/simple/open.js
36 | - label: query
37 | txNumber:
38 | - 2000
39 | rateControl:
40 | - type: fixed-rate
41 | opts:
42 | tps: 200
43 | callback: benchmark/simple/query.js
44 | monitor:
45 | type:
46 | - docker
47 | docker:
48 | name:
49 | - all
50 | interval: 1
51 |
--------------------------------------------------------------------------------
/test/benchmark/config.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | clients:
18 | type: local
19 | number: 10
20 | rounds:
21 | - label: addSubject
22 | txNumber:
23 | - 1000
24 | rateControl:
25 | - type: fixed-rate
26 | opts:
27 | tps: 100
28 | callback: benchmark/simple/addsubject.js
29 | - label: addResource
30 | txNumber:
31 | - 1000
32 | rateControl:
33 | - type: fixed-rate
34 | opts:
35 | tps: 100
36 | callback: benchmark/simple/addresource.js
37 | - label: addPolicy
38 | txNumber:
39 | - 1000
40 | rateControl:
41 | - type: fixed-rate
42 | opts:
43 | tps: 100
44 | callback: benchmark/simple/addpolicy.js
45 | - label: Policy-decision
46 | txNumber:
47 | - 10
48 | rateControl:
49 | - type: fixed-rate
50 | opts:
51 | tps: 10
52 | callback: benchmark/simple/pdp.js
53 | - label: query
54 | txNumber:
55 | - 10
56 | rateControl:
57 | - type: fixed-rate
58 | opts:
59 | tps: 10
60 | callback: benchmark/simple/query.js
61 | monitor:
62 | type:
63 | - docker
64 | - process
65 | docker:
66 | name:
67 | - all
68 | process:
69 | - command: node
70 | arguments: local-client.js
71 | multiOutput: avg
72 | interval: 1
--------------------------------------------------------------------------------
/test/benchmark/config_linear.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | name: simple
18 | description: This is an example benchmark for test, to test the backend DLT's
19 | performance with simple account opening & querying transactions
20 | clients:
21 | type: local
22 | number: 5
23 | rounds:
24 | - label: open
25 | txNumber:
26 | - 10000
27 | - 10000
28 | - 10000
29 | - 10000
30 | - 10000
31 | - 10000
32 | - 10000
33 | - 10000
34 | - 10000
35 | - 10000
36 | - 10000
37 | - 10000
38 | - 10000
39 | - 10000
40 | - 10000
41 | - 10000
42 | - 10000
43 | - 10000
44 | - 10000
45 | - 10000
46 | rateControl:
47 | - type: fixed-rate
48 | opts:
49 | tps: 100
50 | - type: fixed-rate
51 | opts:
52 | tps: 200
53 | - type: fixed-rate
54 | opts:
55 | tps: 300
56 | - type: fixed-rate
57 | opts:
58 | tps: 400
59 | - type: fixed-rate
60 | opts:
61 | tps: 500
62 | - type: fixed-rate
63 | opts:
64 | tps: 600
65 | - type: fixed-rate
66 | opts:
67 | tps: 700
68 | - type: fixed-rate
69 | opts:
70 | tps: 800
71 | - type: fixed-rate
72 | opts:
73 | tps: 900
74 | - type: fixed-rate
75 | opts:
76 | tps: 1000
77 | - type: fixed-rate
78 | opts:
79 | tps: 1100
80 | - type: fixed-rate
81 | opts:
82 | tps: 1200
83 | - type: fixed-rate
84 | opts:
85 | tps: 1300
86 | - type: fixed-rate
87 | opts:
88 | tps: 1400
89 | - type: fixed-rate
90 | opts:
91 | tps: 1500
92 | - type: fixed-rate
93 | opts:
94 | tps: 1600
95 | - type: fixed-rate
96 | opts:
97 | tps: 1700
98 | - type: fixed-rate
99 | opts:
100 | tps: 1800
101 | - type: fixed-rate
102 | opts:
103 | tps: 1900
104 | - type: fixed-rate
105 | opts:
106 | tps: 2000
107 | arguments:
108 | money: 10000
109 | callback: benchmark/simple/open.js
110 | - label: query
111 | txNumber:
112 | - 1000
113 | - 1000
114 | rateControl:
115 | - type: fixed-rate
116 | opts:
117 | tps: 100
118 | - type: fixed-rate
119 | opts:
120 | tps: 200
121 | callback: benchmark/simple/query.js
122 | monitor:
123 | type:
124 | - docker
125 | - process
126 | docker:
127 | name:
128 | - all
129 | process:
130 | - command: node
131 | arguments: local-client.js
132 | multiOutput: avg
133 | interval: 1
134 |
--------------------------------------------------------------------------------
/test/benchmark/config_long.yaml:
--------------------------------------------------------------------------------
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 | ---
16 | test:
17 | name: simple
18 | description: This is an example benchmark for test, to test the backend DLT's
19 | performance with simple account opening & querying transactions
20 | clients:
21 | type: local
22 | number: 5
23 | rounds:
24 | - label: open
25 | txDuration:
26 | - 3600
27 | rateControl:
28 | - type: fixed-rate
29 | opts:
30 | tps: 1000
31 | arguments:
32 | money: 10000
33 | callback: benchmark/simple/open.js
34 | - label: query
35 | txNumber:
36 | - 1000
37 | - 1000
38 | rateControl:
39 | - type: fixed-rate
40 | opts:
41 | tps: 100
42 | - type: fixed-rate
43 | opts:
44 | tps: 200
45 | callback: benchmark/simple/query.js
46 | monitor:
47 | type:
48 | - docker
49 | - process
50 | docker:
51 | name:
52 | - all
53 | process:
54 | - command: node
55 | arguments: local-client.js
56 | multiOutput: avg
57 | interval: 1
58 |
--------------------------------------------------------------------------------
/test/benchmark/init.js:
--------------------------------------------------------------------------------
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 | 'use strict';
16 |
17 | module.exports.info = 'Creating attributes.';
18 |
19 | let txIndex = 0;
20 |
21 | let bc, contx;
22 |
23 | module.exports.init = function(blockchain, context, args) {
24 | bc = blockchain;
25 | contx = context;
26 |
27 | return Promise.resolve();
28 | };
29 |
30 | module.exports.run = function() {
31 | txIndex++;
32 | let attributekey = txIndex.toString() ;
33 | let john = {
34 | user: {
35 | active: true,
36 | dob: '2006-05-12', // too young
37 | banCount: 4, // banned too many times
38 | group: 12
39 | }
40 | };
41 | let args;
42 | if (bc.bcType === 'fabric') {
43 | args = {
44 | chaincodeFunction: 'recordSubject',
45 | chaincodeArguments: [attributekey, john.toString()],
46 | };
47 | }
48 | return bc.invokeSmartContract(contx, 'simple', 'v0', args, 30);
49 | };
50 |
51 | module.exports.end = function() {
52 | return Promise.resolve();
53 | };
--------------------------------------------------------------------------------
/test/benchmark/pdp.js:
--------------------------------------------------------------------------------
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 | 'use strict';
16 |
17 | module.exports.info = 'Query the decision.';
18 |
19 | let txIndex=0;
20 |
21 | let bc, contx;
22 |
23 | module.exports.init = function(blockchain, context, args) {
24 | bc = blockchain;
25 | contx = context;
26 |
27 | return Promise.resolve();
28 | };
29 |
30 | module.exports.run = function() {
31 | txIndex= Math.floor(Math.random() * 100);
32 | let subjectKey= 'subject_' + txIndex.toString();
33 | let resourceKey = 'resource_' + txIndex.toString();
34 | let policyKey = 'policy_' + txIndex.toString();
35 | let rule = 'can-be-admin-of-group';
36 | let args;
37 | if (bc.bcType === 'fabric') {
38 | args = {
39 | chaincodeFunction: 'pdp',
40 | chaincodeArguments: [subjectKey, resourceKey, rule, policyKey],
41 | };
42 | }
43 | return bc.invokeSmartContract(contx, 'simple', 'v0', args, 30);
44 | };
45 |
46 | module.exports.end = function() {
47 | return Promise.resolve();
48 | };
--------------------------------------------------------------------------------
/test/benchmark/query.js:
--------------------------------------------------------------------------------
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 | 'use strict';
16 |
17 | module.exports.info = 'Querying subjects.';
18 |
19 | let txIndex = 0;
20 | let bc, contx;
21 | module.exports.init = function(blockchain, context, args) {
22 | bc = blockchain;
23 | contx = context;
24 |
25 | return Promise.resolve();
26 | };
27 |
28 | module.exports.run = function() {
29 | txIndex++;
30 | let policyKey = 'policy_' + txIndex.toString();
31 | let args;
32 |
33 | if (bc.bcType === 'fabric') {
34 | args = {
35 | chaincodeFunction: 'getPolicy',
36 | chaincodeArguments: [policyKey]
37 | };
38 | }
39 |
40 | // TODO: until Fabric query is implemented, use invoke
41 | return bc.invokeSmartContract(contx, 'simple', 'v0', args, 30);
42 | };
43 |
44 | module.exports.end = function() {
45 | return Promise.resolve();
46 | };
--------------------------------------------------------------------------------
/test/reports/report-20190829T234652.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Caliper Report
5 |
6 |
90 |
91 |
92 |
93 |
94 |
95 |
Caliper Report
96 |
97 |  Basic information
98 | - DLT:  fabric
99 | - Benchmark:  
100 | - Description:  
101 | - Test Rounds:  2
102 | - Details
103 |
104 |
110 |
111 |  System Under Test
112 | - Version:  1.4.0
113 | - Size:  2 Orgs with 1 Peer
114 | - Orderer:  Solo
115 | - Distribution:  Single Host
116 | - StateDB:  CouchDB
117 | - Details
118 |
119 |
120 |
121 |
122 |
123 |
124 | Summary
125 |
126 | Test | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
127 |
128 |
129 |
130 | 1 | init | 6 | 59 | 27.0 tps | 0.55 s | 0.36 s | 0.41 s | 2.1 tps |
131 |
132 |
133 | 2 | query | 30 | 35 | 10.8 tps | 0.39 s | 0.32 s | 0.35 s | 4.9 tps |
134 |
135 |
136 |
137 |
138 |
init
139 |
140 |
round 0
141 |
performance metrics
142 |
143 |
144 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
145 |
146 |
147 | init | 6 | 59 | 27.0 tps | 0.55 s | 0.36 s | 0.41 s | 2.1 tps |
148 |
149 |
150 |
resource consumption
151 |
156 |
157 |
158 |
query
159 |
160 |
round 0
161 |
performance metrics
162 |
163 |
164 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
165 |
166 |
167 | query | 30 | 35 | 10.8 tps | 0.39 s | 0.32 s | 0.35 s | 4.9 tps |
168 |
169 |
170 |
resource consumption
171 |
176 |
177 |
178 |
Test Environment
179 |
benchmark config
180 |
{
181 | "clients": {
182 | "type": "local",
183 | "number": 5
184 | },
185 | "rounds": [
186 | {
187 | "label": "init",
188 | "txNumber": [
189 | 65
190 | ],
191 | "rateControl": [
192 | {
193 | "type": "fixed-rate",
194 | "opts": {
195 | "tps": 25
196 | }
197 | }
198 | ],
199 | "callback": "benchmark/simple/init.js"
200 | },
201 | {
202 | "label": "query",
203 | "txNumber": [
204 | 65
205 | ],
206 | "rateControl": [
207 | {
208 | "type": "fixed-rate",
209 | "opts": {
210 | "tps": 10
211 | }
212 | }
213 | ],
214 | "callback": "benchmark/simple/query.js"
215 | }
216 | ]
217 | }
218 |
SUT
219 |
not provided
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
--------------------------------------------------------------------------------
/test/reports/report-20190830T021422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Caliper Report
5 |
6 |
90 |
91 |
92 |
93 |
94 |
95 |
Caliper Report
96 |
97 |  Basic information
98 | - DLT:  fabric
99 | - Benchmark:  
100 | - Description:  
101 | - Test Rounds:  2
102 | - Details
103 |
104 |
110 |
111 |  System Under Test
112 | - Version:  1.4.0
113 | - Size:  2 Orgs with 1 Peer
114 | - Orderer:  Solo
115 | - Distribution:  Single Host
116 | - StateDB:  CouchDB
117 | - Details
118 |
119 |
120 |
121 |
122 |
123 |
124 | Summary
125 |
126 | Test | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
127 |
128 |
129 |
130 | 1 | init | 13 | 52 | 2.2 tps | 0.53 s | 0.42 s | 0.47 s | 0.4 tps |
131 |
132 |
133 | 2 | query | 65 | 0 | 2.2 tps | 0.37 s | 0.33 s | 0.35 s | 2.1 tps |
134 |
135 |
136 |
137 |
138 |
init
139 |
140 |
round 0
141 |
performance metrics
142 |
143 |
144 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
145 |
146 |
147 | init | 13 | 52 | 2.2 tps | 0.53 s | 0.42 s | 0.47 s | 0.4 tps |
148 |
149 |
150 |
resource consumption
151 |
156 |
157 |
158 |
query
159 |
160 |
round 0
161 |
performance metrics
162 |
163 |
164 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
165 |
166 |
167 | query | 65 | 0 | 2.2 tps | 0.37 s | 0.33 s | 0.35 s | 2.1 tps |
168 |
169 |
170 |
resource consumption
171 |
176 |
177 |
178 |
Test Environment
179 |
benchmark config
180 |
{
181 | "clients": {
182 | "type": "local",
183 | "number": 5
184 | },
185 | "rounds": [
186 | {
187 | "label": "init",
188 | "txNumber": [
189 | 65
190 | ],
191 | "rateControl": [
192 | {
193 | "type": "fixed-rate",
194 | "opts": {
195 | "tps": 2
196 | }
197 | }
198 | ],
199 | "callback": "benchmark/simple/init.js"
200 | },
201 | {
202 | "label": "query",
203 | "txNumber": [
204 | 65
205 | ],
206 | "rateControl": [
207 | {
208 | "type": "fixed-rate",
209 | "opts": {
210 | "tps": 2
211 | }
212 | }
213 | ],
214 | "callback": "benchmark/simple/query.js"
215 | }
216 | ]
217 | }
218 |
SUT
219 |
not provided
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
--------------------------------------------------------------------------------
/test/reports/report-20190830T022030.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Caliper Report
5 |
6 |
90 |
91 |
92 |
93 |
94 |
95 |
Caliper Report
96 |
97 |  Basic information
98 | - DLT:  fabric
99 | - Benchmark:  
100 | - Description:  
101 | - Test Rounds:  2
102 | - Details
103 |
104 |
110 |
111 |  System Under Test
112 | - Version:  1.4.0
113 | - Size:  2 Orgs with 1 Peer
114 | - Orderer:  Solo
115 | - Distribution:  Single Host
116 | - StateDB:  CouchDB
117 | - Details
118 |
119 |
120 |
121 |
122 |
123 |
124 | Summary
125 |
126 | Test | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
127 |
128 |
129 |
130 | 1 | init | 65 | 0 | 2.2 tps | 0.49 s | 0.31 s | 0.36 s | 2.1 tps |
131 |
132 |
133 | 2 | query | 65 | 0 | 2.2 tps | 0.38 s | 0.34 s | 0.36 s | 2.1 tps |
134 |
135 |
136 |
137 |
138 |
init
139 |
140 |
round 0
141 |
performance metrics
142 |
143 |
144 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
145 |
146 |
147 | init | 65 | 0 | 2.2 tps | 0.49 s | 0.31 s | 0.36 s | 2.1 tps |
148 |
149 |
150 |
resource consumption
151 |
156 |
157 |
158 |
query
159 |
160 |
round 0
161 |
performance metrics
162 |
163 |
164 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
165 |
166 |
167 | query | 65 | 0 | 2.2 tps | 0.38 s | 0.34 s | 0.36 s | 2.1 tps |
168 |
169 |
170 |
resource consumption
171 |
176 |
177 |
178 |
Test Environment
179 |
benchmark config
180 |
{
181 | "clients": {
182 | "type": "local",
183 | "number": 5
184 | },
185 | "rounds": [
186 | {
187 | "label": "init",
188 | "txNumber": [
189 | 65
190 | ],
191 | "rateControl": [
192 | {
193 | "type": "fixed-rate",
194 | "opts": {
195 | "tps": 2
196 | }
197 | }
198 | ],
199 | "callback": "benchmark/simple/init.js"
200 | },
201 | {
202 | "label": "query",
203 | "txNumber": [
204 | 65
205 | ],
206 | "rateControl": [
207 | {
208 | "type": "fixed-rate",
209 | "opts": {
210 | "tps": 2
211 | }
212 | }
213 | ],
214 | "callback": "benchmark/simple/query.js"
215 | }
216 | ]
217 | }
218 |
SUT
219 |
not provided
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
--------------------------------------------------------------------------------
/test/reports/report-20190830T022510.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Caliper Report
5 |
6 |
90 |
91 |
92 |
93 |
94 |
95 |
Caliper Report
96 |
97 |  Basic information
98 | - DLT:  fabric
99 | - Benchmark:  
100 | - Description:  
101 | - Test Rounds:  2
102 | - Details
103 |
104 |
110 |
111 |  System Under Test
112 | - Version:  1.4.0
113 | - Size:  2 Orgs with 1 Peer
114 | - Orderer:  Solo
115 | - Distribution:  Single Host
116 | - StateDB:  CouchDB
117 | - Details
118 |
119 |
120 |
121 |
122 |
123 |
124 | Summary
125 |
126 | Test | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
127 |
128 |
129 |
130 | 1 | init | 65 | 0 | 21.7 tps | 0.46 s | 0.12 s | 0.28 s | 19.3 tps |
131 |
132 |
133 | 2 | query | 65 | 0 | 21.4 tps | 0.40 s | 0.10 s | 0.25 s | 20.6 tps |
134 |
135 |
136 |
137 |
138 |
init
139 |
140 |
round 0
141 |
performance metrics
142 |
143 |
144 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
145 |
146 |
147 | init | 65 | 0 | 21.7 tps | 0.46 s | 0.12 s | 0.28 s | 19.3 tps |
148 |
149 |
150 |
resource consumption
151 |
156 |
157 |
158 |
query
159 |
160 |
round 0
161 |
performance metrics
162 |
163 |
164 | Name | Succ | Fail | Send Rate | Max Latency | Min Latency | Avg Latency | Throughput |
165 |
166 |
167 | query | 65 | 0 | 21.4 tps | 0.40 s | 0.10 s | 0.25 s | 20.6 tps |
168 |
169 |
170 |
resource consumption
171 |
176 |
177 |
178 |
Test Environment
179 |
benchmark config
180 |
{
181 | "clients": {
182 | "type": "local",
183 | "number": 5
184 | },
185 | "rounds": [
186 | {
187 | "label": "init",
188 | "txNumber": [
189 | 65
190 | ],
191 | "rateControl": [
192 | {
193 | "type": "fixed-rate",
194 | "opts": {
195 | "tps": 20
196 | }
197 | }
198 | ],
199 | "callback": "benchmark/simple/init.js"
200 | },
201 | {
202 | "label": "query",
203 | "txNumber": [
204 | 65
205 | ],
206 | "rateControl": [
207 | {
208 | "type": "fixed-rate",
209 | "opts": {
210 | "tps": 20
211 | }
212 | }
213 | ],
214 | "callback": "benchmark/simple/query.js"
215 | }
216 | ]
217 | }
218 |
SUT
219 |
not provided
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
--------------------------------------------------------------------------------
/test/reports/report-20190916T232327.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hyperledger-labs/hyperledger-fabric-based-access-control/4b7914596b0d61e9345255341bfb1a586f38f579/test/reports/report-20190916T232327.html
--------------------------------------------------------------------------------
/test/src/contract/fabric/attributeBased/node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "attributebasd",
3 | "version": "0.0.0",
4 | "description": "Simple chaincode implemented in node.js",
5 | "engines": {
6 | "node": ">=8.4.0",
7 | "npm": ">=5.3.0"
8 | },
9 | "scripts": {
10 | "start": "node attributebased.js"
11 | },
12 | "engine-strict": true,
13 | "license": "Apache-2.0",
14 | "dependencies": {
15 | "fabric-shim": "~1.4.0",
16 | "node-abac": "0.0.7"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/travis.yaml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "8"
4 | before_install:
5 | - cd abacFabric
6 | - cd javascript
7 | install:
8 | - npm install
9 | - npm run lint
10 | - npm run test
11 |
12 | env:
13 | - NODE_ENV=production PORT=8080
14 |
15 | notifications:
16 | webhooks:
17 | on_success: always # default: always
18 | on_failure: always # default: always
19 | on_start: never # default: never
20 | on_cancel: never # default: always
21 | on_error: never # default: always
22 |
--------------------------------------------------------------------------------