Skip to content

Commit

Permalink
FAB-1107 Implement enroll function to work with COP
Browse files Browse the repository at this point in the history
Note:  Work in progress but wanted to submit for review

This change set introduces a new member services client
implementation for communcating with the new Fabric COP
server.  Currently the only API implemented is enroll

Made this impl the default from utils.getMemberService()

Save and load certificates in PEM format. Needs a change
in endorser.go to take PEM instead of DER.

Fixed headless tests

Merged patch 7 with patch 6

Change-Id: Ib5d0cb32391f30dc20fb8779cbcc615400c6a7b6
Signed-off-by: Gari Singh <[email protected]>
Signed-off-by: Jim Zhang <[email protected]>
  • Loading branch information
jimthematrix committed Nov 22, 2016
1 parent de02901 commit 223d769
Show file tree
Hide file tree
Showing 15 changed files with 1,633 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ coverage
docs/gen
node_modules/*
test/fixtures/src/github.com/example_cc/Dockerfile
test/fixtures/src/github.com/marbles_cc/Dockerfile
npm-shrinkwrap.json
npm-debug.log
tmp
Expand Down
1 change: 1 addition & 0 deletions build/tasks/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ gulp.task('doc', function () {
'./lib/impl/CryptoSuite_ECDSA_AES.js',
'./lib/impl/ecdsa/key.js',
'./lib/impl/MemberServices.js',
'./lib/impl/FabricCOPImpl.js',
'./lib/Chain.js',
'./lib/Member.js',
'./lib/Peer.js',
Expand Down
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"crypto-keysize": 384,
"crypto-suite": "./impl/CryptoSuite_ECDSA_AES.js",
"key-value-store": "./impl/FileKeyValueStore.js",
"member-service": "./impl/MemberServices.js",
"member-service": "./impl/FabricCOPImpl.js",
"nonce-size" : 24,
"dockerfile-contents" : "from hyperledger/fabric-ccenv\nCOPY . $GOPATH/src/build-chaincode/\nWORKDIR $GOPATH\n\nRUN go install build-chaincode && mv $GOPATH/bin/build-chaincode $GOPATH/bin/%s"
}
2 changes: 1 addition & 1 deletion lib/Chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var utils = require('./utils.js');
var urlParser = require('url');
var net = require('net');
var util = require('util');
var MemberServices = require('./impl/MemberServices.js');
var MemberServices = utils.getMemberService();
var Member = require('./Member.js');
var Orderer = require('./Orderer.js');

Expand Down
3 changes: 2 additions & 1 deletion lib/Member.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ var Member = class {
}

let signatureHeader = new _commonProto.SignatureHeader();
signatureHeader.setCreator(creator);

signatureHeader.setCreator(Buffer.from(creator, 'hex'));
signatureHeader.setNonce(crypto.randomBytes(sdkUtils.getConfigSetting('nonce-size', 24)));

let header = new _commonProto.Header();
Expand Down
Loading

0 comments on commit 223d769

Please sign in to comment.