JSON-API error: mismatch with Ledger API

Hello All,

I am trying to start a project and used the simple-topography example and uploaded a DAR file based on the contract we designed as per our requirements. I successfully created an instrument in the ledger, which is now stored.

Currently, I’m trying to fetch this data using Postman via the JSON-API. I configured the json-api.conf file to bind the Ledger API port 5011 to 7575 and started the service. However, when I trigger the request from Postman(All this while I am making sure canton is up and running) I encounter the following error:

{
    "errors": [
        "Endpoints.ParticipantServerError: NOT_FOUND: LEDGER_ID_MISMATCH(11,a1b5ca2d): Ledger ID 'MyLedger' not found. Actual Ledger ID is 'participant1'."
    ],
    "status": 500
}

All files are as follows
Json-api.conf

{
  server {
    address = "localhost"
    port = 7575
  }
  ledger-api {
    address = "localhost"
    port = 5011
  }
  
}

simple-topology.conf

canton {
  participants {
    participant1 {
      storage.type = memory
      admin-api.port = 5012
      ledger-api.port = 5011
    }
    participant2 {
      storage.type = memory
      admin-api.port = 5022
      ledger-api.port = 5021
    }
  }
  domains {
    mydomain {
      init.domain-parameters.protocol-version = 5
      storage.type = memory
      public-api.port = 5018
      admin-api.port = 5019
    }
  }
  // enable ledger_api commands for our getting started guide
  features.enable-testing-commands = yes
}

Kindly suggest me how to use JSON-api for fetching the contracts
Thanks !

@Sindhusha, which Canton version are you using? (The JSON API varies across versions.)

Are you passing a JWT to the JSON API? What is that token’s payload? For example, what is in the aud: field of your token? Is it “MyLedger”? Try changing that to “participant1”.

1 Like