Documentation ¶
Index ¶
- func AnnouncementAddresses() ([]multiaddr.Multiaddr, error)
- type Node
- func (n *Node) AddBlock(ctx context.Context, block blocks.Block) error
- func (n *Node) AddPeer(addr peer.AddrInfo)
- func (n *Node) Close() error
- func (n *Node) ConnectionAddresses() ([]multiaddr.Multiaddr, error)
- func (n *Node) GetBlock(ctx context.Context, c cid.Cid) (format.Node, error)
- func (n *Node) HasBlock(ctx context.Context, c cid.Cid) (bool, error)
- func (n *Node) PeerID() peer.ID
- func (n *Node) Peers() []peer.ID
- func (n *Node) Pin(ctx context.Context, root cid.Cid, recursive bool) error
- func (n *Node) TriggerReprovider()
- type PinnedCID
- type Provider
- type ReprovideStore
- type Reprovider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnouncementAddresses ¶
func AnnouncementAddresses() ([]multiaddr.Multiaddr, error)
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
A Node is a minimal IPFS node
func NewNode ¶
func NewNode(ctx core.Context, cfg *config.Config, rs ReprovideStore, ds datastore.Batching, bs blockstore.Blockstore) (*Node, error)
NewNode creates a new IPFS node
func (*Node) ConnectionAddresses ¶
func (*Node) TriggerReprovider ¶
func (n *Node) TriggerReprovider()
type PinnedCID ¶
type PinnedCID struct { CID cid.Cid `json:"cid"` LastAnnouncement time.Time `json:"lastAnnouncement"` }
PinnedCID is a CID that needs to be periodically announced.
type Provider ¶
type Provider interface { provider.Ready provider.ProvideMany }
A Provider provides CIDs to the IPFS network.
type ReprovideStore ¶
type ReprovideStore interface { ProvideCIDs(limit int) ([]PinnedCID, error) SetLastAnnouncement(cids []cid.Cid, t time.Time) error }
A ReprovideStore stores CIDs that need to be periodically announced.
type Reprovider ¶
type Reprovider struct {
// contains filtered or unexported fields
}
A Reprovider periodically announces CIDs to the IPFS network.
func NewReprovider ¶
func NewReprovider(provider Provider, store ReprovideStore, log *zap.Logger) *Reprovider
NewReprovider creates a new reprovider.
func (*Reprovider) Run ¶
Run starts the reprovider loop, which periodically announces CIDs that have not been announced in the last interval.
func (*Reprovider) Trigger ¶
func (r *Reprovider) Trigger()
Trigger triggers the reprovider loop to run immediately.
Click to show internal directories.
Click to hide internal directories.