java.lang.Object
convex.peer.Config
Static tools and utilities for Peer configuration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Size of incoming Belief queuestatic final long
Default timeout in milliseconds for client transactionsstatic final Integer
Default number of outgoing connections for a Peerstatic final long
Delay before rebroadcasting Belief if not in consensusstatic final double
Number of milliseconds average time to drop low-staked Peersstatic final long
Timeout for syncing with an existing Peerstatic final int
Default size for incoming client query queue Note: this limits TPS for client queries, will send failures if overloadedstatic final int
Size of default server socket buffers for an outbound peer connectionstatic final int
Size of default client socket receive bufferstatic final int
Size of default client socket send bufferstatic final int
Size of default server socket receive bufferstatic final long
Number of fields in a Peer STATUS messagestatic final int
Default size for incoming client transaction queue Note: this limits TPS for client transactions, will send failures if overloadedstatic final boolean
Flag to use Netty client connectionsstatic final boolean
Flag to use Netty server implementation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyStore
checkKeyStore
(Map<Keyword, Object> config) Checks if the config specifies a valid keystorestatic <T extends AStore>
TcheckStore
(Map<Keyword, Object> config) Checks if the config specifies a valid storestatic void
ensureFlags
(Map<Keyword, Object> config) Ensures standard flags are set to defaults(if not specified).static void
ensureGenesisState
(HashMap<Keyword, Object> config) Checks that the config specifies a source for the genesis statestatic AKeyPair
ensurePeerKey
(HashMap<Keyword, Object> config) Ensures we have a hot peer :keypair set in configstatic <T extends AStore>
TensureStore
(Map<Keyword, Object> config) Establishes a store in the given configBuild a Config map
-
Field Details
-
SOCKET_SERVER_BUFFER_SIZE
public static final int SOCKET_SERVER_BUFFER_SIZESize of default server socket receive buffer- See Also:
-
SOCKET_PEER_BUFFER_SIZE
public static final int SOCKET_PEER_BUFFER_SIZESize of default server socket buffers for an outbound peer connection- See Also:
-
SOCKET_RECEIVE_BUFFER_SIZE
public static final int SOCKET_RECEIVE_BUFFER_SIZESize of default client socket receive buffer- See Also:
-
SOCKET_SEND_BUFFER_SIZE
public static final int SOCKET_SEND_BUFFER_SIZESize of default client socket send buffer- See Also:
-
USE_NETTY_CLIENT
public static final boolean USE_NETTY_CLIENTFlag to use Netty client connections- See Also:
-
USE_NETTY_SERVER
public static final boolean USE_NETTY_SERVERFlag to use Netty server implementation- See Also:
-
MAX_REBROADCAST_DELAY
public static final long MAX_REBROADCAST_DELAYDelay before rebroadcasting Belief if not in consensus- See Also:
-
PEER_SYNC_TIMEOUT
public static final long PEER_SYNC_TIMEOUTTimeout for syncing with an existing Peer- See Also:
-
PEER_CONNECTION_DROP_TIME
public static final double PEER_CONNECTION_DROP_TIMENumber of milliseconds average time to drop low-staked Peers- See Also:
-
DEFAULT_OUTGOING_CONNECTION_COUNT
Default number of outgoing connections for a Peer -
STATUS_COUNT
public static final long STATUS_COUNTNumber of fields in a Peer STATUS message- See Also:
-
TRANSACTION_QUEUE_SIZE
public static final int TRANSACTION_QUEUE_SIZEDefault 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_SIZEDefault 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_TIMEOUTDefault timeout in milliseconds for client transactions- See Also:
-
BELIEF_QUEUE_SIZE
public static final int BELIEF_QUEUE_SIZESize of incoming Belief queue- See Also:
-
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
checkStore
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
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
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
Ensures standard flags are set to defaults(if not specified).- Parameters:
config
- Configuration map for peer (may be modified)
-
ensurePeerKey
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
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
Build a Config map- Parameters:
kvs
- key/value arguments- Returns:
- Config map
-