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 }
func getDiskCachePath(cfg *config.Wrapper, folder string, blockHash []byte) string { blockHashString := b64.URLEncoding.EncodeToString(blockHash) return path.Join(path.Dir(cfg.ConfigPath()), folder, blockHashString) }