Difference between revisions of "File Structure"

From xx network wiki
Jump to navigation Jump to search
m (Protected "File Structure" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(No difference)

Latest revision as of 17:04, 15 October 2021

Several file paths need to be specified for a Node or Gateway to run. Some of these paths point to existing files; others point to where a file should be saved. Many of these are modified through the Node and Gateway configuration files, which must be explicitly specified when running the software.

The Node and Gateway machines have different directory structures, as shown in their respective sections below. In each section is a typical directory tree if set up following Node and Gateway Set Up. The files that are required at startup are marked with a red asterisk () and the files that are generated are marked with a blue dagger ().

Node

Directory Tree
Legend
file required at startup
file generated
  • /opt/xxnetwork
    • bin
      • id-generation
      • xxnetwork-chain
      • xxnetwork-cmix
    • cmix-wrapper.py
    • config
      • cmix.yaml
    • cred
      • cmix-IDF.json
      • cmix-cert.crt
      • cmix-key.key
      • gateway-cert.crt
      • network-management.crt
      • scheduling-cert.crt
    • db
    • generate-certs.py
    • lib
      • libpow.fatbin
      • libpowmosm75.so
    • log
      • chain.log
      • cmix-err.log
      • cmix-wrapper.log
      • cmix.log
      • cmix-cmd
        • command-1591809548.jsonl
        • version-1591166323.jsonl
      • metrics.log
    • xxnetwork-chain.service
    • xxnetwork-cmix.service

The Node requires four files to run:

  1. The Node private key
  2. The Node TLS certificate
  3. The Gateway TLS certificate
  4. The Scheduling server TLS certificate
cmix:
  paths:
    # Path to the self-signed TLS certificate for cMix. Expects PEM format.
    # (Required)
    cert: "/opt/xxnetwork/cred/cmix-cert.crt"
    # Path to the private key associated with the self-signed TLS certificate.
    # (Required)
    key: "/opt/xxnetwork/cred/cmix-key.key"
gateway:
  paths:
    # Path to the self-signed TLS certificate for Gateway. Expects PEM format.
    # (Required)
    cert: "/opt/xxnetwork/cred/gateway-cert.crt"
scheduling:
  paths:
    # Path to the self-signed TLS certificate for the Scheduling server.
    # Expects PEM format. (Required)
    cert: "/opt/xxnetwork/cred/scheduling-cert.crt"

There are three different paths for logs: the normal Node log, the error log, and the metrics logs, as well as one for the Node IDF file.

cmix:
  paths:
    # Path where an error file will be placed in the event of a fatal error.
    # This path is used by the Wrapper Script. (Required)
    errOutput: "/opt/xxnetwork/log/cmix-err.log"
    # Path to where the identity file (IDF) is saved. The IDF stores the Node's
    # network identity. This is used by the wrapper management script. (Required)
    idf: "/opt/xxnetwork/cred/cmix-IDF.json"
    # Path where log file will be saved. (Default "log/cmix.log")
    log: "/opt/xxnetwork/log/cmix.log"
metrics:
  # Path to store metrics logs.
  log: "/opt/xxnetwork/log/metrics.log"

Gateway

Directory Tree
Legend
file required at startup
file generated
  • /opt/xxnetwork
    • bin
      • xxnetwork-chain
      • xxnetwork-gateway
    • config
      • gateway.yaml
    • cred
      • cmix-cert.crt
      • gateway-IDF.json
      • gateway-cert.crt
      • gateway-key.key
      • network-management.crt
      • scheduling-cert.crt
    • db
    • gateway-wrapper.py
    • log
      • chain.log
      • gateway-wrapper.log
      • gateway.log
      • gateway-cmd
        • command-1591387138.jsonl
        • version-1591126323.jsonl
    • xxnetwork-chain.service
    • xxnetwork-gateway.service

To run, Gateway requires four files:

  1. The Gateway private key
  2. The Gateway TLS certificate
  3. The Node TLS certificate
  4. The scheduling server TLS certificate

These appear in gateway.yaml as follows.

# Path to the private key associated with the self-signed TLS certificate.
# (Required)
keyPath: "/opt/xxnetwork/cred/gateway-key.key"

# Path to the self-signed TLS certificate for Gateway. Expects PEM format.
# (Required)
certPath: "/opt/xxnetwork/cred/gateway-cert.crt"

# Path to the self-signed TLS certificate for cMix. Expects PEM format.
# (Required)
cmixCertPath: "/opt/xxnetwork/cred/cmix-cert.crt"

# Path to the self-signed TLS certificate for the Scheduling server. Expects
# PEM format. (Required)
schedulingCertPath: "/opt/xxnetwork/cred/scheduling-cert.crt"

In addition, Gateway has an optional IDF path field and an optional log field. If no paths are supplied, defaults will be used. When the Gateway runs, it will create files at these paths.

# Path where log file will be saved. (Default "log/gateway.log")
log: "/opt/xxnetwork/log/gateway.log"

# Path to where the identity file (IDF) is saved. The IDF stores the Gateway's
# network identity. This is used by the wrapper management script. (Required)
idfPath: "/opt/xxnetwork/cred/gateway-IDF.json"