Hyperledger Intro
Hyperledger项目:
- Hyperledger Fabric
- Hyperledger Sawtooth
- Hyperledger Composer
模型:
- Assets(资产)
一般定义方式:
/**
* A vehicle asset.
*/
asset Vehicle identified by vin {
o String vin
}
继承方式:
/**
* A car asset. A car is related to a list of parts
*/
asset Car extends Vehicle {
o String model
--> Part[] Parts
}
抽象方式:
/**
* An abstract Vehicle asset.
*/
abstract asset Vehicle identified by vin {
o String vin
}
Participants(参与者)
/** * An enumerated type */ enum ProductType { o DAIRY o BEEF o VEGETABLES } participant Farmer identified by farmerId { o String farmerId o ProductType primaryProduct }
Transactions(事务)
Concepts(概念)
abstract concept Address { o String street o String city default ="Winchester" o String country default = "UK" o Integer[] counts optional } concept UnitedStatesAddress extends Address { o String zipcode }
http://www.8btc.com/blockchain-poc-hyperledger
Test:
概念:
- BND: business network definition (BND)