Create these two files in a folder:
contract.js
Code: Select all
const HotPocket = require("hotpocket-nodejs-contract");
const mycontract = async (ctx) => {
// Your DApp logic.
console.log("Blank contract");
};
const hpc = new HotPocket.Contract();
hpc.init(mycontract);
Code: Select all
{
"name": "mycontract",
"version": "1.0.0",
"scripts": {
"build": "npx ncc build contract.js -o deployablecontract",
"build:prod": "npx ncc build contract.js --minify -o deployablecontract"
},
"dependencies": {
"hotpocket-nodejs-contract": "^0.7.3",
"@vercel/ncc": "0.34.0"
}
}
Browse to this folder in vscode, write
Code: Select all
npm i
After that, write
Code: Select all
npm run build
Your starter contract will then be in the deployable folder. And this is the folder you will use when you deploy your contract to an instance.