Deploying Document Store Smart Contract (CLI)
For the current step, you can either opt to use the CLI or Code.
The document store is a smart contract on the blockchain network that records the issuance and revocation status of TrustVC documents. In this guide, we will deploy a document store smart contract on the Ethereum blockchain, sepolia network, which is a test network that does not require actual ethers for transactions.
Prerequisite
- TrustVC CLI installed
- Private key to an Ethereum wallet with sufficient ethers
Deploying via TrustVC CLI
The TrustVC CLI uses an interactive prompt system that guides you through the deployment process.
trustvc deploy document-store
The CLI will interactively prompt you for:
- Store name: Enter the name of the document store (e.g., "My first document store")
- Network selection: Choose from available networks (e.g., sepolia, polygon-amoy)
- Owner address (optional): Enter the owner address or press Enter to use the deployer address
- Wallet selection: Choose between encrypted wallet, private key file, or environment variable
Example session:
trustvc deploy document-store
? Enter the name of the document store: My first document store
? Select a network: sepolia
? Enter the owner address (optional, press Enter to use deployer address):
? Select wallet type: Encrypted Wallet JSON
? Enter the path to your encrypted wallet JSON file: ./wallet.json
? Enter your wallet password: [hidden]
Once your document store smart contract has been successfully deployed, you will see the success message with the document store address:
ℹ info Deploying document store My first document store
✔ success Document store My first document store deployed at 0xBBb55Bd1D709955241CAaCb327A765e2b6D69c8b
ℹ info Find more details at https://sepolia.etherscan.io/address/0xBBb55Bd1D709955241CAaCb327A765e2b6D69c8b
In the example above, the document store address is 0xBBb55Bd1D709955241CAaCb327A765e2b6D69c8b, please do NOT use the Transaction ID.
Save the document store address somewhere. You will need this address later to complete the tutorial.
Congratulations! You have successfully deployed a document store.
Next we take a look at configuring the DNS.