Fabric MSP Membership Management
Hyperledger Fabric 1.0 is built on PKI (Public Key Infrastructure) and introduces the MSP (Membership Service Provider) module, which generates digital certificates to identify members and manage their identities.
Fabric member identities are based on standard X.509 certificates, and keys use the ECDSA algorithm. PKI is used to issue a digital certificate to every member. Within a channel, only peers in the same MSP can distribute data to each other via the Gossip protocol.
Certificate types
Each MSP has exactly one root CA certificate. From the root CA certificate down to the end-user certificates, the certificates form a chain of trust.
Root CA certificate (Root Certificate): a self-signed certificate. Certificates signed by the root CA can in turn issue new certificates, forming a tree structure (required)
Intermediate CA certificate (Intermediate Certificate): a certificate issued by another CA certificate. It can issue new certificates with its own private key (optional)
MSP admin certificate: has the certificate path to the root CA and has permission to modify the channel configuration (required) -- system requests such as creating a channel or joining a channel must be signed with the admin's private key
TLS root CA certificate: a self-signed certificate used for TLS (Transport Layer Security) transport (required)
MSP directory
Let's look at the crypto-config directory in the Fabric example. The network has 1 orderer and 4 peers (split into two organizations, org1 and org2), and the directory is generated by the cryptogen binary tool. It contains two subdirectories, ordererOrganizations and peerOrganizations, which hold the MSP configuration for the orderer and the peers respectively. Here I take org1's MSP configuration as the example. To make node deployment easier, the directory stores a lot of redundant copies.
org1.example.com
├── ca # root CA private key and certificate
│ ├── 0e729224e8b3f31784c8a93c5b8ef6f4c1c91d9e6e577c45c33163609fe40011_sk
│ └── ca.org1.example.com-cert.pem
├── msp # MSP config directory
│ ├── admincerts # MSP admin certificate
│ │ └── Admin@org1.example.com-cert.pem
│ ├── cacerts # MSP root CA certificate (same as the one in the ca directory)
│ │ └── ca.org1.example.com-cert.pem
│ └── tlscacerts # TLS root CA certificate
│ └── tlsca.org1.example.com-cert.pem
├── peers # MSP config and private keys of the peers
│ ├── peer0.org1.example.com # peer0 config
│ │ ├── msp
│ │ │ ├── admincerts # admin certificate
│ │ │ │ └── Admin@org1.example.com-cert.pem
│ │ │ ├── cacerts # root CA certificate
│ │ │ │ └── ca.org1.example.com-cert.pem
│ │ │ ├── keystore # peer's private key
│ │ │ │ └── 27db82c96b1482480baa1c75f80e5cce249beaab27b70c741bb0e2554355957e_sk
│ │ │ ├── signcerts # peer's certificate
│ │ │ │ └── peer0.org1.example.com-cert.pem
│ │ │ └── tlscacerts # TLS root CA certificate
│ │ │ └── tlsca.org1.example.com-cert.pem
│ │ └── tls
│ │ ├── ca.crt # TLS root CA certificate
│ │ ├── server.crt # peer's TLS certificate
│ │ └── server.key # peer's TLS private key
│ └── peer1.org1.example.com
│ ├── msp
│ │ ├── admincerts
│ │ │ └── Admin@org1.example.com-cert.pem
│ │ ├── cacerts
│ │ │ └── ca.org1.example.com-cert.pem
│ │ ├── keystore
│ │ │ └── fdee12a3510fde3155c37128cfec26090ae249bfbca28f884e60c21338493edd_sk
│ │ ├── signcerts
│ │ │ └── peer1.org1.example.com-cert.pem
│ │ └── tlscacerts
│ │ └── tlsca.org1.example.com-cert.pem
│ └── tls
│ ├── ca.crt
│ ├── server.crt
│ └── server.key
├── tlsca # TLS root CA certificate and private key
│ ├── 945092d936f5838c5a6f6484db974d857933706737d00d04bf65f74e3976f9f8_sk
│ └── tlsca.org1.example.com-cert.pem
└── users # user configs generated by default, usually 1 admin and 1 regular member
├── Admin@org1.example.com # MSP admin
│ ├── msp
│ │ ├── admincerts # admin certificate
│ │ │ └── Admin@org1.example.com-cert.pem
│ │ ├── cacerts # root CA certificate
│ │ │ └── ca.org1.example.com-cert.pem
│ │ ├── keystore # admin private key
│ │ │ └── 5890f0061619c06fb29dea8cb304edecc020fe63f41a6db109f1e227cc1cb2a8_sk
│ │ ├── signcerts # admin certificate
│ │ │ └── Admin@org1.example.com-cert.pem
│ │ └── tlscacerts # TLS root certificate
│ │ └── tlsca.org1.example.com-cert.pem
│ └── tls
│ ├── ca.crt # TLS root certificate
│ ├── server.crt # admin's TLS certificate
│ └── server.key # admin's TLS private key
└── User1@org1.example.com
├── msp
│ ├── admincerts
│ │ └── User1@org1.example.com-cert.pem
│ ├── cacerts
│ │ └── ca.org1.example.com-cert.pem
│ ├── keystore
│ │ └── 73cdc0072c7203f1ec512232c780fc84acc9752ef30ebc16be1f4666c02b614b_sk
│ ├── signcerts
│ │ └── User1@org1.example.com-cert.pem
│ └── tlscacerts
│ └── tlsca.org1.example.com-cert.pem
└── tls
├── ca.crt
├── server.crt
└── server.key
您好,请问如何fabric中搭建MPT树呢,以及现在fabric主要是用做账本记录交易,可不可以只进行存储与查询操作呢
1. 有资料显示fabric 1.0之后就不再使用Merkle tree结构,你可以去看下0.6版本里区块头中hash的生成方式。 参考:https://stackoverflow.com/questions/66204016/why-no-merkle-tree-in-hyperledger-fabric-to-track-the-world-state
2.可以做存储和查询,fabric的存储结构是 状态数据库+账本,可以用状态数据库存储当前状态,账本则记载变更记录。
请问如果应用fabric于车联网,您觉得怎样用fabric来模拟车辆之间交互以及车辆与基础设施交互的过程呢
用fabric来模拟是指仅仅用fabric网络来存储这些交互的数据,还是指每一个设备都会运行一个fabric节点?
如果是前者,需要先对业务建模,理清楚到底需要把哪些数据存到kv数据库中,以及未来需要怎样检索;如果是后者,可能先要考虑清楚是否每个设备都需要存储全量数据。
您好,请问如何fabric中搭建MPT树呢,以及现在fabric主要是用做账本记录交易,可不可以只进行存储与查询操作呢
大神,我正在开你的一系列fabric讲解,很感谢,新手的我很迷茫,不知道从哪入手,网络搭建好了,但是不会用,看了大量的视频和官网文档,感觉自己还是虚的很。【害怕】
网络搭建好了可以发送请求测一下fabric的交易流程。建议以实践为主,遇到问题再看资料。如果有实际的项目需求就更容易上手了。
q
可以用这个管理fabric的用户么
可以的。不过一般情况下,用户的证书使用CA服务器动态签发。