Documentation ¶
Index ¶
- Constants
- Variables
- type ChainDB
- func (fs *ChainDB) AddBlock(b *types.Block) error
- func (fs *ChainDB) AddFile(x *types.FileInfo) (uint64, bool, error)
- func (fs *ChainDB) Anchor(n uint64)
- func (fs *ChainDB) Blocks() []*types.Block
- func (fs *ChainDB) CheckPoint() uint64
- func (fs *ChainDB) Close() error
- func (fs *ChainDB) Files() []*types.FileInfo
- func (fs *ChainDB) Flush() error
- func (fs *ChainDB) GetBlockByNumber(blockNum uint64) *types.Block
- func (fs *ChainDB) GetFileByAddr(addr common.Address) *types.FileInfo
- func (fs *ChainDB) GetRoot(number uint64) (root []byte)
- func (fs *ChainDB) GetTorrentProgress(ih string) (progress uint64, err error)
- func (fs *ChainDB) ID() uint64
- func (fs *ChainDB) Init() (err error)
- func (fs *ChainDB) InitBlockNumber() error
- func (fs *ChainDB) InitTorrents() (map[string]uint64, error)
- func (fs *ChainDB) LastListenBlockNumber() uint64
- func (fs *ChainDB) Leaves() []merkletree.Content
- func (fs *ChainDB) Metrics() time.Duration
- func (fs *ChainDB) NewFileInfo(fileMeta *types.FileMeta) *types.FileInfo
- func (fs *ChainDB) Reset() error
- func (fs *ChainDB) Root() common.Hash
- func (fs *ChainDB) SetTorrentProgress(ih string, size uint64) (bool, uint64, error)
- func (fs *ChainDB) SkipPrint()
- func (fs *ChainDB) Torrents() map[string]uint64
- func (fs *ChainDB) Txs() uint64
- func (fs *ChainDB) Version() string
Constants ¶
View Source
const ( FILES_ = "files_" BLOCKS_ = "blocks_" ID_ = "id_" VERSION_ = "version_" TORRENT_ = "torrent_" CUR_BLOCK_NUM_ = "currentBlockNumber_" )
Variables ¶
View Source
var (
ErrReadDataFromBoltDB = errors.New("bolt DB Read Error")
)
Functions ¶
This section is empty.
Types ¶
type ChainDB ¶
type ChainDB struct {
// contains filtered or unexported fields
}
func (*ChainDB) CheckPoint ¶
func (*ChainDB) GetBlockByNumber ¶
func (*ChainDB) GetFileByAddr ¶
func (*ChainDB) GetTorrentProgress ¶
GetTorrent return the torrent status by uint64, if return 0 for torrent not exist
func (*ChainDB) InitBlockNumber ¶ added in v1.0.2
func (*ChainDB) LastListenBlockNumber ¶
func (*ChainDB) Leaves ¶
func (fs *ChainDB) Leaves() []merkletree.Content
func (*ChainDB) NewFileInfo ¶
func (*ChainDB) SetTorrentProgress ¶
SetTorrent is for recording torrent latest status
Click to show internal directories.
Click to hide internal directories.