Evernode Starter Contract (with package.json)

Moderator: EvrSteward

Post Reply
Styler
Posts: 5
Joined: Sun Feb 02, 2025 1:53 am

Evernode Starter Contract (with package.json)

Post by Styler »

Make sure you got npm installed.

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);
package.json

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
to install the dependencies

After that, write

Code: Select all

npm run build
to generate your deployable contract.

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.
Post Reply