[블록체인] ICT 이노베이션 블록체인 개발자 14일 &15일차 Hyper ledger
14일 차 &15일 차
하이퍼 렛져 키 콘셉트, 합의 프로세스 비즈니스 네트워크 작성 예제, 데이터 관리, 예제-commercial paper를 진행합니다.
www.hyperledger.org/learn/training
hyperledger official website we can do those training courses
and tutorial from the offical document you can access via the following link.
all the ppt slid seems like made based on those materials.
hyperledger-fabric.readthedocs.io/en/release-2.2/tutorials.html
There are samples including fabacar ( course sample we did in the class) also there are some stuff like off-chain / token
github.com/hyperledger/fabric-samples
Hpyerledge charachterlistic :
/*
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
const { FileSystemWallet, Gateway } = require('fabric-network');
const fs = require('fs');
const path = require('path');
const ccpPath = path.resolve(__dirname, '..', '..', 'basic-network', 'connection.json');
const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
const ccp = JSON.parse(ccpJSON);
async function main() {
try {
// Create a new file system based wallet for managing identities.
const walletPath = path.join(process.cwd(), 'wallet');
const wallet = new FileSystemWallet(walletPath);
console.log(`Wallet path: ${walletPath}`);
// Check to see if we've already enrolled the user.
const userExists = await wallet.exists('user1');
if (!userExists) {
console.log('An identity for the user "user1" does not exist in the wallet');
console.log('Run the registerUser.js application before retrying');
return;
}
// Create a new gateway for connecting to our peer node.
const gateway = new Gateway();
await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } });
// Get the network (channel) our contract is deployed to.
const network = await gateway.getNetwork('mychannel');
// Get the contract from the network.
const contract = network.getContract('fabcar');
// Evaluate the specified transaction.
// queryCar transaction - requires 1 argument, ex: ('queryCar', 'CAR4')
// queryAllCars transaction - requires no arguments, ex: ('queryAllCars')
const result = await contract.evaluateTransaction('queryAllCars');
console.log(`Transaction has been evaluated, result is: ${result.toString()}`);
} catch (error) {
console.error(`Failed to evaluate transaction: ${error}`);
process.exit(1);
}
}
main();
fabcar example :
hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html
hyperledger - commercial paper tutorial
hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html
'IT > Blockchain' 카테고리의 다른 글
[블록체인] ICT 이노베이션 블록체인 개발자 17일차 First network (0) | 2020.11.25 |
---|---|
[블록체인] ICT 이노베이션 블록체인 개발자 16일차 하이퍼렛져 네트워크 구성 (0) | 2020.11.23 |
[블록체인] ICT 이노베이션 블록체인 개발자 11일차 Hyper ledger fabric 환경설정 (0) | 2020.11.19 |
[블록체인] ICT 이노베이션 블록체인 개발자 13일차 (0) | 2020.11.18 |
[블록체인] ICT 이노베이션 블록체인 개발자 12일차 (0) | 2020.11.17 |