You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started.md
+68-8Lines changed: 68 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,27 +144,87 @@ Then open your copy of `trustchain_config.toml` for editing:
144
144
```console
145
145
nano $TRUSTCHAIN_CONFIG
146
146
```
147
-
and edit the following configuration parameters:
147
+
This file is organised into different sections, separated by headings inside square brackets. At this point, we only need to consider the `[ion]` and `[cli]` sections.
148
148
149
-
- In the `[ion]` section, add the `bitcoin_rpc_username` and `bitcoin_rpc_password` that were chosen when you configured the [Bitcoin CLI](ion.md#bitcoin-cli).
150
-
- If you intend to act as an issuer of digital credentials, and you already have you own DID for this purpose, add it in the `[http]` section to the `issuer_did` parameter value. Otherwise, the `[http]` section can be ignored.
151
-
-If you know the root event time for your DID network, add it in the `[cli]` section to the `root_event_time` parameter value. This must be an integer in Unix time format, e.g.:
152
-
```{ .text .no-copy }
153
-
root_event_time = 1697213008
149
+
Edit the following configuration parameters:
150
+
151
+
-In the `[ion]` section, set the `mongo_database_ion_core` parameter to either `"ion-mainnet-core"` or `"ion-testnet-core"`, depending on the Bitcoin network in use (see the example below). This parameter must match the `databaseName` parameter in the ION Core config file which can be viewed by running the following command:
152
+
```console
153
+
cat $ION_CORE_CONFIG_FILE_PATH
154
154
```
155
+
- Also in the `[ion]` section, set the address of your Bitcoin node in the `bitcoin_connection_string` parameter. If Bitcoin is running locally, set this to localhost and choose the correct port number for the particular Bitcoin network in use (see the example below).
156
+
- Also in the `[ion]` section, set the `bitcoin_rpc_username` and `bitcoin_rpc_password` parameters that were chosen when you configured the [Bitcoin CLI](ion.md#bitcoin-cli).
157
+
- If you know the root event time for your DID network, add it in the `[cli]` section to the `root_event_time` parameter value. This must be an integer in Unix time format.
158
+
159
+
After completing the above steps, the `trustchain_config.toml` file should look similar to the following example (choose the correct tab for your [Bitcoin network configuration](ion.md#bitcoin-mainnet-vs-testnet)):
The "root event time" refers to the exact time at which the root DID was published. It is imperative that this configuration parameter is entered correctly, because it identifies the root public key certificate.
159
215
216
+
The value given in the above example is for illustration only.
217
+
160
218
If you are not sure about the correct root event time for your network, or you are intending to create your own root DID, leave this parameter unset for now.
161
219
162
-
In future versions of Trustchain, this Unix time parameter will be replaced by a calendar date (the "root event date") plus a short confirmation code.
220
+
In future versions of Trustchain, this Unix time parameter will be replaced by a calendar date, the "root event date", plus a short confirmation code (which is the format used in the Trustchain Mobile app).
163
221
164
222
## Using Trustchain
165
223
166
-
Trustchain is controlled via its command line interface (CLI). Supported operations include DID resolution, issuance, attestation and verification. It can also be used to issue and verify digital credentials.
224
+
Trustchain is controlled via its command line interface (CLI). Supported operations include DID resolution, creation, attestation and verification. It can also be used to sign and verify digital credentials.
167
225
168
226
Instructions on how to use the Trustchain CLI are provided on the [Usage page](usage.md).
169
227
228
+
If you also want to be able to issue verifiable credentials to users of the Trustchain Mobile credential wallet app, check out [this page](http-server.md) for instructions on how to configure and run the built-in Trustchain HTTP server.
Copy file name to clipboardExpand all lines: docs/http-server.md
+32-24Lines changed: 32 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,33 +26,53 @@ Under the section headed `[http]`, add or edit the following configuration param
26
26
27
27
- Set the `root_event_time` parameter to the integer root DID timestamp for your network (in Unix Time).
28
28
- Set the `host_display` parameter to the fully qualified domain name of your Trustchain HTTP server.
29
+
- Set the `host` parameter to the host address for the server. If you want the server to be accessible only on a local network, set this to `"127.0.0.1"` (localhost). If you want the server to be accessible from the Internet, set it to `"0.0.0.0"`. In this case, ensure both your router and server are protected by a properly configured firewall.
29
30
- Set the `port` parameter to the port number on which your server will listen for HTTP requests.
30
31
- Set the `https` parameter to either `true` or `false`, depending on whether your server will use TLS for encrypted communications.
31
32
- If `https` is set to `true`, set the `https_path` parameter to the directory containing the certificate and key necessary for accepting HTTPS connections. See the section on [HTTPS configuration](#https-configuration) for more details.
32
33
- Set the `ion_host` parameter to the host name of your ION instance. If ION is running on the local machine, set this to the loopback address `"127.0.0.1"`.
33
34
- Set the `ion_port` parameter to the port number of your ION instance. By default, ION listens on port `3000`.
34
-
- If you intend to act as an issuer of digital credentials and you already have you own DID for this purpose, set it as the `server_did` parameter.
35
+
- If you intend to use your server for credential verification and/or for dDID attestation (via the Trustchain challenge-response protocol), and you already have your own DID for this purpose, set it as the `server_did` parameter. If the server is only intended to respond to requests from the Trustchain Mobile app, e.g. for issuing verifiable credentials, this parameter is not required and can be omitted.
35
36
36
37
!!! example "Example HTTP server configuration"
37
38
38
39
After completing the above steps, the `[http]` section of `trustchain_config.toml` should look similar to the following example:
To make your Trustchain HTTP server reachable from the public Internet you will need to configure your local network to allow connections to the port given in the `trustchain_config.toml` file, and to route them to your Trustchain node.
57
+
58
+
If your Trustchain node is running on a virtual machine (VM) in the cloud, navigate to your cloud provider's web portal and open the network settings page for the VM. Then create an "inbound port rule" to allow incoming traffic to the relevant port.
59
+
60
+
If your node is running on a computer in your local network, the network configuration steps are as follows:
61
+
62
+
- On your router, configure the firewall to allow connections to the port configured for the Trustchain server, and configure port forwarding (for the same port) to the IP address of your Trustchain node on the local network. To enable this, you may want to assign a static local IP address to your Trustchain node.
63
+
- If there is a firewall running on your Trustchain node, ensure it is configured to allow inbound connections to the relevant port.
64
+
51
65
### HTTPS configuration
52
66
53
67
It is strongly advisable to configure your Trustchain HTTP server to use TLS (Transport Layer Security) for encrypted communictions via HTTPS. This is done by setting the `https` config parameter to `true` and the `port` parameter to `443`, which is the default HTTPS port number.
54
68
55
-
In this case, you will need a TLS certificate and associated cryptographic keys.
69
+
!!! info "HTTPS is required to support Trustchain Mobile"
70
+
71
+
The Trustchain HTTP server is designed to handle requests from the Trustchain Mobile app, for operations such as the issuance and verification of [Verifiable Credentials](https://www.w3.org/TR/vc-data-model-2.0/).
72
+
73
+
If you intend to use the HTTP server for this purpose, it is essential that you configure it with HTTPS support. The Trustchain Mobile app will refuse to connect to a server that does not have a valid TLS certificate.
74
+
75
+
To support HTTPS, you will need a TLS certificate and associated cryptographic keys.
56
76
57
77
If you do not already have a TLS certificate, you can obtain one by using a free and open source service called [Certbot](https://certbot.eff.org/). Certbot is a software tool for automatically generating [Let's Encrypt](https://letsencrypt.org/) certificates for web servers to enable HTTPS, which is precisely what is needed here.
58
78
@@ -72,22 +92,22 @@ Step 7 of the Certbot instructions requires you to install your new TLS certific
- copy the certificate file `fullchain.pem` and the key file `privkey.pem` from the locations given in the output from Step 6 (above), to the new directory, e.g.:
- change the ownership of those files so they are owned by the user and group that will run the Trustchain server (replace `<USER>` and `<GROUP>` in the following commands):
To make your Trustchain HTTP server reachable from the public Internet you will need to configure your local network to allow connections to the port given in the `trustchain_config.toml` file, and to route them to your Trustchain node.
103
-
104
-
If your Trustchain node is running on a virtual machine (VM) in the cloud, navigate to your cloud provider's web portal and open the network settings page for the VM. Then create an "inbound port rule" to allow incoming traffic to the relevant port.
105
-
106
-
If your node is running on a computer in your local network, the network configuration steps are as follows:
107
-
108
-
- On your router, configure the firewall to allow connections to the port configured for the Trustchain server,
109
-
- On your router, configure port forwarding (for the same port) to the IP address of your Trustchain node on the local network. To enable this, you may want to assign a static local IP address to your Trustchain node.
110
-
- If there is a firewall running on your Trustchain node, ensure it is configured to allow connections to the relevant port.
111
-
112
120
## Running the HTTP server
113
121
114
122
Open a new Terminal window and invoke the Trustchain HTTP server with the following command:
0 commit comments