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");
// }