@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.enabledA 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.enabledA flag to access asset table directly without going through asset_metadata (false by default). |
static java.lang.String |
EXECUTABLE_CONTRACTS
scalar.dl.ledger.executable_contractsBinary names of contracts that can be executed. |
static java.lang.String |
FUNCTION_ENABLED
scalar.dl.ledger.function.enabledA 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.enabledA flag to use nonce as a transaction ID (true by default). |
static java.lang.String |
PROOF_ENABLED
scalar.dl.ledger.proof.enabledA 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_pathThe path of a private key file in PEM format. |
static java.lang.String |
PROOF_PRIVATE_KEY_PEM
scalar.dl.ledger.proof.private_key_pemPEM-encoded private key data. |
static java.lang.String |
SERVER_ADMIN_PORT
scalar.dl.ledger.server.admin_portServer 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.portServer port (50051 by default). |
static java.lang.String |
SERVER_PRIVILEGED_PORT
scalar.dl.ledger.server.privileged_portServer privileged port (50052 by default). |
static java.lang.String |
SERVER_PROMETHEUS_EXPORTER_PORT
scalar.dl.ledger.server.prometheus_exporter_portPrometheus exporter port (8080 by default). |
static java.lang.String |
SERVER_TLS_CERT_CHAIN_PATH
scalar.dl.ledger.server.tls.cert_chain_pathCertificate chain file used for TLS communication. |
static java.lang.String |
SERVER_TLS_ENABLED
scalar.dl.ledger.server.tls.enabledA 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_pathPrivate key file used for TLS communication. |
static java.lang.String |
SERVERS_AUTHENTICATION_HMAC_SECRET_KEY
scalar.dl.ledger.servers.authentication.hmac.secret_keyA 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.enabledA 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.portpublic static final java.lang.String SERVER_PRIVILEGED_PORT
scalar.dl.ledger.server.privileged_portpublic static final java.lang.String SERVER_ADMIN_PORT
scalar.dl.ledger.server.admin_portpublic static final java.lang.String SERVER_PROMETHEUS_EXPORTER_PORT
scalar.dl.ledger.server.prometheus_exporter_portpublic 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.enabledpublic static final java.lang.String SERVER_TLS_CERT_CHAIN_PATH
scalar.dl.ledger.server.tls.cert_chain_pathpublic static final java.lang.String SERVER_TLS_PRIVATE_KEY_PATH
scalar.dl.ledger.server.tls.private_key_pathpublic 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.enabledpublic 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_pemscalar.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.enabledpublic static final java.lang.String NONCE_TXID_ENABLED
scalar.dl.ledger.nonce_txid.enabledpublic static final java.lang.String AUDITOR_ENABLED
scalar.dl.ledger.auditor.enabledpublic 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_versionpublic 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.enabledpublic static final java.lang.String TX_STATE_MANAGEMENT_ENABLED
scalar.dl.ledger.tx_state_management.enabledpublic LedgerConfig(java.io.File propertiesFile)
throws java.io.IOException
java.io.IOExceptionpublic LedgerConfig(java.io.InputStream stream)
throws java.io.IOException
java.io.IOExceptionpublic LedgerConfig(java.util.Properties properties)
protected final void finalize()
finalize in class java.lang.Objectpublic com.scalar.db.config.DatabaseConfig getDatabaseConfig()
public java.lang.String getProductName()
public java.lang.String getServiceName()
getServiceName in interface com.scalar.dl.ledger.config.ServerConfigpublic java.lang.String getName()
getName in interface com.scalar.dl.ledger.config.ServerConfigpublic 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.ServerConfigpublic int getPrivilegedPort()
getPrivilegedPort in interface com.scalar.dl.ledger.config.ServerConfigpublic int getAdminPort()
getAdminPort in interface com.scalar.dl.ledger.config.ServerConfigpublic int getPrometheusExporterPort()
getPrometheusExporterPort in interface com.scalar.dl.ledger.config.ServerConfigpublic int getDecommissioningDurationSecs()
getDecommissioningDurationSecs in interface com.scalar.dl.ledger.config.ServerConfigpublic boolean isServerTlsEnabled()
isServerTlsEnabled in interface com.scalar.dl.ledger.config.ServerConfigpublic java.lang.String getServerTlsCertChainPath()
getServerTlsCertChainPath in interface com.scalar.dl.ledger.config.ServerConfigpublic java.lang.String getServerTlsPrivateKeyPath()
getServerTlsPrivateKeyPath in interface com.scalar.dl.ledger.config.ServerConfigpublic com.scalar.dl.ledger.config.GrpcServerConfig getGrpcServerConfig()
getGrpcServerConfig in interface com.scalar.dl.ledger.config.ServerConfigpublic 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