chore: restoring node req.

This commit is contained in:
ppedziwiatr
2022-04-04 10:45:51 +02:00
parent 4311edfdae
commit 4b3f2a81ab
2 changed files with 11 additions and 5 deletions

View File

@@ -1,11 +1,14 @@
{
"name": "redstone-smartweave",
"version": "0.4.55",
"version": "0.4.56",
"description": "An implementation of the SmartWeave smart contract protocol.",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"types": "./lib/types/index.d.ts",
"sideEffects": false,
"engines": {
"node": ">=16.5"
},
"scripts": {
"build:cjs": "tsc -b tsconfig.json && tsc-alias -p tsconfig.json",
"build:esm": "tsc -b tsconfig.esm.json && tsc-alias -p tsconfig.esm.json",

View File

@@ -40,25 +40,28 @@ async function main() {
const jwk = readJSON('../redstone-node/.secrets/redstone-jwk.json');
// connecting to a given contract
const token = smartweave
.contract("KT45jaf8n9UwgkEareWxPgLJk4oMWpI5NODgYVIF1fY")
.contract("-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ")
.setEvaluationOptions({
useVM2: true,
sequencerAddress: "https://gateway.redstone.finance/"
})
// connecting wallet to a contract. It is required before performing any "writeInteraction"
// calling "writeInteraction" without connecting to a wallet first will cause a runtime error.
.connect(jwk);
//const result1 = await token.readState();
const result1 = await token.readState();
console.log(token.lastReadStateStats());
//logger.info("Amount of computed interactions before 'bundleInteraction':", Object.keys(result1.validity).length);
for (let i = 0 ; i < 100 ; i++) {
/*for (let i = 0 ; i < 100 ; i++) {
console.log(`mint ${i + 1}`);
const result = await token.bundleInteraction<any>({
function: "mint"
});
await sleep(1000);
}
}*/