UNPKG

aiascs-blockchain

Version:

Sample Module for blockchain status of entities relate to each other

20 lines (13 loc) 456 B
const mongoose = require('mongoose'); const BlockChain = require("./src/BlockChain"); class Aiasc { constructor(){ var mongoDB = process.env.DBURL; mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true}); var db = mongoose.connection; db.on('error', console.error.bind(console, 'MongoDB connection error:')); let jesChain = new BlockChain(); console.log("Mine Block 1..."); jesChain.addBlock(new Block( "02/01/2021", "")); } }