Documentation ¶
Index ¶
- Constants
- func Run(node *node.Node, ossEndpoint string) error
- type DownloadKeeper
- func (d *DownloadKeeper) Download() error
- func (d *DownloadKeeper) DownloadFiles(start, end uint64, interval *util.Interval) error
- func (d *DownloadKeeper) GetInfoJson() (*util.Info, error)
- func (d *DownloadKeeper) GetObject(filename string) (*io.ReadCloser, error)
- func (d *DownloadKeeper) GetObjectToFile(filename string) error
- func (d *DownloadKeeper) SyncToNode(blocks []*types.Block) error
Constants ¶
View Source
const LOCALDIR = "./blocks/" // Local directory to store temp blocks files
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DownloadKeeper ¶
DownloadKeeper the struct for download
func NewDownloadKeeper ¶
func NewDownloadKeeper(node *node.Node, OssUrl string) (*DownloadKeeper, error)
NewDownloadKeeper return one new instance of DownloadKeeper
func (*DownloadKeeper) Download ¶
func (d *DownloadKeeper) Download() error
Download get blocks from OSS and update the node
func (*DownloadKeeper) DownloadFiles ¶
func (d *DownloadKeeper) DownloadFiles(start, end uint64, interval *util.Interval) error
DownloadFiles get block files from OSS, and update the node
func (*DownloadKeeper) GetInfoJson ¶
func (d *DownloadKeeper) GetInfoJson() (*util.Info, error)
GetInfoJson Download info.json
func (*DownloadKeeper) GetObject ¶
func (d *DownloadKeeper) GetObject(filename string) (*io.ReadCloser, error)
GetObject download the file object from OSS
func (*DownloadKeeper) GetObjectToFile ¶
func (d *DownloadKeeper) GetObjectToFile(filename string) error
GetObjectToFile download the file object from OSS to local
func (*DownloadKeeper) SyncToNode ¶
func (d *DownloadKeeper) SyncToNode(blocks []*types.Block) error
SyncToNode synchronize blocks to local node
Click to show internal directories.
Click to hide internal directories.