@Immutable
public class LedgerConfig
extends java.lang.Object
implements com.scalar.dl.ledger.config.ServerConfig, com.scalar.dl.ledger.config.ServersHmacAuthenticatable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUDITOR_CERT_HOLDER_ID
Deprecated.
This will be deleted in release 5.0.0 since Ledger-Auditor authentication will use
HMAC only.
|
static java.lang.String |
AUDITOR_CERT_VERSION
Deprecated.
This will be deleted in release 5.0.0 since Ledger-Auditor authentication will use
HMAC only.
|
static java.lang.String |
AUDITOR_ENABLED
scalar.dl.ledger.auditor.enabled A flag to enable Auditor (false by default). |
static java.lang.String |
AUTHENTICATION_HMAC_CIPHER_KEY
scalar.dl.ledger.authentication.hmac.cipher_key (Optional)A cipher key used to encrypt and decrypt the HMAC secret keys of client entities. |
static java.lang.String |
AUTHENTICATION_METHOD
scalar.dl.ledger.authentication.method (Optional)The authentication method for a client and servers. |
static java.lang.String |
DIRECT_ASSET_ACCESS_ENABLED
scalar.dl.ledger.direct_asset_access.enabled A flag to access asset table directly without going through asset_metadata (false by default). |
static java.lang.String |
EXECUTABLE_CONTRACTS
scalar.dl.ledger.executable_contracts Binary names of contracts that can be executed. |
static java.lang.String |
FUNCTION_ENABLED
scalar.dl.ledger.function.enabled A flag to enable function for mutable database (true by default). |
static java.lang.String |
NAME
scalar.dl.ledger.name (Optional)Name of ledger ("Scalar Ledger" by default). |
static java.lang.String |
NAMESPACE
scalar.dl.ledger.namespace (Optional)Namespace of ledger tables ("scalar" by default) |
static java.lang.String |
NONCE_TXID_ENABLED
scalar.dl.ledger.nonce_txid.enabled A flag to use nonce as a transaction ID (true by default). |
static java.lang.String |
PROOF_ENABLED
scalar.dl.ledger.proof.enabled A flag to enable asset proof that is used to verify assets (false by default). |
static java.lang.String |
PROOF_PRIVATE_KEY_PATH
scalar.dl.ledger.proof.private_key_path The path of a private key file in PEM format. |
static java.lang.String |
PROOF_PRIVATE_KEY_PEM
scalar.dl.ledger.proof.private_key_pem PEM-encoded private key data. |
static java.lang.String |
SERVER_ADMIN_PORT
scalar.dl.ledger.server.admin_port Server admin port (50053 by default). |
static java.lang.String |
SERVER_DECOMMISSIONING_DURATION_SECS
scalar.dl.ledger.server.decommissioning_duration_secs (Optional)Decommissioning duration (30 seconds by default) where the servers are running but returning NOT_SERVING to a gRPC health check request. |
static java.lang.String |
SERVER_GRPC_MAX_INBOUND_MESSAGE_SIZE
scalar.dl.ledger.server.grpc.max_inbound_message_size (Optional)The maximum message size allowed for a single gRPC frame. |
static java.lang.String |
SERVER_GRPC_MAX_INBOUND_METADATA_SIZE
scalar.dl.ledger.server.grpc.max_inbound_metadata_size (Optional)The maximum size of metadata allowed to be received. |
static java.lang.String |
SERVER_PORT
scalar.dl.ledger.server.port Server port (50051 by default). |
static java.lang.String |
SERVER_PRIVILEGED_PORT
scalar.dl.ledger.server.privileged_port Server privileged port (50052 by default). |
static java.lang.String |
SERVER_PROMETHEUS_EXPORTER_PORT
scalar.dl.ledger.server.prometheus_exporter_port Prometheus exporter port (8080 by default). |
static java.lang.String |
SERVER_TLS_CERT_CHAIN_PATH
scalar.dl.ledger.server.tls.cert_chain_path Certificate chain file used for TLS communication. |
static java.lang.String |
SERVER_TLS_ENABLED
scalar.dl.ledger.server.tls.enabled A flag to enable TLS between clients and servers (false by default). |
static java.lang.String |
SERVER_TLS_PRIVATE_KEY_PATH
scalar.dl.ledger.server.tls.private_key_path Private key file used for TLS communication. |
static java.lang.String |
SERVERS_AUTHENTICATION_HMAC_SECRET_KEY
scalar.dl.ledger.servers.authentication.hmac.secret_key A secret key of HMAC for the authentication of messages between (Ledger and Auditor) servers. |
static java.lang.String |
TX_STATE_MANAGEMENT_ENABLED
scalar.dl.ledger.tx_state_management.enabled A flag to manage transaction states by Ledger (false by default). |
Constructor and Description |
---|
LedgerConfig(java.io.File propertiesFile) |
LedgerConfig(java.io.InputStream stream) |
LedgerConfig(java.util.Properties properties) |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
SpotBugs detects Bug Type "CT_CONSTRUCTOR_THROW" saying that "The object under construction
remains partially initialized and may be vulnerable to Finalizer attacks."
|
int |
getAdminPort() |
java.lang.String |
getAuditorCertHolderId()
Deprecated.
|
int |
getAuditorCertVersion()
Deprecated.
|
com.scalar.dl.ledger.config.AuthenticationMethod |
getAuthenticationMethod() |
com.scalar.db.config.DatabaseConfig |
getDatabaseConfig() |
int |
getDecommissioningDurationSecs() |
java.util.Set<java.lang.String> |
getExecutableContractNames() |
com.scalar.dl.ledger.config.GrpcServerConfig |
getGrpcServerConfig() |
java.lang.String |
getHmacCipherKey() |
java.lang.String |
getName() |
java.lang.String |
getNamespace() |
int |
getPort() |
int |
getPrivilegedPort() |
java.lang.String |
getProductName() |
int |
getPrometheusExporterPort() |
java.lang.String |
getProofPrivateKey() |
java.lang.String |
getServersAuthenticationHmacSecretKey() |
java.lang.String |
getServerTlsCertChainPath() |
java.lang.String |
getServerTlsPrivateKeyPath() |
java.lang.String |
getServiceName() |
boolean |
isAuditorEnabled() |
boolean |
isDirectAssetAccessEnabled() |
boolean |
isFunctionEnabled() |
boolean |
isNonceTxidEnabled() |
boolean |
isProofEnabled() |
boolean |
isServerTlsEnabled() |
boolean |
isTxStateManagementEnabled() |
java.lang.String |
toString() |
public static final java.lang.String NAME
scalar.dl.ledger.name
(Optional)public static final java.lang.String NAMESPACE
scalar.dl.ledger.namespace
(Optional)public static final java.lang.String AUTHENTICATION_METHOD
scalar.dl.ledger.authentication.method
(Optional)public static final java.lang.String AUTHENTICATION_HMAC_CIPHER_KEY
scalar.dl.ledger.authentication.hmac.cipher_key
(Optional)scalar.dl.ledger.authentication.method
is "hmac". Please set an
unpredictable and long enough value.public static final java.lang.String SERVER_PORT
scalar.dl.ledger.server.port
public static final java.lang.String SERVER_PRIVILEGED_PORT
scalar.dl.ledger.server.privileged_port
public static final java.lang.String SERVER_ADMIN_PORT
scalar.dl.ledger.server.admin_port
public static final java.lang.String SERVER_PROMETHEUS_EXPORTER_PORT
scalar.dl.ledger.server.prometheus_exporter_port
public static final java.lang.String SERVER_DECOMMISSIONING_DURATION_SECS
scalar.dl.ledger.server.decommissioning_duration_secs
(Optional)public static final java.lang.String SERVER_TLS_ENABLED
scalar.dl.ledger.server.tls.enabled
public static final java.lang.String SERVER_TLS_CERT_CHAIN_PATH
scalar.dl.ledger.server.tls.cert_chain_path
public static final java.lang.String SERVER_TLS_PRIVATE_KEY_PATH
scalar.dl.ledger.server.tls.private_key_path
public static final java.lang.String SERVER_GRPC_MAX_INBOUND_MESSAGE_SIZE
scalar.dl.ledger.server.grpc.max_inbound_message_size
(Optional)public static final java.lang.String SERVER_GRPC_MAX_INBOUND_METADATA_SIZE
scalar.dl.ledger.server.grpc.max_inbound_metadata_size
(Optional)public static final java.lang.String PROOF_ENABLED
scalar.dl.ledger.proof.enabled
public static final java.lang.String PROOF_PRIVATE_KEY_PATH
scalar.dl.ledger.proof.private_key_path
scalar.dl.ledger.proof.private_key_pem
is used for signing proofs with digital signatures. The signatures are also used for
Auditor to authenticate the corresponding proofs from Ledger if
scalar.dl.ledger.servers.authentication.hmac.secret_key
is empty.public static final java.lang.String PROOF_PRIVATE_KEY_PEM
scalar.dl.ledger.proof.private_key_pem
scalar.dl.ledger.proof.private_key_path
is used for signing proofs with digital signatures. The signatures are also used for
Auditor to authenticate the corresponding proofs from Ledger if
scalar.dl.ledger.servers.authentication.hmac.secret_key
is empty.public static final java.lang.String FUNCTION_ENABLED
scalar.dl.ledger.function.enabled
public static final java.lang.String NONCE_TXID_ENABLED
scalar.dl.ledger.nonce_txid.enabled
public static final java.lang.String AUDITOR_ENABLED
scalar.dl.ledger.auditor.enabled
public static final java.lang.String SERVERS_AUTHENTICATION_HMAC_SECRET_KEY
scalar.dl.ledger.servers.authentication.hmac.secret_key
@Deprecated public static final java.lang.String AUDITOR_CERT_HOLDER_ID
scalar.dl.ledger.auditor.cert_holder_id
@Deprecated public static final java.lang.String AUDITOR_CERT_VERSION
scalar.dl.ledger.auditor.cert_version
public static final java.lang.String EXECUTABLE_CONTRACTS
scalar.dl.ledger.executable_contracts
[[contracts]]
contract-binary-name = "com.org1.contract.StateUpdater"
[[contracts]]
contract-binary-name = "com.org1.contract.StateReader"
public static final java.lang.String DIRECT_ASSET_ACCESS_ENABLED
scalar.dl.ledger.direct_asset_access.enabled
public static final java.lang.String TX_STATE_MANAGEMENT_ENABLED
scalar.dl.ledger.tx_state_management.enabled
public LedgerConfig(java.io.File propertiesFile) throws java.io.IOException
java.io.IOException
public LedgerConfig(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public LedgerConfig(java.util.Properties properties)
protected final void finalize()
finalize
in class java.lang.Object
public com.scalar.db.config.DatabaseConfig getDatabaseConfig()
public java.lang.String getProductName()
public java.lang.String getServiceName()
getServiceName
in interface com.scalar.dl.ledger.config.ServerConfig
public java.lang.String getName()
getName
in interface com.scalar.dl.ledger.config.ServerConfig
public java.lang.String getNamespace()
public com.scalar.dl.ledger.config.AuthenticationMethod getAuthenticationMethod()
@Nullable public java.lang.String getHmacCipherKey()
public int getPort()
getPort
in interface com.scalar.dl.ledger.config.ServerConfig
public int getPrivilegedPort()
getPrivilegedPort
in interface com.scalar.dl.ledger.config.ServerConfig
public int getAdminPort()
getAdminPort
in interface com.scalar.dl.ledger.config.ServerConfig
public int getPrometheusExporterPort()
getPrometheusExporterPort
in interface com.scalar.dl.ledger.config.ServerConfig
public int getDecommissioningDurationSecs()
getDecommissioningDurationSecs
in interface com.scalar.dl.ledger.config.ServerConfig
public boolean isServerTlsEnabled()
isServerTlsEnabled
in interface com.scalar.dl.ledger.config.ServerConfig
public java.lang.String getServerTlsCertChainPath()
getServerTlsCertChainPath
in interface com.scalar.dl.ledger.config.ServerConfig
public java.lang.String getServerTlsPrivateKeyPath()
getServerTlsPrivateKeyPath
in interface com.scalar.dl.ledger.config.ServerConfig
public com.scalar.dl.ledger.config.GrpcServerConfig getGrpcServerConfig()
getGrpcServerConfig
in interface com.scalar.dl.ledger.config.ServerConfig
public boolean isProofEnabled()
public java.lang.String getProofPrivateKey()
public boolean isFunctionEnabled()
public boolean isNonceTxidEnabled()
public boolean isAuditorEnabled()
@Nullable public java.lang.String getServersAuthenticationHmacSecretKey()
getServersAuthenticationHmacSecretKey
in interface com.scalar.dl.ledger.config.ServersHmacAuthenticatable
@Deprecated @Nullable public java.lang.String getAuditorCertHolderId()
@Deprecated public int getAuditorCertVersion()
public java.util.Set<java.lang.String> getExecutableContractNames()
public boolean isDirectAssetAccessEnabled()
public boolean isTxStateManagementEnabled()
public java.lang.String toString()
toString
in class java.lang.Object