public void InitChain(string dbpath, ChainInfo info) { if (this.db != null) { throw new Exception("already had inited."); } db = new db.simple.DB(); db.Open(dbpath, true); var blockcount = db.GetUInt64Direct(TableID_SystemInfo, Key_SystemInfo_BlockCount); if (blockcount == 0) { //insert first block //first block 会有几笔特殊交易 //设置magicinfo //设置初始见证人 //发行默认货币PET var block = new block.Block(); db.PutDirect(TableID_Blocks, BitConverter.GetBytes(blockcount), block.ToBytes()); } }
public ServerDomain(AllPet.db.simple.DB simpledb, IModulePipeline from) { this.SimpleDb = simpledb; this.From = from; }