The configuration file is a JSON file that contains information to configure the application to suit your business needs.
Below is an example of the configuration file.
Let's break down the required fields for this config file.
We will need:
"network" field is a string that refers to the network in which the document is created in.
As of now, we only cater to 3 networks.
- Mainnet :
- Ropsten testnet :
- Rinkeby testnet :
"wallet" field is a string that refers to your ethereum wallet. You can derive it from either one of these methods:
If you don't have a wallet, you can refer to Open Attestation's documentation to create a wallet. Note: you will need to have Open Attestation Cli installed. After running OA CLI
wallet createcommand, this will give you a wallet.json.
Alternatively, you can also generate a wallet.json from an existing account created in Metamask using the OpenAttestation Cli. Note: you will need to have Open Attestation 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:
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:
Once you have an existing wallet.json, enter the following command to serialise it into a string:
The wallet string should be displayed on your terminal and you can enter it into the
"wallet" field in the config file.
If you have an existing Metamask account but don't want to use the Open Attestation Cli, you can still get your wallet string doing this:
- Get your private key from Metamask (See option 2 if unsure)
- Open your terminal
- Navigate to a repository that has
- Type these commands line by line in the terminal:
(Note: you can watch a tutorial on this here at 7:29 onwards)
This result can now be entered into the
"wallet" field in the config file.
"forms" field is an array of form object which expect
attachments can also be added.
"name" field is a string that refers to the name of the form that will display when creating the document, as shown in the image below.
"type" field is a string that reters to the type of the document, either
"defaults" field is an object that contains the settings that you have that are constant among the different documents of the same kind of file.
Usually the document store address, token registry address, template, issuers, company logo, signatures, etc. are stored here, since they are a constant in the different documents of the same kind.
Default value of the form should also be stored here.
For example, you can store a default value for a
"title" field here, this value will be used in the form shema as the value for the
Below is an example of the
"$template" field is an object that refers to the custom renderer, please refer to creating document renderer.
"issuers" is an array of the issuer object. The required fields for each issuer are
identityProof and one of
"name" field in the
"issuers" section is a string, which refers to the name of the token registry or the name of the document store.
Please refer to token registry for transferable document or deploying document store for verifiable document, for more information.
"tokenRegistry" field is a string that is the address for the token registry, please refer to token registry for more information.
"documentStore" field is a string that is the address for the document store, please refer to deploying document store for more information.
"identityProof" field is an object that refers to the issuer identity, please refer to identity Proof for more information.
"schema" field is an object used to generate a form. It follows JSON schema format.
The structure of the schema will derived from the structure of the document you expect to build and will be inline with the custom renderer that you have built for this document.
It will probably be a subset of an already existing schema without the data that you expect to be constants across your document.
An example of the
"attachments" field contains the information about the required attachments for this document.
If there are no attachment for the particular form that you are creating, please set
"allow" field to false.
An example of the
"allow" accepts a boolean value(true or false) and it will display the attachment section based on this value.
"accept" accepts an array of string, that are file types, which will set the accepted file types for the attachments.
If you want to accept all file types, remove the entire
"accept" line from
Note: This uiSchema field is optional. Only add this section in if you want to provide information on how the selected field should be rendered.
"uiSchema" field is basically an object literal providing information on how the selected field should be rendered.
For more information regarding the uiSchema field, please visit react jsonschema form documents.
Note: This extension field is optional. Only add this section in if you want to generate a document with the specific extension.
"extension" field is a string that refers to the extension of the created document.
By default, if this field is not present, it will create the document with "tt" as the extension.
Note: This document storage field is optional. Only add this section in if you want to generate a QRcode for easy sharing.
To use a document storage endpoint, you will have to have the endpoint infrastructure already set up and configured.
You can refer to infra template's storage section for more information.
"documentStorage" field is an object which expects an
"apiKey" can also be added.
"apikey" field is optional, it accepts a string as the API key.
If your document storage endpoint does not requires an API key, you should omit this field.
"url" field accepts a string which will be the endpoint of the document storage.
Note: please ensure that this document storage endpoint has a path
"/storage/queue" that will return the queue number for storing your document in the document storage endpoint.
For the convenience of developers, we provide a testing environment endpoints that will work for Ropsten and Rinkeby testnets.
These endpoints may only be used for valid and issued documents on the respective networks, and may not be mixed.
An API key is not required for these endpoints.
Note: The testnet endpoints do not retain documents permanently and any stored documents will be removed after a period of time(30 days).