Module convex.peer
Package convex.peer

Class Config

java.lang.Object
convex.peer.Config

public class Config extends Object
Static tools and utilities for Peer configuration
  • Field Details

    • SOCKET_SERVER_BUFFER_SIZE

      public static final int SOCKET_SERVER_BUFFER_SIZE
      Size of default server socket receive buffer
      See Also:
    • SOCKET_PEER_BUFFER_SIZE

      public static final int SOCKET_PEER_BUFFER_SIZE
      Size of default server socket buffers for an outbound peer connection
      See Also:
    • SOCKET_RECEIVE_BUFFER_SIZE

      public static final int SOCKET_RECEIVE_BUFFER_SIZE
      Size of default client socket receive buffer
      See Also:
    • SOCKET_SEND_BUFFER_SIZE

      public static final int SOCKET_SEND_BUFFER_SIZE
      Size of default client socket send buffer
      See Also:
    • USE_NETTY_CLIENT

      public static final boolean USE_NETTY_CLIENT
      Flag to use Netty client connections
      See Also:
    • USE_NETTY_SERVER

      public static final boolean USE_NETTY_SERVER
      Flag to use Netty server implementation
      See Also:
    • MAX_REBROADCAST_DELAY

      public static final long MAX_REBROADCAST_DELAY
      Delay before rebroadcasting Belief if not in consensus
      See Also:
    • PEER_SYNC_TIMEOUT

      public static final long PEER_SYNC_TIMEOUT
      Timeout for syncing with an existing Peer
      See Also:
    • PEER_CONNECTION_DROP_TIME

      public static final double PEER_CONNECTION_DROP_TIME
      Number of milliseconds average time to drop low-staked Peers
      See Also:
    • DEFAULT_OUTGOING_CONNECTION_COUNT

      public static final Integer DEFAULT_OUTGOING_CONNECTION_COUNT
      Default number of outgoing connections for a Peer
    • STATUS_COUNT

      public static final long STATUS_COUNT
      Number of fields in a Peer STATUS message
      See Also:
    • TRANSACTION_QUEUE_SIZE

      public static final int TRANSACTION_QUEUE_SIZE
      Default size for incoming client transaction queue Note: this limits TPS for client transactions, will send failures if overloaded
      See Also:
    • QUERY_QUEUE_SIZE

      public static final int QUERY_QUEUE_SIZE
      Default size for incoming client query queue Note: this limits TPS for client queries, will send failures if overloaded
      See Also:
    • DEFAULT_CLIENT_TIMEOUT

      public static final long DEFAULT_CLIENT_TIMEOUT
      Default timeout in milliseconds for client transactions
      See Also:
    • BELIEF_QUEUE_SIZE

      public static final int BELIEF_QUEUE_SIZE
      Size of incoming Belief queue
      See Also:
  • Constructor Details

    • Config

      public Config()
  • Method Details

    • checkStore

      public static <T extends AStore> T checkStore(Map<Keyword,Object> config) throws IOException
      Checks if the config specifies a valid store
      Parameters:
      config - Configuration map for peer
      Returns:
      Store specified in Config, or null if not specified
      Throws:
      IOException
    • checkKeyStore

      public static KeyStore checkKeyStore(Map<Keyword,Object> config) throws ConfigException
      Checks if the config specifies a valid keystore
      Parameters:
      config - Configuration map for peer
      Returns:
      Keystore specified in Config, or null if not specified
      Throws:
      ConfigException - In case keystore is configured incorrectly or not accessible
    • ensureStore

      public static <T extends AStore> T ensureStore(Map<Keyword,Object> config) throws ConfigException
      Establishes a store in the given config
      Parameters:
      config - Configuration map fpr peer (may be modified)
      Returns:
      Store specified in Config under :store
      Throws:
      ConfigException - in case of store configuration error or not accessible (IO)
    • ensureFlags

      public static void ensureFlags(Map<Keyword,Object> config)
      Ensures standard flags are set to defaults(if not specified).
      Parameters:
      config - Configuration map for peer (may be modified)
    • ensurePeerKey

      public static AKeyPair ensurePeerKey(HashMap<Keyword,Object> config) throws ConfigException
      Ensures we have a hot peer :keypair set in config
      Parameters:
      config - Configuration map for peer (may be modified)
      Throws:
      ConfigException - in case of configuration problem
    • ensureGenesisState

      public static void ensureGenesisState(HashMap<Keyword,Object> config) throws ConfigException
      Checks that the config specifies a source for the genesis state
      Parameters:
      config - Configuration map for genesis state
      Throws:
      ConfigException - in case of configuration problem
    • of

      public static HashMap<Keyword,Object> of(Object... kvs)
      Build a Config map
      Parameters:
      kvs - key/value arguments
      Returns:
      Config map