Package nxt.peer

Class Peers


  • public final class Peers
    extends java.lang.Object
    • Field Detail

      • maxNumberOfConnectedPublicPeers

        public static final int maxNumberOfConnectedPublicPeers
    • Method Detail

      • init

        public static void init()
      • shutdown

        public static void shutdown()
      • getDefaultPeerPort

        public static int getDefaultPeerPort()
      • getAllPeers

        public static java.util.Collection<? extends Peer> getAllPeers()
      • getActivePeers

        public static java.util.List<Peer> getActivePeers()
      • getPeers

        public static java.util.List<Peer> getPeers​(Peer.State state)
      • getPeers

        public static java.util.List<Peer> getPeers​(Filter<Peer> filter)
      • getPeers

        public static java.util.List<Peer> getPeers​(Filter<Peer> filter,
                                                    int limit)
      • getPeer

        public static Peer getPeer​(java.lang.String host)
      • getInboundPeers

        public static java.util.List<Peer> getInboundPeers()
      • hasTooManyInboundPeers

        public static boolean hasTooManyInboundPeers()
      • hasTooManyOutboundConnections

        public static boolean hasTooManyOutboundConnections()
      • findOrCreatePeer

        public static nxt.peer.PeerImpl findOrCreatePeer​(java.lang.String announcedAddress,
                                                         boolean create)
      • addPeer

        public static boolean addPeer​(Peer peer,
                                      java.lang.String newAnnouncedAddress)
      • addPeer

        public static boolean addPeer​(Peer peer)
      • removePeer

        public static nxt.peer.PeerImpl removePeer​(Peer peer)
      • connectPeer

        public static void connectPeer​(Peer peer)
      • sendToSomePeers

        public static void sendToSomePeers​(Block block)
      • sendToSomePeers

        public static void sendToSomePeers​(java.util.List<? extends Transaction> transactions)
      • getAnyPeer

        public static Peer getAnyPeer​(Peer.State state,
                                      boolean applyPullThreshold)
      • getPublicPeers

        public static java.util.List<Peer> getPublicPeers​(Peer.State state,
                                                          boolean applyPullThreshold)
      • getWeightedPeer

        public static Peer getWeightedPeer​(java.util.List<Peer> selectedPeers)
      • isOldVersion

        public static boolean isOldVersion​(java.lang.String version,
                                           int[] minVersion)
      • isNewVersion

        public static boolean isNewVersion​(java.lang.String version)
      • hasTooFewKnownPeers

        public static boolean hasTooFewKnownPeers()
      • hasTooManyKnownPeers

        public static boolean hasTooManyKnownPeers()
      • setCommunicationLoggingMask

        public static boolean setCommunicationLoggingMask​(java.lang.String[] events)
        Set the communication logging mask
        Parameters:
        events - Communication event list or null to reset communications logging
        Returns:
        TRUE if the communication logging mask was updated
      • getServices

        public static java.util.List<Peer.Service> getServices()
        Return local peer services
        Returns:
        List of local peer services
      • getMyPeerInfoRequest

        public static org.json.simple.JSONStreamAware getMyPeerInfoRequest()
      • getMyPeerInfoResponse

        public static org.json.simple.JSONStreamAware getMyPeerInfoResponse()