4 "github.com/aliyun/aliyun-oss-go-sdk/oss"
6 "github.com/bytom/vapor/toolbar/apinode"
7 "github.com/bytom/vapor/toolbar/osssync/config"
8 "github.com/bytom/vapor/toolbar/osssync/util"
11 // BlockKeeper the struct of the BlockKeeper
12 type BlockKeeper struct {
16 FileUtil *util.FileUtil
19 // NewBlockKeeper return one new instance of BlockKeeper
20 func NewBlockKeeper() (*BlockKeeper, error) {
21 cfg := &config.Config{}
22 err := config.LoadConfig(&cfg)
27 node := apinode.NewNode(cfg.VaporURL)
29 ossClient, err := oss.New(cfg.Oss.Endpoint, cfg.Oss.AccessKeyID, cfg.Oss.AccessKeySecret)
34 ossBucket, err := ossClient.Bucket("bytom-seed")
39 fileUtil := util.NewFileUtil("./blocks")