Skip to content

Commit a0475bf

Browse files
committed
- added timestamp field to chaincode obj
1 parent 8dd154d commit a0475bf

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,20 @@ It is returned in the callback to load_chaincode() and contains all your cc func
331331
CUSTOM_FUNCTION_NAME2: function(args, cb){etc...};
332332
CUSTOM_FUNCTION_NAME3: function(args, cb){etc...};
333333
^^ etc...
334-
read: function(name, cb), //read variable
335-
query: function(args, cb), //^^
336-
write: function(name, value, cb), //write/create variable
337-
remove: function(name, cb), //delete variable
338-
deploy: function(func, args, path, cb), //deploy loaded chaincode
339-
details:{ //input options get stored here, sometimes handy
340-
deployed_name: '',
341-
func: [],
342-
unzip_dir: '',
334+
read: function(name, cb), //read variable
335+
query: function(args, cb), //^^
336+
write: function(name, value, cb), //write/create variable
337+
remove: function(name, cb), //delete variable
338+
deploy: function(func, args, path, cb), //deploy loaded chaincode
339+
details:{ //input options get stored here, sometimes handy
340+
deployed_name: '', //hash of deployed chaincode
341+
func: [], //array of function names found
343342
git_url: '',
344-
peers: [],
345-
vars: [],
343+
peers: [], //peer list provided in network()
344+
timestamp: 0, //unix timestamp in ms of parsing
345+
users: [], //users provided in load()
346+
vars: [], //tbd
347+
unzip_dir: '',
346348
zip_url: '',
347349
}
348350
};

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ibc.prototype.load = function(options, cb){
6060
func: [],
6161
git_url: '',
6262
peers: [],
63+
timestamp: 0,
6364
users: [],
6465
vars: [],
6566
unzip_dir: '',
@@ -244,6 +245,7 @@ ibc.prototype.load_chaincode = function(options, cb) {
244245
}
245246

246247
// Step 3.
248+
ibc.chaincode.details.timestamp = Date.now();
247249
ibc.chaincode.read = read;
248250
ibc.chaincode.query = query;
249251
ibc.chaincode.write = write;

0 commit comments

Comments
 (0)