public final class Peers
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Peers.Event |
Modifier and Type | Field and Description |
---|---|
static int |
maxNumberOfConnectedPublicPeers |
static int |
MIN_COMPRESS_SIZE |
Modifier and Type | Method and Description |
---|---|
static boolean |
addListener(Listener<Peer> listener,
Peers.Event eventType) |
static boolean |
addPeer(Peer peer) |
static boolean |
addPeer(Peer peer,
java.lang.String newAnnouncedAddress) |
static void |
connectPeer(Peer peer) |
static void |
disableNetworking() |
static void |
enableNetworking() |
static nxt.peer.PeerImpl |
findOrCreatePeer(java.lang.String announcedAddress,
boolean create) |
static java.util.List<Peer> |
getActivePeers() |
static java.util.Collection<? extends Peer> |
getAllPeers() |
static Peer |
getAnyPeer(Peer.State state,
boolean applyPullThreshold) |
static int |
getDefaultPeerPort() |
static java.util.List<Peer> |
getInboundPeers() |
static Peer.BlockchainState |
getMyBlockchainState() |
static org.json.simple.JSONStreamAware |
getMyPeerInfoRequest() |
static org.json.simple.JSONStreamAware |
getMyPeerInfoResponse() |
static Peer |
getPeer(java.lang.String host) |
static java.util.List<Peer> |
getPeers(Filter<Peer> filter) |
static java.util.List<Peer> |
getPeers(Filter<Peer> filter,
int limit) |
static java.util.List<Peer> |
getPeers(Peer.State state) |
static java.util.List<Peer> |
getPublicPeers(Peer.State state,
boolean applyPullThreshold) |
static java.util.List<Peer.Service> |
getServices()
Return local peer services
|
static Peer |
getWeightedPeer(java.util.List<Peer> selectedPeers) |
static boolean |
hasTooFewKnownPeers() |
static boolean |
hasTooManyInboundPeers() |
static boolean |
hasTooManyKnownPeers() |
static boolean |
hasTooManyOutboundConnections() |
static void |
init() |
static boolean |
isNetworkingEnabled() |
static boolean |
isNewVersion(java.lang.String version) |
static boolean |
isOldVersion(java.lang.String version,
int[] minVersion) |
static boolean |
removeListener(Listener<Peer> listener,
Peers.Event eventType) |
static nxt.peer.PeerImpl |
removePeer(Peer peer) |
static void |
sendToSomePeers(Block block) |
static void |
sendToSomePeers(java.util.List<? extends Transaction> transactions) |
static boolean |
setCommunicationLoggingMask(java.lang.String[] events)
Set the communication logging mask
|
static void |
shutdown() |
public static final int MIN_COMPRESS_SIZE
public static final int maxNumberOfConnectedPublicPeers
public static void init()
public static void shutdown()
public static void disableNetworking()
public static void enableNetworking()
public static boolean isNetworkingEnabled()
public static boolean addListener(Listener<Peer> listener, Peers.Event eventType)
public static boolean removeListener(Listener<Peer> listener, Peers.Event eventType)
public static int getDefaultPeerPort()
public static java.util.Collection<? extends Peer> getAllPeers()
public static java.util.List<Peer> getActivePeers()
public static java.util.List<Peer> getPeers(Peer.State state)
public static Peer getPeer(java.lang.String host)
public static java.util.List<Peer> getInboundPeers()
public static boolean hasTooManyInboundPeers()
public static boolean hasTooManyOutboundConnections()
public static nxt.peer.PeerImpl findOrCreatePeer(java.lang.String announcedAddress, boolean create)
public static boolean addPeer(Peer peer, java.lang.String newAnnouncedAddress)
public static boolean addPeer(Peer peer)
public static nxt.peer.PeerImpl removePeer(Peer peer)
public static void connectPeer(Peer peer)
public static void sendToSomePeers(Block block)
public static void sendToSomePeers(java.util.List<? extends Transaction> transactions)
public static Peer getAnyPeer(Peer.State state, boolean applyPullThreshold)
public static java.util.List<Peer> getPublicPeers(Peer.State state, boolean applyPullThreshold)
public static boolean isOldVersion(java.lang.String version, int[] minVersion)
public static boolean isNewVersion(java.lang.String version)
public static boolean hasTooFewKnownPeers()
public static boolean hasTooManyKnownPeers()
public static boolean setCommunicationLoggingMask(java.lang.String[] events)
events
- Communication event list or null to reset communications loggingpublic static java.util.List<Peer.Service> getServices()
public static org.json.simple.JSONStreamAware getMyPeerInfoRequest()
public static org.json.simple.JSONStreamAware getMyPeerInfoResponse()
public static Peer.BlockchainState getMyBlockchainState()