Skip to content

Commit

Permalink
[FABN-909] Add new fabric-protos module
Browse files Browse the repository at this point in the history
In order to move common (between the fabric-client
and fabric-ca-client modules) code into the fabric-common
module, the protocol buffer definitions must be moved
as well.

This CR moves the protocol buffer definitions into a
new fabric-protos module, that exports all available
classes via the same structure that ProtoLoader.load
is currently returning.

This means that the protocol buffer definitions can
only be loaded *once* in a single place; currently
they are loaded multiple times in multiple code files.

The protocol buffer definitions can easily be updated
by running "npm run update" within this module. Today
they have to be manually copied from Fabric, and edited
to fix up the include paths.

Future changes could look at generating static JavaScript
code (using protoc), or switching to a newer version of
protobufjs - however both of these (I did look!) require
substantial code changes to the SDK due to protocol
buffer API changes.

Change-Id: I7b41106d9afcea72c081f5b23bc2192b8cb86020
Signed-off-by: Simon Stone <[email protected]>
  • Loading branch information
Simon Stone committed Jan 18, 2019
1 parent 0fd719d commit 8b4715a
Show file tree
Hide file tree
Showing 49 changed files with 11,532 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ fabric-network/OUTSTA*
#fabric common items
fabric-common/node_modules/*
fabric-common/.nyc_output

#fabric protos items
fabric-protos/node_modules/*
fabric-protos/.nyc_output
1 change: 1 addition & 0 deletions build/tasks/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gulp.task('eslint', () => {
'!node_modules/**',
'!test/typescript/**/*.js',
'!tmp/**',
'!fabric-protos/**',
]).pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
Expand Down
Loading

0 comments on commit 8b4715a

Please sign in to comment.