GithubHelp home page GithubHelp logo

kmilodenisglez / cc-identity-go Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 1.0 8.12 MB

Decentralized Identity Chaincode

License: GNU Lesser General Public License v2.1

Go 97.87% Dockerfile 0.29% Shell 1.85%

cc-identity-go's Introduction

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

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:

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):

# 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

cc-identity-go's People

Contributors

kmilodenisglez avatar

Stargazers

Mohammed A.Baqi avatar

Forkers

m2ind

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.