Network Definition File (NDF)
The Network Definition File (NDF) describes the Nodes, Gateways, and other servers on the network and how to communicate with them. The NDF is a JSON file with a predefined structure that matches the internal NetworkDefinition structure.
Some objects on the NDF must have data that matches predefined formats. These are outlined below.
- Id: must be a byte array 33 bytes long that matches the id.ID object. IDs must be generated using Crypto and cannot be created any other way.
- Tls_certificate: must be a TLS certificate in PEM format. All new lines should be replaced with Unix escape sequence
\n
.
Example NDF
{
"Timestamp": "YYYY-MM-DDTHH:MM:SS.0000000+00:00",
|
Timestamp in RFC3339 format. |
"Gateways": [
⋮
{
"Id": "dGVzdDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB",
"Address": "0.0.0.0:80000",
"Tls_certificate": "-----BEGIN CERTIFICATE-----..."
},
⋮
],
|
Array of Gateway objects in the network. Each Gateway has an ID, an address string (containing the IP address and port), and a TLS certificate. |
"Nodes": [
⋮
{
"Id": "dGVzdDMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC",
"Address": "0.0.0.1:40000",
"Tls_certificate": "-----BEGIN CERTIFICATE-----..."
},
⋮
],
|
Array of Node objects in the network. Each Node has an ID, address, and TLS certificate in the same format as the Gateway object. |
"Registration": {
"Address": "0.0.0.3:18000",
"Tls_certificate": "-----BEGIN CERTIFICATE-----..."
},
|
The |
"Notification": {
"Address": "0.0.0.7",
"Tls_certificate": "-----BEGIN CERTIFICATE-----..."
},
|
The |
"Udb": {
"Id": "dGVzdDYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"
"Cert": "-----BEGIN CERTIFICATE-----...",
"Address": "0.0.0.52:18001",
"DhPubKey": "eyJWYWx1ZSI6NTEwOTQzODAxNTcyOTQ4NjUzN...",
},
|
The |
"E2e": {
"Prime": "E2EE983D031DC1DB6F1A7A67DF0E9A8E5561DB8E...",
"Generator": "2"
},
"Cmix": {
"Prime": "F6FAC7E480EE519354C0F856AEBDC43AD6014...",
"Generator": "2"
}
}
|
Both the |