UNPKG

aiascs-blockchain

Version:

Sample Module for blockchain status of entities relate to each other

32 lines (24 loc) 428 B
const mongoose = require("mongoose"); const Schema = mongoose.Schema; var BlockSchema = new Schema({ timeStamp:{ type:Date, default:Date.now() }, previousHash:{ type:String, }, data:{ type:String }, hash:{ type:String }, nonce:{ type:Number } }); var BlockChainSchema = new Schema({ blocks:[BlockSchema] }); var BlockModel = mongoose.model('BlockChain', BlockChainSchema );