Uses of Class
com.privatechain.network.peer.Peer
Packages that use Peer
Package
Description
Peer lifecycle management — maintains the list of connected peers, runs heartbeat
checks, and prunes unresponsive connections (FR-NET-01, FR-NET-07).
Netty TCP server, client, and NDJSON message codec — the transport layer of the
P2P networking stack (FR-NET-01, ADR-001).
Chain synchronization and fork resolution — brings a node's local chain up to date
with the network on startup and after a network partition (FR-NET-04, FR-NET-05).
-
Uses of Peer in com.privatechain.network.peer
Methods in com.privatechain.network.peer that return PeerModifier and TypeMethodDescriptionPeer.Builder.build()Builds and returns aPeer.Peer.withLastSeen(Instant lastSeen) Returns a newPeerwith thelastSeenfield updated to the given instant.Peer.withPublicKey(String publicKeyHex) Returns a newPeerwith the public key filled in after handshake.Methods in com.privatechain.network.peer that return types with arguments of type PeerModifier and TypeMethodDescriptionReturns the peer with the given node ID, orOptional.empty()if not found.PeerStore.getAll()Returns a point-in-time snapshot of all known peers.PeerStore.getAll(Collection<String> nodeIds) Returns a snapshot of all peers whose node ID is in the given collection.PeerManager.getConnectedPeers()Returns a snapshot list of all currently connectedPeerinstances.Methods in com.privatechain.network.peer with parameters of type PeerModifier and TypeMethodDescriptionbooleanRegisters a peer as connected and publishes aBlockchainEvent.PeerConnectedEvent(T-066).voidInserts or replaces a peer entry keyed bygetNodeId(). -
Uses of Peer in com.privatechain.network.rpc
Methods in com.privatechain.network.rpc with parameters of type PeerModifier and TypeMethodDescriptionbooleanNodeClient.send(Peer peer, MessageCodec.NetworkMessage message) Sends a message to the given peer without waiting for a response.NodeClient.sendAndReceive(Peer peer, MessageCodec.NetworkMessage message) Sends a message to the given peer and blocks until a response is received. -
Uses of Peer in com.privatechain.network.sync
Methods in com.privatechain.network.sync with parameters of type PeerModifier and TypeMethodDescriptionBlockFetcher.fetchBlocks(Peer peer, int fromHeight, int toHeight) Fetches all blocks fromfromHeight(inclusive) totoHeight(inclusive) from the given peer, in ascending order.