Skip to main content
European CommissionEBSI European Blockchain

Trusted Contracts Registry API

OpenAPI documentation

tcr get <url>

Command to send a GET request to the Trusted Contracts Registry API. All endpoints are open to the public.

Parameters:

  • url: Path to get.

Examples:

tcr get /contracts
tcr get /templates

ledger tcr deployProxy <contractName> <version> <initData> <deployerDID>

Function to deploy a new proxy from a template registered in the Trusted Contracts Registry. The user must have the TCR:deployProxy policy in the Trusted Policies Registry and control the DID document identified by deployerDID.

Parameters:

  • contractName: Name of the contract (as registered in the template)
  • version: Version of the contract (as registered in the template)
  • initData: Data to be passed to the init function. It should be encoded as hex string. Use an ABI encoder to encode it
  • deployerDID: DID of the deployer

Examples:

ledger tcr deployProxy HelloWorldContract 1.0.0 0x1234567890abcdef did:ebsi:zkqR9GCLrLYbkubAjuqQZAz
Tutorial

For detailed instructions on how to deploy a proxy contract, see the Deploy a new proxy tutorial.

proxyledger ptr addTemplate <name> <version> <beaconAddress> <repoURI> <auditURI> <contractHash> <initSelector> <storageLayoutHash> <isActiveInput>

Command to register a new template in the Proxy Template Registry, a contract linked to the Trusted Contracts Registry to save the template information. This command requires direct blockchain access and the TCR:manageTemplates policy in the Trusted Policies Registry.

Parameters:

  • name: Name of the contract
  • version: Version of the contract
  • beaconAddress: Address of the upgradeable beacon
  • repoURI: URI to the source code repository
  • auditURI: URI to the audit report
  • contractHash: Keccak256 hash of the contract bytecode
  • initSelector: Selector of the initializer function. It accepts the function name or the function signature.
  • storageLayoutHash: Keccak256 hash of the storage layout
  • isActiveInput: Whether the template is active (true/false)

Examples:

proxyledger ptr addTemplate HelloWorldContract 1.0.0 0x370C64beAf6d04695dB1149Adf0643970C6A19fB https://github.com/example/repo https://audit.example.com/report 0x98cbf319577d6e8eef53ea076838119490aa47f224b36cf784aa6988d5d522d5 0x12345678 0x471f654d10f2a10c5cc74e94c6b1eb15992ba4a8c0f3889a5218a7293a0831f1 true
Tutorial

For detailed instructions on how to register a new template, see the Register a new template tutorial.

proxyledger ptr deprecateTemplate <templateId>

Command to deprecate a template in the Proxy Template Registry. This prevents new proxy deployments from the deprecated template while keeping existing proxies functional. This command requires direct blockchain access and the TCR:manageTemplates policy in the Trusted Policies Registry.

Parameters:

  • templateId: ID of the template to deprecate

Examples:

proxyledger ptr deprecateTemplate 0x53264362d9825fda8f8697c0411e544201484db74001172a369fc4de68f6fdbf

proxyledger ptr updateTemplateMetadata <templateId> <repoURI> <auditURI>

Command to update the metadata (repository URI and audit URI) of an existing template in the Proxy Template Registry. This command requires direct blockchain access and the TCR:manageTemplates policy in the Trusted Policies Registry.

Parameters:

  • templateId: ID of the template to update
  • repoURI: New URI to the source code repository
  • auditURI: New URI to the audit report

Examples:

proxyledger ptr updateTemplateMetadata 0x53264362d9825fda8f8697c0411e544201484db74001172a369fc4de68f6fdbf https://github.com/example/updated-repo https://audit.example.com/updated-report