This commit is contained in:
supunvindula
2023-10-18 09:41:43 +05:30
3 changed files with 26 additions and 11 deletions

View File

@@ -57,10 +57,25 @@ const echoContract = async (ctx) => {
// NPL messages example.
// if (!ctx.readonly) {
// ctx.unl.onMessage((node, msg) => {
// console.log(msg + " from " + node.publicKey);
// })
// // Start listening to incoming NPL messages before we send ours.
// const promise = new Promise((resolve, reject) => {
// let timeout = setTimeout(() => {
// reject('NPL timeout.');
// }, 2000);
// let list = [];
// ctx.unl.onMessage((node, msg) => {
// console.log(`${node.publicKey} said ${msg} to me.`);
// list.push(msg);
// if (list.length == ctx.unl.list().length) {
// clearTimeout(timeout);
// resolve();
// }
// });
// });
// await ctx.unl.send("Hello");
// await promise;
// }
// Update patch config

View File

@@ -6,7 +6,7 @@
"": {
"dependencies": {
"bson": "4.0.4",
"hotpocket-nodejs-contract": "0.5.5",
"hotpocket-nodejs-contract": "0.5.10",
"seedrandom": "3.0.5"
}
},
@@ -37,9 +37,9 @@
}
},
"node_modules/hotpocket-nodejs-contract": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.5.tgz",
"integrity": "sha512-eeBBILgSMU1Yx6ulH7QIvgwVIgFkOuXJFdR4PZ2BeMk4KKr2ixl1YrB/V9UB/cg7ObKJCOH+hsU7oxbxECcBmQ=="
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.10.tgz",
"integrity": "sha512-1Cw9WcyoQmJabGkjRbM4FZ1HMvUI3z6IVTbhi0BDiD+K1c6bHROPgNKbIHCSL15+Z5xvbHpeuOOPLGogGtdC7Q=="
},
"node_modules/ieee754": {
"version": "1.1.13",
@@ -82,9 +82,9 @@
}
},
"hotpocket-nodejs-contract": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.5.tgz",
"integrity": "sha512-eeBBILgSMU1Yx6ulH7QIvgwVIgFkOuXJFdR4PZ2BeMk4KKr2ixl1YrB/V9UB/cg7ObKJCOH+hsU7oxbxECcBmQ=="
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.10.tgz",
"integrity": "sha512-1Cw9WcyoQmJabGkjRbM4FZ1HMvUI3z6IVTbhi0BDiD+K1c6bHROPgNKbIHCSL15+Z5xvbHpeuOOPLGogGtdC7Q=="
},
"ieee754": {
"version": "1.1.13",

View File

@@ -5,7 +5,7 @@
"build-diag": "ncc build diagnostic_contract.js -o dist/diagnostic-contract"
},
"dependencies": {
"hotpocket-nodejs-contract": "0.5.5",
"hotpocket-nodejs-contract": "0.5.10",
"bson": "4.0.4",
"seedrandom": "3.0.5"
}