Setting up the Notary Service

In the previous section of this tutorial we set up a Percona cluster.

On top of the Percona cluster we’re deploying three notary worker nodes notary-{1,2,3} and a single regular Corda node node-1 that runs the notary health-check CorDapp.

If you’re deploying VMs in your environment you might need to adjust the host names accordingly.

Configuration Files

Below is a template for the notary configuration. Notice the parameters rewriteBatchedStatements=true&useSSL=false&failOverReadOnly=false of the JDBC URL. See Node configuration for a complete reference.

Put the IP address or host name of the nearest Percona server first in the JDBC URL. When running a Percona and a Notary replica on a single machine, list the local IP first.

In addition to the connection to the shared Percona DB holding the notary state, each notary worker needs to have access to its own local node DB. See the dataSourceProperties section in the configuration file.

notary {
  mysql {
      connectionRetries={{ number of Percona nodes }}
      dataSource {
          jdbcUrl="jdbc:mysql://{{ your cluster IPs }}/{{ DB name, e.g. corda }}?rewriteBatchedStatements=true&useSSL=false&failOverReadOnly=false"
          username={{ DB username }}
          password={{ DB password }}
  serviceLegalName="O=HA Notary, C=GB, L=London"

compatibilityZoneURL = ""
devMode = false

rpcSettings {
      address : "localhost:18003"
      adminAddress : "localhost:18004"
keyStorePassword = ""
trustStorePassword = ""
p2pAddress : "{{ fully qualified domain name, e.g. (or localhost in development) }}:{{ P2P port }}"

myLegalName : "O=Worker 1, C=GB, L=London"

// We recommend using Postgres for the node database, or an other supported
// database that you already have set up. Note that the notarised states
// are written to the MySQL database configured in `notary.mysql`.
dataSourceProperties = {
    dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
    dataSource.url = "jdbc:postgresql://[HOST]:[PORT]/postgres"
    dataSource.user = [USER]
    dataSource.password = [PASSWORD]
database = {
    transactionIsolationLevel = READ_COMMITTED
    schema = [SCHEMA]

Next Steps