diff --git a/api/api_full.go b/api/api_full.go index 472b34596..c03710ad8 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -168,6 +168,9 @@ type FullNode interface { // if supported by the underlying implementation. ChainCheckBlockstore(context.Context) error //perm:read + // ChainBlockstoreInfo returns some basic information about the blockstore + ChainBlockstoreInfo(context.Context) (map[string]interface{}, error) //perm:read + // MethodGroup: Beacon // The Beacon method group contains methods for interacting with the random beacon (DRAND) diff --git a/node/impl/full/chain.go b/node/impl/full/chain.go index c36e99ffc..c5c2334ad 100644 --- a/node/impl/full/chain.go +++ b/node/impl/full/chain.go @@ -656,3 +656,12 @@ func (a *ChainAPI) ChainCheckBlockstore(ctx context.Context) error { return checker.Check() } + +func (a *ChainAPI) ChainBlockstoreInfo(ctx context.Context) (map[string]interface{}, error) { + info, ok := a.BaseBlockstore.(interface{ Info() map[string]interface{} }) + if !ok { + return nil, xerrors.Errorf("underlying blockstore does not provide info") + } + + return info.Info(), nil +}