Add a command to read an object by its cid

This commit is contained in:
whyrusleeping
2019-10-01 10:28:07 -06:00
parent 62e596d0a3
commit 404e14d3eb
4 changed files with 41 additions and 0 deletions
+1
View File
@@ -56,6 +56,7 @@ type FullNode interface {
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
ChainGetBlockReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)
ChainGetTipSetByHeight(context.Context, uint64, *types.TipSet) (*types.TipSet, error)
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
// syncer
SyncState(context.Context) (*SyncState, error)
+5
View File
@@ -46,6 +46,7 @@ type FullNodeStruct struct {
ChainGetBlockMessages func(context.Context, cid.Cid) (*BlockMessages, error) `perm:"read"`
ChainGetBlockReceipts func(context.Context, cid.Cid) ([]*types.MessageReceipt, error) `perm:"read"`
ChainGetTipSetByHeight func(context.Context, uint64, *types.TipSet) (*types.TipSet, error) `perm:"read"`
ChainReadObj func(context.Context, cid.Cid) ([]byte, error) `perm:"read"`
SyncState func(context.Context) (*SyncState, error) `perm:"read"`
@@ -286,6 +287,10 @@ func (c *FullNodeStruct) ChainNotify(ctx context.Context) (<-chan []*store.HeadC
return c.Internal.ChainNotify(ctx)
}
func (c *FullNodeStruct) ChainReadObj(ctx context.Context, obj cid.Cid) ([]byte, error) {
return c.Internal.ChainReadObj(ctx, obj)
}
func (c *FullNodeStruct) SyncState(ctx context.Context) (*SyncState, error) {
return c.Internal.SyncState(ctx)
}