Skip to main content
European CommissionEBSI European Blockchain

2. Deploy a new proxy

Role: Entity

This step is performed by the Entity that wants to manage this use case.

This guide explains how to deploy a new proxy contract from a registered template.

Prerequisites

The Entity needs the TCR:deployProxy attribute in the Trusted Policies Registry. This can be checked with:

tpr /subjects/<address>/policies/TCR:deployProxy

Steps

1. Open the CLI tool

Start the CLI and load your keys:

env test  # or pilot/production
using user ES256K did1 <private-key> <did>

2. Encode the initial data

Encode the initial data for the contract. For instance, if the init function is initialize(address):

initData: compute encodeContractData ["address"] ["0x69e48d89bf5e09588E858D757323b4abBBB3f814"]

3. Deploy the proxy

Call the ledger contract to deploy a new proxy:

ledger tcr deployProxy <contractName> <version> initData user.did

where:

  • contractName: Name of the contract (as registered in the template)
  • version: Version of the contract (as registered in the template)

4. Verify deployment

Check the Trusted Contracts Registry to get the address of the latest contract deployed:

tcr get /contracts
tip

You have successfully deployed a proxy contract. Note the contract address for future interactions.