Class PeerManager

java.lang.Object
convex.cli.peer.PeerManager

public class PeerManager extends Object
Convex CLI PeerManager
  • Field Details

    • TRANSACTION_TIMEOUT_MILLIS

      protected static final long TRANSACTION_TIMEOUT_MILLIS
      See Also:
    • FRIENDLY_HEX_STRING_SIZE

      protected static final int FRIENDLY_HEX_STRING_SIZE
      See Also:
    • peerServerList

      protected List<Server> peerServerList
    • session

      protected Session session
    • sessionFilename

      protected String sessionFilename
    • keyPair

      protected AKeyPair keyPair
    • address

      protected Address address
    • store

      protected AStore store
  • Method Details

    • create

      public static PeerManager create(String sessionFilename)
    • create

      public static PeerManager create(String sessionFilename, AKeyPair keyPair, Address address, AStore store)
    • launchLocalPeers

      public void launchLocalPeers(List<AKeyPair> keyPairList, int[] peerPorts)
    • getNetworkHashList

      public List<Hash> getNetworkHashList(String remotePeerHostname)
    • aquireState

      public State aquireState(String remotePeerHostname, Hash stateHash)
    • aquireBelief

      public SignedData<Belief> aquireBelief(String remotePeerHostname, Hash beliefHash)
    • launchPeer

      public void launchPeer(int port, String remotePeerHostname, String url, String bindAddress)
    • loadSession

      protected void loadSession()
      Load in a session from a session file.
      Parameters:
      sessionFilename - Filename to load.
    • addToSession

      protected void addToSession(Server peerServer)
      Add a peer to the session list of peers.
      Parameters:
      peerServer - Add the peerServer to the list of peers for this session.
    • addAllToSession

      protected void addAllToSession()
      Add all peers started in this session to the session list.
    • removeAllFromSession

      protected void removeAllFromSession()
      Remove all peers added by this manager from the session list of peers.
    • storeSession

      protected void storeSession()
      Store the session details to file.
      Parameters:
      sessionFilename - Fileneame to save the session.
    • showPeerEvents

      public void showPeerEvents()
      Once the manager has launched 1 or more peers. The manager now needs too loop and show any events generated by the peers
    • getServerIndex

      protected int getServerIndex(AccountKey peerKey)
    • launchRestAPI

      public void launchRestAPI(int port)