Wording changes.

This commit is contained in:
ravinsp
2022-08-12 11:40:08 +05:30
parent 7d9dda7971
commit e282484c60
7 changed files with 16 additions and 16 deletions

View File

@@ -7,7 +7,7 @@
"start": "npm run build && hpdevkit deploy dist"
},
"dependencies": {
"hotpocket-nodejs-contract": "0.5.4",
"hotpocket-nodejs-contract": "0.5.6",
"@vercel/ncc": "0.34.0"
}
}

View File

@@ -44,7 +44,7 @@ export class _projname_ {
}
async setData(data) {
// Hot Pocket subjects data on-disk to consensus.
// HotPocket subjects data-on-disk to consensus.
await fs.writeFile(dataFile, data);
}

View File

@@ -1,21 +1,21 @@
const HotPocket = require('hotpocket-nodejs-contract');
const { _projname_ } = require('./_projname_');
// Hot Pocket smart contract is defined as a function which takes the Hot Pocket ExecutionContext as an argument.
// HotPocket smart contract is defined as a function which takes the HotPocket contract context as an argument.
// This function gets invoked every consensus round and whenever a user sends a out-of-concensus read-request.
async function contract(ctx) {
// Create our application logic component.
// This pattern allows us to test the application logic independently of Hot Pocket.
// This pattern allows us to test the application logic independently of HotPocket.
const app = new _projname_();
// Wire-up output emissions from the application before we pass user inputs to it.
app.sendOutput = async (userPublicKey, output) => {
// In Hot Pocket, each user is represented by their Ed25519 public key.
// In HotPocket, each user is represented by their Ed25519 public key.
const user = ctx.users.find(userPublicKey);
await user.send(output)
}
// In 'readonly' mode, nothing our contract does will get persisted on the ledger. The benefit is
// readonly messages gets processed much faster due to not being subjected to consensus.
// We should only use readonly mode for returning/replying data for the requesting user.