Updated examples nodejs contract lib version.

This commit is contained in:
ravinsp
2022-07-14 20:52:14 +05:30
parent b8dfd116c8
commit 69481e5265
3 changed files with 12 additions and 12 deletions

View File

@@ -21,7 +21,7 @@ const echoContract = async (ctx) => {
for (const user of ctx.users.list()) {
// This user's hex pubkey can be accessed from 'user.pubKey'
// This user's hex public key can be accessed from 'user.publicKey'
// For each user we add a promise to list of promises.
userHandlers.push(new Promise(async (resolve) => {
@@ -47,18 +47,18 @@ const echoContract = async (ctx) => {
await Promise.all(userHandlers);
// Get the user identified by public key.
// ctx.users.find("<PubkeyHex>");
// ctx.users.find("<public key hex>");
// Get list of all unl nodes in the cluster.
// ctx.unl.list();
// Get the unl node identified by public key.
// ctx.unl.find("<PubkeyHex>");
// ctx.unl.find("<public key hex>");
// NPL messages example.
// if (!ctx.readonly) {
// ctx.unl.onMessage((node, msg) => {
// console.log(msg + " from " + node.pubKey);
// console.log(msg + " from " + node.publicKey);
// })
// await ctx.unl.send("Hello");
// }

View File

@@ -6,7 +6,7 @@
"": {
"dependencies": {
"bson": "4.0.4",
"hotpocket-nodejs-contract": "0.5.3",
"hotpocket-nodejs-contract": "0.5.4",
"seedrandom": "3.0.5"
}
},
@@ -37,9 +37,9 @@
}
},
"node_modules/hotpocket-nodejs-contract": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.3.tgz",
"integrity": "sha512-IMyH6noQB1w6dcPTLxdrArMpfeT9d9VJPEQ5bxubDi9Gqeu+s+0E2tKP7wDY85ie7cG/IzC9v0TCbTggp2u12w=="
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.4.tgz",
"integrity": "sha512-3Qr8V6KurfmLe+UTnHWYwhO3a4ZTJq7HJ2G8GqMUVvCy7w3wRsxB1tGP9t3TEeFWIjLLA9d5Z4QbGAaIlUNONg=="
},
"node_modules/ieee754": {
"version": "1.1.13",
@@ -82,9 +82,9 @@
}
},
"hotpocket-nodejs-contract": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.3.tgz",
"integrity": "sha512-IMyH6noQB1w6dcPTLxdrArMpfeT9d9VJPEQ5bxubDi9Gqeu+s+0E2tKP7wDY85ie7cG/IzC9v0TCbTggp2u12w=="
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/hotpocket-nodejs-contract/-/hotpocket-nodejs-contract-0.5.4.tgz",
"integrity": "sha512-3Qr8V6KurfmLe+UTnHWYwhO3a4ZTJq7HJ2G8GqMUVvCy7w3wRsxB1tGP9t3TEeFWIjLLA9d5Z4QbGAaIlUNONg=="
},
"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.3",
"hotpocket-nodejs-contract": "0.5.4",
"bson": "4.0.4",
"seedrandom": "3.0.5"
}