Documentation
¶
Index ¶
- func FindCIDFromDigest(base32MultibaseDigest string) (cid.Cid, error)
- func IpfsClusterPins(ctx context.Context, lastChecked time.Time, account string) (<-chan datamodel.Link, <-chan error)
- type Blox
- func (p *Blox) AnnounceJoinPoolRequestPeriodically(ctx context.Context)
- func (p *Blox) BloxFreeSpace(ctx context.Context, to peer.ID) ([]byte, error)
- func (p *Blox) EraseBlData(ctx context.Context, to peer.ID) ([]byte, error)
- func (p *Blox) FetchAvailableManifestsAndStore(ctx context.Context, maxCids int) error
- func (p *Blox) FindLinkProvidersByDht(l ipld.Link) ([]peer.AddrInfo, error)
- func (p *Blox) GetBlMembers() map[peer.ID]common.MemberStatus
- func (p *Blox) GetCidv1FromBlockFilename(filename string) (cid.Cid, error)
- func (p *Blox) GetIPFSRPC() *rpc.HttpApi
- func (p *Blox) GetLastCheckedTime() (time.Time, error)
- func (p *Blox) Has(ctx context.Context, l ipld.Link) (bool, error)
- func (p *Blox) ListModifiedStoredBlocks(lastChecked time.Time) ([]datamodel.Link, error)
- func (p *Blox) ListModifiedStoredLinks(ctx context.Context, lastChecked time.Time, account string) ([]datamodel.Link, error)
- func (p *Blox) Load(ctx context.Context, l ipld.Link, np ipld.NodePrototype) (ipld.Node, error)
- func (p *Blox) Ping(ctx context.Context, to peer.ID) (int, int, error)
- func (p *Blox) PingDht(to peer.ID) error
- func (p *Blox) ProvideLinkByDht(l ipld.Link) error
- func (p *Blox) PubsubValidator(ctx context.Context, id peer.ID, msg *pubsub.Message) bool
- func (p *Blox) Pull(ctx context.Context, from peer.ID, l ipld.Link) error
- func (p *Blox) Push(ctx context.Context, from peer.ID, l ipld.Link) error
- func (p *Blox) ServeIpfsRpc() http.Handler
- func (p *Blox) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, allow bool) error
- func (p *Blox) Shutdown(ctx context.Context) error
- func (p *Blox) Start(ctx context.Context) error
- func (p *Blox) StartAnnouncementServer(ctx context.Context) error
- func (p *Blox) StartPingServer(ctx context.Context) error
- func (p *Blox) Store(ctx context.Context, n ipld.Node) (ipld.Link, error)
- func (p *Blox) StoreCid(ctx context.Context, l ipld.Link, limit int) error
- func (p *Blox) StoreManifest(ctx context.Context, links []blockchain.LinkWithLimit, maxCids int) error
- func (p *Blox) UpdateDhtPeers(peers []peer.ID) error
- func (p *Blox) UpdateFailedCids(links []datamodel.Link) error
- func (p *Blox) UpdateLastCheckedTime() error
- type CidStruct
- type FilesStat
- type Option
- func WithAnnounceInterval(i time.Duration) Option
- func WithBlockchainEndPoint(b string) Option
- func WithChainName(n string) Option
- func WithDatastore(ds datastore.Batching) Option
- func WithDefaultIPFShttpServer(n string) Option
- func WithExchangeOpts(eo ...exchange.Option) Option
- func WithGetChainName(getChainName func() string) Option
- func WithGetPoolName(getPoolName PoolNameGetter) Option
- func WithHost(h host.Host) Option
- func WithIpfsClient(n *rpc.HttpApi) Option
- func WithIpfsClusterAPI(n ipfsCluster.Client) Option
- func WithLinkSystem(ls *ipld.LinkSystem) Option
- func WithMaxPingTime(pt int) Option
- func WithMinSuccessPingRate(sr int) Option
- func WithPingCount(pc int) Option
- func WithPoolHostMode(n bool) Option
- func WithPoolName(n string) Option
- func WithRelays(r []string) Option
- func WithSecretsPath(b string) Option
- func WithStoreDir(n string) Option
- func WithTopicName(n string) Option
- func WithUpdateChainName(updateChainName func(string) error) Option
- func WithUpdatePoolName(updatePoolName PoolNameUpdater) Option
- func WithWg(wg *sync.WaitGroup) Option
- type PeerStats
- type PoolNameGetter
- type PoolNameUpdater
- type RepoInfo
- type SizeStat
- type StatsBitswap
- type StatsBw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindCIDFromDigest ¶ added in v1.54.8
Types ¶
type Blox ¶
type Blox struct {
// contains filtered or unexported fields
}
func (*Blox) AnnounceJoinPoolRequestPeriodically ¶ added in v1.15.0
func (*Blox) BloxFreeSpace ¶ added in v1.29.0
func (*Blox) EraseBlData ¶ added in v1.30.0
func (*Blox) FetchAvailableManifestsAndStore ¶ added in v1.16.0
FetchAvailableManifestsAndStore fetches available manifests and stores them.
func (*Blox) FindLinkProvidersByDht ¶ added in v1.16.0
func (*Blox) GetBlMembers ¶ added in v1.15.0
func (p *Blox) GetBlMembers() map[peer.ID]common.MemberStatus
func (*Blox) GetCidv1FromBlockFilename ¶ added in v1.53.0
GetCidv1FromBlockFilename extracts CIDv1 from block filename
func (*Blox) GetIPFSRPC ¶ added in v1.53.0
func (*Blox) GetLastCheckedTime ¶ added in v1.53.0
func (*Blox) ListModifiedStoredBlocks ¶ added in v1.53.0
ListModifiedStoredBlocks lists only the folders that have been modified after the last check time and returns the filenames of the files created after the last check time in those folders.
func (*Blox) ListModifiedStoredLinks ¶ added in v1.54.8
func (p *Blox) ListModifiedStoredLinks(ctx context.Context, lastChecked time.Time, account string) ([]datamodel.Link, error)
This method fetches the pinned items in ipfs-cluster since the lastChecked time
func (*Blox) PubsubValidator ¶ added in v1.15.0
func (*Blox) ServeIpfsRpc ¶ added in v1.14.2
func (*Blox) StartAnnouncementServer ¶ added in v1.15.0
func (*Blox) StartPingServer ¶ added in v1.15.0
func (*Blox) StoreManifest ¶ added in v1.16.0
func (p *Blox) StoreManifest(ctx context.Context, links []blockchain.LinkWithLimit, maxCids int) error
func (*Blox) UpdateFailedCids ¶ added in v1.54.8
UpdateFailedCids updates the last checked time by appending failed CIDs to a file. It collects all errors encountered and returns them together.
func (*Blox) UpdateLastCheckedTime ¶ added in v1.53.0
UpdateLastCheckedTime updates the last checked time
type FilesStat ¶ added in v1.14.2
type FilesStat struct {
Blocks int `json:"Blocks"`
CumulativeSize uint64 `json:"CumulativeSize"`
Hash string `json:"Hash"`
Local bool `json:"Local,omitempty"` // Optional field. 'omitempty' keyword is used to exclude the field from the output if it's default/zero value
Size uint64 `json:"Size"`
SizeLocal uint64 `json:"SizeLocal,omitempty"` // Optional field.
Type string `json:"Type"`
WithLocality bool `json:"WithLocality,omitempty"` // Optional field.
}
type Option ¶
type Option func(*options) error
func WithAnnounceInterval ¶
WithAnnounceInterval sets the interval at which announcements are made on the pubsub. Defaults to 5 seconds if unset.
func WithBlockchainEndPoint ¶ added in v1.15.0
func WithChainName ¶ added in v1.55.15
func WithDatastore ¶
func WithDefaultIPFShttpServer ¶ added in v1.46.0
func WithExchangeOpts ¶ added in v1.0.0
func WithGetChainName ¶ added in v1.55.15
func WithGetPoolName ¶ added in v1.54.8
func WithGetPoolName(getPoolName PoolNameGetter) Option
func WithHost ¶
WithHost sets the libp2p host on which the blox is exposed. If unset a default host with random identity is used. See: libp2p.New.
func WithIpfsClient ¶ added in v1.48.0
func WithIpfsClusterAPI ¶ added in v1.53.0
func WithIpfsClusterAPI(n ipfsCluster.Client) Option
func WithLinkSystem ¶
func WithLinkSystem(ls *ipld.LinkSystem) Option
func WithMaxPingTime ¶ added in v1.15.0
func WithMinSuccessPingRate ¶ added in v1.15.0
func WithPingCount ¶ added in v1.15.0
func WithPoolHostMode ¶ added in v1.53.0
func WithPoolName ¶
WithPoolName sets a human readable name for the pool that the blox should join or create. Required.
func WithRelays ¶ added in v1.15.0
WithStoreDir sets a the store directory we are using for datastore Required.
func WithSecretsPath ¶ added in v1.41.0
func WithStoreDir ¶ added in v1.14.2
WithStoreDir sets a the store directory we are using for datastore Required.
func WithTopicName ¶
WithTopicName sets the name of the topic onto which announcements are made. Defaults to "/explore.fula/pools/<pool-name>" if unset. See: WithPoolName.
func WithUpdateChainName ¶ added in v1.55.15
func WithUpdatePoolName ¶ added in v1.15.0
func WithUpdatePoolName(updatePoolName PoolNameUpdater) Option
type PoolNameGetter ¶ added in v1.54.8
type PoolNameGetter func() string
type PoolNameUpdater ¶ added in v1.15.0
type StatsBitswap ¶ added in v1.14.2
type StatsBitswap struct {
BlocksReceived uint64 `json:"BlocksReceived"`
BlocksSent uint64 `json:"BlocksSent"`
DataReceived uint64 `json:"DataReceived"`
DataSent uint64 `json:"DataSent"`
DupBlksReceived uint64 `json:"DupBlksReceived"`
DupDataReceived uint64 `json:"DupDataReceived"`
MessagesReceived uint64 `json:"MessagesReceived"`
Peers []string `json:"Peers"`
ProvideBufLen int `json:"ProvideBufLen"`
Wantlist []CidStruct `json:"Wantlist"`
}