Skip to content

Commit

Permalink
FABN-1347 NodeSDK add new lowlevel
Browse files Browse the repository at this point in the history
Add the new level SDK to the fabric-common.
This is a work in progress.

Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
Change-Id: If3b2f26dc541e9dff305e06ea6f2af5a8ed4b00e
  • Loading branch information
harrisob committed Oct 7, 2019
1 parent 9d04f8d commit 5b01202
Show file tree
Hide file tree
Showing 53 changed files with 15,031 additions and 91 deletions.
16 changes: 8 additions & 8 deletions fabric-client/test/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using chaincode ID, chaincode version, chaincode path, and chaincode type', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').withArgs({
Expand Down Expand Up @@ -1715,7 +1715,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using chaincode ID, chaincode version, chaincode path, chaincode type, and metadata path', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').withArgs({
Expand Down Expand Up @@ -1749,7 +1749,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install, but not package, when dev mode is enabled', async () => {
client.setDevMode(true);
Expand All @@ -1771,7 +1771,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using a chaincode package', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').rejects(new Error('such error'));
Expand All @@ -1792,7 +1792,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using an explicit transaction ID', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').withArgs({
Expand Down Expand Up @@ -1825,7 +1825,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using the specified target peers', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').withArgs({
Expand Down Expand Up @@ -1858,7 +1858,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);

it('should install using the peers discovered for the channel', async () => {
const fromDirectoryStub = sinon.stub(Package, 'fromDirectory').withArgs({
Expand Down Expand Up @@ -1891,7 +1891,7 @@ describe('Client', () => {
sinon.assert.calledWith(signProposalStub, 'signer', 'proposal');
sinon.assert.calledWith(sendPeersProposalStub, ['peer'], 'signed-proposal', undefined);
response.should.deep.equal([['response'], 'proposal']);
});
}).timeout(200000);
});

describe('#initCredentialStores', () => {
Expand Down
35 changes: 35 additions & 0 deletions fabric-common/config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"request-timeout" : 45000,
"crypto-hash-algo": "SHA2",
"crypto-keysize": 256,
"crypto-hsm": false,
"crypto-suite-software": {
"EC": "fabric-common/lib/impl/CryptoSuite_ECDSA_AES.js"
},
"crypto-suite-hsm": {
"EC": "fabric-common/lib/impl/bccsp_pkcs11.js"
},
"channel-name-regx-checker":{
"pattern":"^[a-z][a-z0-9.-]*$",
"flags":""
},
"key-value-store": "fabric-common/lib/impl/FileKeyValueStore.js",
"certificate-authority-client": "fabric-ca-client",
"nonce-size" : 24,
"grpc-ssl-cipher-suites": "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384",
"connection-options": {
"grpc.max_receive_message_length": -1,
"grpc.max_send_message_length": -1,
"grpc.keepalive_time_ms": 120000,
"grpc.http2.min_time_between_pings_ms": 120000,
"grpc.keepalive_timeout_ms": 20000,
"grpc.http2.max_pings_without_data": 0,
"grpc.keepalive_permit_without_calls": 1,
"grpc-wait-for-ready-timeout": 3000,
"request-timeout" : 45000
},

"discovery-as-localhost": false,
"discovery-cache-life": 300000,
"discovery-override-protocol": null
}
Loading

0 comments on commit 5b01202

Please sign in to comment.