libp2p.filecoin package
Filecoin DX helpers for py-libp2p. This package locks canonical protocol/topic constants and ships bootstrap/preset helpers plus a lightweight CLI.
Scope boundary and architecture positioning:
Submodules
libp2p.filecoin.constants module
libp2p.filecoin.networks module
- class libp2p.filecoin.networks.FilecoinNetworkPreset(name: 'NetworkAlias', genesis_network_name: 'str', bootstrap_addresses: 'tuple[str, ...]')
Bases:
object
- libp2p.filecoin.networks.get_network_preset(network: Literal['mainnet', 'calibnet'] | str) FilecoinNetworkPreset
libp2p.filecoin.bootstrap module
- libp2p.filecoin.bootstrap.filter_bootstrap_for_transport(addrs: list[str], include_tcp: bool = True, include_quic: bool = False) list[str]
libp2p.filecoin.pubsub module
- libp2p.filecoin.pubsub.build_filecoin_gossipsub(network_name: str, bootstrapper: bool = False, direct_peers: Sequence[PeerInfo] | None = None, score_mode: str = 'thresholds_only', protocols: Sequence[TProtocol] | None = None) GossipSub
libp2p.filecoin.cli module
- libp2p.filecoin.cli.build_parser() ArgumentParser
Module contents
Filecoin-focused developer experience helpers for py-libp2p.
- class libp2p.filecoin.FilecoinAddress(protocol: Literal[0, 1, 2, 3, 4], is_testnet: bool, payload: bytes, namespace: int | None)
Bases:
objectA parsed Filecoin address.
- class libp2p.filecoin.FilecoinNetworkPreset(name: 'NetworkAlias', genesis_network_name: 'str', bootstrap_addresses: 'tuple[str, ...]')
Bases:
object
- libp2p.filecoin.address_protocol(addr_str: str) Literal[0, 1, 2, 3, 4]
Return the protocol indicator byte from addr_str without full parsing.
- libp2p.filecoin.build_filecoin_gossipsub(network_name: str, bootstrapper: bool = False, direct_peers: Sequence[PeerInfo] | None = None, score_mode: str = 'thresholds_only', protocols: Sequence[TProtocol] | None = None) GossipSub
- libp2p.filecoin.build_filecoin_pubsub(host: IHost, network_name: str, bootstrapper: bool = False, gossipsub: GossipSub | None = None, score_mode: str = 'thresholds_only', strict_signing: bool = True, direct_peers: Sequence[PeerInfo] | None = None) Pubsub
- libp2p.filecoin.filecoin_message_id(msg: object) bytes
Expect
msgto expose a bytes-likedataattribute.
- libp2p.filecoin.filter_bootstrap_for_transport(addrs: list[str], include_tcp: bool = True, include_quic: bool = False) list[str]
- libp2p.filecoin.get_network_preset(network: Literal['mainnet', 'calibnet'] | str) FilecoinNetworkPreset
- libp2p.filecoin.get_runtime_bootstrap_addresses(network: str, resolve_dns: bool = True, include_quic: bool = False) list[str]
- libp2p.filecoin.is_valid_address(addr_str: str) bool
Return
Trueif addr_str is a syntactically valid Filecoin address.
- libp2p.filecoin.make_delegated_address(namespace: int, subaddress: bytes, *, is_testnet: bool = False) str
Create a delegated (f4/t4) Filecoin address.
namespace is the integer namespace (e.g. 10 for Ethereum Address Manager). subaddress is the raw sub-address bytes (e.g. 20-byte Ethereum address).
- libp2p.filecoin.make_id_address(actor_id: int, *, is_testnet: bool = False) str
Create an ID address (f0/t0) from a numeric actor ID.
- libp2p.filecoin.parse_address(addr_str: str) FilecoinAddress
Parse a Filecoin address string (e.g.
f1...,f410...,t410...).Raises
ValueErrorif addr_str is not a valid Filecoin address.