Is there a way to share contracts between participants nodes in Canton using HTTP JSON API Service?

We have the following topology in Canton:
We have single domain named “MYDOMAIN” which contains two participants nodes “A” and “B”.
The “A” ledger node uses port “10001” and “B” uses “11001” port.
We have created one DAML A-Certificate in “A” node and then B-Certificate in a “B” node using JSON Api service. Is there way to share/use/makevisible certificates created in “A” participants node to “B” participant node using JSON API service?

2 Likes

Hi @Grigor, welcome to the DAML community forum.

The JSON API shows active contracts. on which the requesting party, specified as part of the JWT, is a stakeholder. Parties here are different to nodes, but in Canton each note also comes with its own party, called something like participant1::somehash by default. So if you have two parties A::somehash and B::anotherhash hosted on nodes A, and B, respectively, A can make a contract visible to B by adding B::anotherhash as an observer to that contract.

1 Like

Thanks for quick response @bernhard

Here is my case:
// A and B are participants
A.domains.connect_local(MYDOMAIN)
B.domains.connect_local(MYDOMAIN)

Alice is a party in A participants node, and Bob is the party in B node. Alice created contractID with JSON API in A participant node, and BOB need to accept it, when I am trying to refer that contract ID created in A node json API gives an error:
"io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Command interpretation error in LF-DAMLe: dependency error: couldn’t find contract AbsoluteContractId

So I am thinking what is the way to share that contractID created in A participants node in B.

Hi @Grigor, as @Bernhard mentioned, the way to share a contract with another party on the ledger is via the observer field of the contract. Would it be possible for you to share the DAML code of the Certificate contract?