Skip to content
CCPEDIAby Unity Nodes
App Development

Why does Canton reject my postgres configuration?

3 posts347 viewsLast activity Nov 2022

  1. lashenhurstOP

    Hi all,

    I’m trying to set up a small test Canton network with a simple configuration, but my postgres configuration is getting rejected because it is expecting a string for the storage, not an object. Please can you tell me where I’m going wrong?

    _shared {
      storage {
        type = postgres
        config {
          dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
          properties = {
            serverName = "localhost"
            portNumber = "5432"
            user = "admin"
            password = "password"
          }
        }
      }
    }
    canton {
      participants {
        agent {
          storage.type = ${_shared.storage}
          storage.config.properties.databaseName = "contractStore"
          admin-api.port = 5012
          ledger-api.address = 0.0.0.0
          ledger-api.port = 5011
        }
      }
      domains {
        mydomain {
          storage.type = memory
          public-api.port = 5018
          admin-api.port = 5019
        }
      }
      features.enable-testing-commands = yes
    }
    

    With error:

    ERROR c.d.c.CantonCommunityApp$ - GENERIC_CONFIG_ERROR(8,0): Cannot convert configuration to a config of class com.digitalasset.canton.config.CantonCommunityConfig. Failures are:
      at 'canton.participants.agent.storage.type':
        - (azure.conf: 2) Expected type STRING. Found OBJECT instead.
     err-context:{location=CantonConfig.scala:1355} 
    
  2. cocreature

    You’re setting storage.type to the object that should be the whole storage not just the storage type. Try something like

    storage = ${_shared.storage}
    
  3. lashenhurst

    Wow… Monday mornings are really not my best time! Thanks!