示例#1
0
func openDatabase(cfg *config.Wrapper) *bolt.DB {
	databasePath := path.Join(path.Dir(cfg.ConfigPath()), "boltdb")
	database, _ := bolt.Open(databasePath, 0600, nil) // TODO check error
	return database
}
示例#2
0
func getDiskCachePath(cfg *config.Wrapper, folder string, blockHash []byte) string {
	blockHashString := b64.URLEncoding.EncodeToString(blockHash)
	return path.Join(path.Dir(cfg.ConfigPath()), folder, blockHashString)
}