/
syncer.go
22 lines (18 loc) · 998 Bytes
/
syncer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package v0
import (
"context"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/venus/venus-shared/types"
)
type ISyncer interface {
ChainSyncHandleNewTipSet(ctx context.Context, ci *types.ChainInfo) error //perm:write
SetConcurrent(ctx context.Context, concurrent int64) error //perm:admin
SyncerTracker(ctx context.Context) *types.TargetTracker //perm:read
Concurrent(ctx context.Context) int64 //perm:read
ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) //perm:read
SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write
SyncState(ctx context.Context) (*types.SyncState, error) //perm:read
// SyncIncomingBlocks returns a channel streaming incoming, potentially not
// yet synced block headers.
SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read
}