Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { StateListMiners(context.Context, *types.TipSet) ([]address.Address, error) StateMinerPower(context.Context, address.Address, *types.TipSet) (api.MinerPower, error) ChainHead(context.Context) (*types.TipSet, error) ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) ChainGetTipSetByHeight(context.Context, uint64, *types.TipSet) (*types.TipSet, error) StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) StateReadState(context.Context, *types.Actor, *types.TipSet) (*api.ActorState, error) StateMinerPeerID(ctx context.Context, m address.Address, ts *types.TipSet) (peer.ID, error) ChainGetGenesis(context.Context) (*types.TipSet, error) ChainGetPath(context.Context, types.TipSetKey, types.TipSetKey) ([]*store.HeadChange, error) }
API provides an abstraction to a Filecoin full-node
type ChainIndex ¶
ChainIndex contains on-chain information about miners
type Index ¶
type Index struct { Meta MetaIndex Chain ChainIndex }
Index contains on-chain and off-chain information about miners
type MinerIndex ¶
type MinerIndex struct {
// contains filtered or unexported fields
}
MinerIndex builds and provides information about FC miners
func New ¶
func New(ds datastore.TxnDatastore, api API, h P2PHost, lr iplocation.LocationResolver) (*MinerIndex, error)
New returns a new MinerIndex. It loads from ds any previous state and starts immediately making the index up to date.
func (*MinerIndex) Get ¶
func (mi *MinerIndex) Get() Index
Get returns a copy of the current index information
func (*MinerIndex) Listen ¶
func (mi *MinerIndex) Listen() <-chan struct{}
Listen returns a channel signaler to notify when new index information is available.
func (*MinerIndex) Unregister ¶
func (mi *MinerIndex) Unregister(c chan struct{})
Unregister unregisters a channel signaler from the signaler hub
type Service ¶
type Service struct { pb.UnimplementedAPIServer // contains filtered or unexported fields }
Service implements the gprc service
func NewService ¶
func NewService(mi *MinerIndex) *Service
NewService is a helper to create a new Service