package blockinfodatabase import ( "Chain/pkg/utils" "github.com/syndtr/goleveldb/leveldb" ) // BlockInfoDatabase is a wrapper for a levelDB type BlockInfoDatabase struct { db *leveldb.DB } // New returns a BlockInfoDatabase given a Config func New(config *Config) *BlockInfoDatabase { db, err := leveldb.OpenFile(config.DatabasePath, nil) if err != nil { utils.Debug.Printf("Unable to initialize BlockInfoDatabase with path {%v}", config.DatabasePath) } return &BlockInfoDatabase{db: db} } // StoreBlockRecord stores a BlockRecord in the BlockInfoDatabase. func (blockInfoDB *BlockInfoDatabase) StoreBlockRecord(hash string, blockRecord *BlockRecord) { //TODO } // GetBlockRecord returns a BlockRecord from the BlockInfoDatabase given // the relevant block's hash. func (blockInfoDB *BlockInfoDatabase) GetBlockRecord(hash string) *BlockRecord { //TODO return nil }