You have already applied to join the blockchain.
The notary blockchain will be offline on October 17, 2019. For a better experience, please use the contract blockchain, which has all the functions of the notary blockchain and better performance.
The client needs to configure basic information. Detailed configuration can be found in the sdk.properties file. The simplest configuration includes the following.
Determine the primary node for the client to connect to, and the alternate node addresses to use when the primary node is inavailable.
In addition, the client connects to the node using TLS mutual authentication, which requires the x509 certificate to be configured. Replace ssl_key_password with the password you set when you created the private key.
# The address of the primary node to which the client is connected. One and only one primary node can be configured
biz.sdk.primary=### IP configuration does not need to be modified ###
# The API address of the backup node. You can configure n backup nodes, where n=3f : f=1,2.
# When the primary node cannot be connected, the system switches to "connect to the backup node". When the primary node recovers, it automatically switches back to "connect to the primary node"
Jolla. SDK. Backups =### IP configuration does not need to be modified ###
# The client connects to the node using TLS mutual authentication, which requires the x509 certificate to be configured
# The absolute path of the SSL private key files in pkcs8 format
# The absolute path of the SSL certificate files in x509 format
# The SSL private key password set when the private key is created
# The absolute path of the TrustStore file
# The trust store password, which defaults to mychain, and does not need to be changed
The configuration above contains three files, where ssl_key is the private key certificate, ssl_cert is the signature certificate, and trust_store can be obtained from the download link of the BaaS platform. Whether these files are filled in or not depends on how you initialize the client. You can save the files locally and pass them to the client as configured above, or initialize the client by ClassLoader loading or other input streams, such as the network IO.
This document will provide you with a utility class DefaultClientPropertyConfig, with which two methods can be used to initialize the client.
The first method is to read the sdk.properties configuration file to initialize the client. DefaultClientPropertyConfig first finds the corresponding file from the path configured by biz.sdk.ssl_key, biz.sdk.ssl_cert and biz.sdk.trust_store. If the file is found, the client is initialized with the file content. If not, DefaultClientPropertyConfig finds the files named “sslkey.pem”, “sslcert.pem” and “trust.keystore” in the class path and loads the resources through the ClassLoader to initialize the client.
// Load the client configuration file
Properties p = new Properties();
ClientConfig config = new DefaultClientPropertyConfig(p);
// Initialize the client using the specified client configuration
Client client = new Client(config);
Next, you can use the client to notarize data writes