More Related Content Similar to Hyperledger weatherreport20190219 公開版 (20) More from Hyperleger Tokyo Meetup (20) Hyperledger weatherreport20190219 公開版1. © Hitachi America, Ltd. 2019. All rights reserved.
Hyperledger Weather Report 2/19/2019
Satoshi Oshima (大島 訓)
Senior Researcher
Financial Innovation Lab.
Global Center for Social Innovation
Hitachi America Ltd.
Hyperledger Tokyo Meetup 2/19/2019
2. © Hitachi America, Ltd. 2019. All rights reserved.
Agenda
1. Hyperledger Community Update
2. Hyperledger Fabric Update
3. © Hitachi America, Ltd. 2019. All rights reserved.
Agenda
1. Hyperledger Community Update
2. Hyperledger Fabric Update
4. © Hitachi America, Ltd. 2019. All rights reserved.
1.1. Governing Board update
• Blythe Masters (Digital Asset Holdings) resigned
Governing Board Chair.
• Robert Platnick (DTCC) was elected as new
Governing Board Chair.
5. © Hitachi America, Ltd. 2019. All rights reserved.
1.2. Technical Steering Committee update
• Chris Ferris (IBM) had worked as Technical
Steering Committee (TSC) chair since Feb/2016.
• Dan Middleton (Intel) was elected as TSC chair
from Sep/2019.
6. © Hitachi America, Ltd. 2019. All rights reserved.
1.3. Hyperledger Staff update
• Todd Benzies step up as Sr. Director
Program Management & Operations
• Tracy Kuhrt was community architect
and left Hyperledger staff.
– She was the key staff to host Hyperledger
developer's event.
• Ry jones works as community
architect.
7. © Hitachi America, Ltd. 2019. All rights reserved.
1.4. Hyperledger Project update
• Hyperledger Ursa became an incubation project.
– Hyperledger Ursa is the shared crypt library for Hyperledger projects.
– Hyperledger Ursa contains sub-projects.
• Base Crypt Library: Shared modular signature library
• Z-Mix: (to be) zero-knowledge proofs library
• Hyperledger Grid
– reference implementations of supply chain-centric data types, data
models, and smart contract based business logic
8. © Hitachi America, Ltd. 2019. All rights reserved.
1.5. Hyperledger Event update
• Hyperledger Member Summit
– Annual, all member company hold the seat to attend
– 2017: Singapore, 2018: Montreal, 2019: Tokyo
• Hyperledger Hackfest
– Developers get together, discuss technical direction and exchange the
information among projects.
– 4 times a year (east coast, west coast, Europe, Asia) but cancelled.
• Hyperledger Bootcamp
– First attempt held in Hong Kong on Mar/7-8.
• Hyperledger Contributors Summit
– Planning
9. © Hitachi America, Ltd. 2019. All rights reserved.
Agenda
1. Hyperledger Community Update
2. Hyperledger Fabric Update
10. © Hitachi America, Ltd. 2019. All rights reserved.
2.1. Hyperledger Fabric 1.4 LTS
• Released on Jan/11/2019
• Improved stability and production operations
11. © Hitachi America, Ltd. 2019. All rights reserved.
2.2. Improved Serviceability
• Operations Services
– Motivation
• Monitoring is required in production systems
– Feature
• Introduced operations service which provides health information and metrics.
• Metrics provided are based on Prometheus
– Metrics
• Launch time for chaincode
• Memory status in Go runtime
– Heap etc.
• Process status
– File descriptors, memory, CPU times
Orderer
Prometheus
Peer
Peer
Peer
12. © Hitachi America, Ltd. 2019. All rights reserved.
2.3. Improved Programming Model
• High-level API (“fabric-network”, “fabric-contract-api”) in NodeJS
– Motivation
• Existing API are too low-level and developers have to care too many things
– Feature
• Provide High-level API for applications and chaincodes to enable developers to
concentrate on business logics
• Existing low-level APIs are also supported
Application
fabric
network
*The image was based on https://jira.hyperledger.org/secure/attachment/16735/fabric-sdk-programming-model.pdf
13. © Hitachi America, Ltd. 2019. All rights reserved.
2.4. Private data enhancements
• Enhancements in Private Data (Side DB)
– Motivation
• A peer who is not active in the transaction can not receive the private data in the
transaction even if it is entitled to receive it. (Issues for newly added peers or
organizations)
• Access control to the private data should be explicitly written in a chaincode logic
– Features
• Reconciliation
– A newly added peer receives the private data in the past transactions by gossip protocol from
other peers
• Client access control
– By setting the “memberOnlyRead” flag in the private data collection, Fabric automatically
checks whether the creator of the transaction is entitled to access the private data
14. © Hitachi America, Ltd. 2019. All rights reserved.
2.5. Is Fabric 1.4 really Long Term Support?
• Fabric 1.4 LTS will be supported for "ONE" year by Hyperledger
Fabric development community.
• Currently, no maintenance policy is defined. No dedicated
maintainer is assigned.
• Fabric 1.4.1 will support Raft consensus for orderer in addition to
Kafka.
15. © Hitachi America, Ltd. 2019. All rights reserved.
2.6. What's going on for Fabric 2.0
• Fabric 2.0 Beta will be released in April hopefully
• New Chaincode lifecycle model
• Additional operational metrics
• Programming model improvement and porting to JavaSDK
• Token: UTXO base data management model
16. © Hitachi America, Ltd. 2019. All rights reserved.© Hitachi America, Ltd. 2018. All rights reserved.
Hitachi is a Premier Member of Hyperledger and one of the leading
contributors to Hyperledger Fabric
etc.
• Trustful Application as
“Smart Contract”
• Consensus Mechanism
• Immutable Ledger
Contributor Ranking by Company*
1 IBM
2 Hitachi
3 IT People
*1: Number of commits from v1.0 until v1.1 release (official Git
repositories (fabric v1.1 supported))
*2: Excludes Gmail, Hotmail, etc.
Hitachi provides “Blockchain
Environment Cloud Service“ based on
Hyperledger Fabric
2.7. Hitachi’s contribution to Hyperledger Fabric
© Hitachi America, Ltd. 2019. All right reserved.
19. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (1/6)
• Operations Service
– Provides health information and metrics of peers and orderers for
monitoring needed in production systems
– Metrics are exported in either two ways:
• “Pull” model based on Prometheus
– An external tool accesses the endpoint of the peer/orderer (pulls metrics from peer/orderer)
• “Push” model based on StatsD
– The peer/orderer periodically pushes metrics to the specified server
Reference: https://hyperledger-fabric.readthedocs.io/en/release-1.4/operations_service.html
20. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (2/6) – Health Information
• Health information
– By default, health information is available on Port 8443 (orderer) or 9443
(peer)
– When some error occurs, it returns 503 and the reason as JSON.
$ curl http://localhost:9443/healthz
{"status":"OK","time":"2019-02-08T22:15:44.769565359Z"}
{"status": "Service Unavailable",
"time": "2009-11-10T23:00:00Z",
"failed_checks": [{
"component": "docker",
"reason": "failed to connect to Docker daemon: invalid endpoint"
}]}
21. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (3/6) – Metrics
• Metrics (Prometheus)
– Can be enabled by editing core.yaml/orderer.yaml or an environment
variable as follows:
– The endpoint returns metrics for the peer/orderer
CORE_METRICS_PROVIDER=prometheus
$ curl http://localhost:9443/metrics
# HELP chaincode_launch_duration The time to launch a chaincode.
# TYPE chaincode_launch_duration histogram
chaincode_launch_duration_bucket{chaincode="cscc:1.4.0",success="true",le="0.005"} 1
chaincode_launch_duration_bucket{chaincode="cscc:1.4.0",success="true",le="0.01"} 1
chaincode_launch_duration_bucket{chaincode="cscc:1.4.0",success="true",le="0.025"} 1
chaincode_launch_duration_bucket{chaincode="cscc:1.4.0",success="true",le="0.05"} 1
...
22. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (4/6) – Metrics
• Metrics can be visualized with Prometheus or other tools..
23. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (5/6) – Metrics
• Metrics currently available:
– Launch time for chaincode
– Execution time for shim requests (GetState, PutState, etc.)
– GRPC connection counts/statuses
– Memory status in Go runtime (heap etc.)
– Ledger commit time
– Process status (file descriptors, memory, cpu times)
– etc.
24. © Hitachi America, Ltd. 2019. All rights reserved.
Improved Serviceability (6/6) – Bonus: Log level
• Log level now can be controlled dynamically
– Get the current log level
– Set the log level
$ curl http://localhost:9443/logspec
{"spec":"gossip=debug:debug"}
$ curl -X PUT -d '{"spec":"info"}' http://localhost:9443/logspec
$ curl http://localhost:9443/logspec
{"spec":"info"}
25. © Hitachi America, Ltd. 2019. All rights reserved.
New Programming Model (1/3)
• Improved (high-level) programming model in Node.js
– SDK / chaincode SDK in the previous versions were too low-level
– New programming model are intended to enable application developer to
easily write chaincodes and Fabric applications
• The low level (existing) APIs are also supported.
– Proposed and developed mainly by IBM developers in UK who used to be
in charge of Hyperledger Composer development.
26. © Hitachi America, Ltd. 2019. All rights reserved.
New Programming Model (2/3) - Application
• “fabric-network” library in Node.js SDK
– New Concepts (classes)
• Wallet : Identity (certificate and private key)
• Gateway : Connection information for peer(s)
• Network : Fabric channel
• Contract : Chaincode
const { FileSystemWallet, Gateway } = require('fabric-network');
const CommercialPaper = require('../contract/lib/paper.js’);
const wallet = new FileSystemWallet('../identity/user/isabella/wallet');
...
const gateway = new Gateway();
const userName = 'User1@org1.example.com’;
...
await gateway.connect(connectionProfile, connectionOptions);
const network = await gateway.getNetwork('mychannel');
const contract = await network.getContract('papercontract', 'org.papernet.commercialpaper');
const issueResponse = await contract.submitTransaction('issue’,
'MagnetoCorp', '00001', '2020-05-31', '2020-11-30', '5000000');
27. © Hitachi America, Ltd. 2019. All rights reserved.
New Programming Model (3/3) - Chaincode
• “fabric-contract-api” in Node.js Chaincode
– Contract
• Function routing implemented with namespaces
• Hooks (executed before/after invokes)
(Contract Example)
const { Contract, Context } = require('fabric-contract-api');
...
class CommercialPaperContract extends Contract {
constructor() {
super('org.papernet.commercialpaper');
}
...
async issue(ctx, issuer, paperNumber, issueDateTime, maturityDateTime, faceValue) {
let paper = CommercialPaper.createInstance(issuer, paperNumber,
issueDateTime, maturityDateTime, faceValue);
paper.setIssued();
paper.setOwner(issuer);
await ctx.paperList.addPaper(paper);
return paper.toBuffer();
}
...
}