cc-identity-go
所属分类:其他
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2022-10-19 22:53:01
上 传 者:
sh-1993
说明: 去中心化身份链码,
(Decentralized Identity Chaincode,)
文件列表:
Dockerfile (314, 2022-10-19)
LICENSE (26526, 2022-10-19)
META-INF/ (0, 2022-10-19)
META-INF/statedb/ (0, 2022-10-19)
META-INF/statedb/couchdb/ (0, 2022-10-19)
META-INF/statedb/couchdb/indexes/ (0, 2022-10-19)
META-INF/statedb/couchdb/indexes/indexParticipant.json (200, 2022-10-19)
META-INF/statedb/couchdb/indexes/indexParticipantID.json (156, 2022-10-19)
TODO.md (228, 2022-10-19)
chaincode.env (1115, 2022-10-19)
code.tar.gz (193, 2022-10-19)
connection.json (84, 2022-10-19)
contracts/ (0, 2022-10-19)
contracts/identity/ (0, 2022-10-19)
contracts/identity/accesscontract.go (5049, 2022-10-19)
contracts/identity/constants.go (420, 2022-10-19)
contracts/identity/default.go (221, 2022-10-19)
contracts/identity/issuercontract.go (11400, 2022-10-19)
contracts/identity/model.go (432, 2022-10-19)
contracts/identity/onlydev.go (11490, 2022-10-19)
contracts/identity/participantcontract.go (14051, 2022-10-19)
contracts/identity/richqueries.go (2143, 2022-10-19)
contracts/identity/rolecontract.go (4568, 2022-10-19)
doc/ (0, 2022-10-19)
doc/contracts/ (0, 2022-10-19)
doc/contracts/identity/ (0, 2022-10-19)
doc/contracts/identity/index.htm (48560, 2022-10-19)
doc/contracts/index.htm (3275, 2022-10-19)
doc/hooks/ (0, 2022-10-19)
doc/hooks/index.htm (5015, 2022-10-19)
doc/index.htm (4741, 2022-10-19)
doc/lib-utils/ (0, 2022-10-19)
doc/lib-utils/index.htm (26139, 2022-10-19)
doc/testing/ (0, 2022-10-19)
doc/testing/index.htm (19520, 2022-10-19)
doc/testing/mocks/ (0, 2022-10-19)
... ...
# cc-identity-go
## Description
The identity certificate should be issue by just one Certificate Authority
Each company should be able to check/query attributes from a participant
A single DID should be enough to query all the information related to one identity, and his attributes
Only the company that certifies an attribute can edit it
The flow:
- Can register new identities
- Can delete identities
- Can update identities
## use cc-identity-go as a module (smart contract) inside a chaincode
```bash
go get github.com/kmilodenisglez/cc-identity-go
```
## use cc-identity-go as a service (chaincode)
Package and install the external chaincode on peer with the following simple commands:
```
tar cfz code.tar.gz connection.json
tar cfz external-chaincode.tgz metadata.json code.tar.gz
peer lifecycle chaincode install external-chaincode.tgz
```
Run the following command to query the package ID of the chaincode that you just installed:
```
peer lifecycle chaincode queryinstalled -o $ORDERER_ADDRESS --tlsRootCertFiles $ORDERER_TLS_CA
```
The command will return output similar to the following:
```bash
Chaincode code package identifier: ccidentity_1.0:5beffad255c6af3744d419ae7b978aa9609386f6c81dd98184808746cea399d5
# Installed chaincodes on peer:
Package ID: ccidentity_1.0:5beffad255c6af3744d419ae7b978aa9609386f6c81dd98184808746cea399d5
Label: ccidentity_1.0
```
Copy the returned chaincode package ID into an environment variable for use in subsequent commands (your ID may be different):
```bash
# in linux or darwin use export, ex:
export CHAINCODE_ID=ccidentity_1.0:5beffad255c6af3744d419ae7b978aa9609386f6c81dd98184808746cea399d5
# in windows use set, ex:
set CHAINCODE_ID=ccidentity_1.0:5beffad255c6af3744d419ae7b978aa9609386f6c81dd98184808746cea399d5
```
Build the chaincode:
```
# linux or darwin
go build -o ccass_identity_binary
# windows
go build -o ccass_identity_binary.exe
```
Set the chaincode server address:
```
# linux
export CHAINCODE_SERVER_ADDRESS=127.0.0.1:9999
# windows
set CHAINCODE_SERVER_ADDRESS=127.0.0.1:9999
```
And start the chaincode service:
```
# linux
./ccass_identity_binary
# windows
ccass_identity_binary.exe
```
## Activate the chaincode
approve and commit the chaincode:
```
peer lifecycle chaincode approveformyorg -o $ORDERER_ADDRESS --tls --cafile $ORDERER_TLS_CA --channelID $CHANNEL_NAME --name $CC_NAME --version 1 --package-id $CHAINCODE_ID --sequence 1
peer lifecycle chaincode commit -o $ORDERER_ADDRESS --tls --cafile $ORDERER_TLS_CA --channelID $CHANNEL_NAME --name $CC_NAME --version 1 --sequence 1
```
近期下载者:
相关文件:
收藏者: