Configuration File
The configuration file is a JSON file that contains information to configure the application to suit your business needs.
Config file structure
A reference of a configuration file can be found here.
Below are examples of a configuration file
Encrypted JSON Wallet
{
"network": "sepolia",
"wallet": {
"type":"ENCRYPTED_JSON",
"encryptedJson": "{\"address\":\"6a36c563a5350d7be66c801f901a67...\", ...}}",
},
"forms": [{...}],
"documentStorage": {
"apiKey": "<Document storage API Key>",
"url": "<Document storage URL>"
}
}
Aws Kms Wallet
{
"network": "sepolia",
"wallet": {
"type":"AWS_KMS",
"accessKeyId": "<IAM Access Key ID>",
"region": "<Key Region>",
"kmsKeyId": "<KMS Key Identifier>",
},
"forms": [{...}],
"documentStorage": {
"apiKey": "<Document storage API Key>",
"url": "<Document storage URL>"
}
}
Let's break down the properties that make up this config file.
Required properties:
"network"
- Network property"wallet"
- Wallet property"forms"
- Forms property
Optional property:
"documentStorage"
- Document Storage property
Network property
The value of "network"
property is a string that refers to the network in which the document is created in.
Currently, we only support to 6 networks.
- Ethereum Mainnet :
"homestead"
- Sepolia Testnet :
"sepolia"
- Polygon Mainnet:
"matic"
- Amoy Testnet:
"amoy"
- XDC Mainnet:
"xdc"
- XDC Apothem Testnet:
"xdcapothem"
Wallet property
The "wallet"
property is a string that refers to your ethereum wallet. We support two types of wallet options.
- ENCRYPTED_JSON
- AWS_KMS
!!! WARNING !!! This wallet value is highly sensitive. Do not share with anyone unless you know what you are doing.
ENCRYPTED_JSON Wallet
The wallet property can be derive from either one of these methods:
-
If you don't have a wallet, you can refer to TradeTrust's documentation to create a wallet. Note: you will need to have TradeTrust Cli installed. After running TT CLI
wallet create
command, this will give you a wallet.json. -
Alternatively, you can also generate a wallet.json from an existing account created in Metamask using the TradeTrust Cli. Note: you will need to have TradeTrust Cli installed. You will have to input your wallet's private key which can be found when you go to your account in Metamask, click on the menu icon, go to "Account Details" and click "Export Private Key". You can refer to the Metamask Support Page for a guided walkthrough. You will be prompted to input your Metamask password. Once you have your private key, you can key in the following command to generate a wallet.json:
tradetrust wallet encrypt -k 0x<privatekey> --of ./wallet.json
You will then be prompted to set your wallet password. Once entered, you will see a success message with the path to your wallet.json:
ℹ info Encrypting a wallet
? Wallet password [hidden]
… awaiting Encrypting Wallet [====================] [100/100%]
ℹ info Wallet with public address 0xcE16E13045363a4aFb1f4dc6b584256cCb0DDd15 successfully created.
ℹ info Find more details at https://etherscan.io/address/0xcE16E13045363a4aFb1f4dc6b584256cCb0DDd15