1.2.3 • Published 3 years ago
nodejs-blockchain-interaction v1.2.3
Nodejs Blockchain Interaction module
This is a module for interacting with an already deployed blockchain contract, using nodejs.
How to use:
To run this project, install it locally using npm:
$ npm init -y
$ npm install nodejs-blockchain-interaction
Then create a node-js file, example:
const {getFacets, getFacetsFullDetails, addTest1Facet, removeTest1Facet, testTest1FacetTransactionAddProduct, testTest1FacetTransactionRetrieveProduct, addTest2Facet, removeTest2Facet, testTest2FacetTransactionRetrieveProduct} = require("nodejs-blockchain-interaction");
async function Test() {
let facetAddresses = await getFacets();
console.log(facetAddresses);
// Return all faucets and their functions
// let facetsFullDetails = await getFacetsFullDetails();
// console.log(facetsFullDetails);
// Add Test1Facet and its functions
// await addTest1Facet();
// Remove Test1Facet and its functions
// await removeTest1Facet();
// Add a new Product
// await testTest1FacetTransactionAddProduct("prodA1", "value3");
// Retrieve a Product using facet1
// let test1Prod = await testTest1FacetTransactionRetrieveProduct("prdA");
// console.log(test1Prod);
// Add Test2Facet and its functions
// await addTest2Facet();
// Remove Test2Facet and its functions
// await removeTest2Facet();
// Retrieve a Product using facet2
// let test2Prod = await testTest2FacetTransactionRetrieveProduct("prodA1");
// console.log(test2Prod);
}
Test();