|
| 1 | +--- |
| 2 | +title: Node Configuration |
| 3 | +sidebar: |
| 4 | + order: 25 |
| 5 | +--- |
| 6 | + |
| 7 | +Magi nodes may be configured through a set of JSON files located in the `config/` directory of the node's data directory. These files are created automatically when running the node with the `-init` flag. |
| 8 | + |
| 9 | +## Database |
| 10 | + |
| 11 | +Configures the MongoDB connection used by the node. |
| 12 | + |
| 13 | +| Field | Type | Default | Description | |
| 14 | +|-------|------|---------|-------------| |
| 15 | +| `DbURI` | string | `mongodb://localhost:27017` | MongoDB connection URI | |
| 16 | +| `DbName` | string | `go-vsc` | Name of the database | |
| 17 | + |
| 18 | +```json title="dbConfig.json" |
| 19 | +{ |
| 20 | + "DbURI": "mongodb://localhost:27017", |
| 21 | + "DbName": "go-vsc" |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +## GraphQL |
| 26 | + |
| 27 | +Configures the GraphQL API server. |
| 28 | + |
| 29 | +| Field | Type | Default | Description | |
| 30 | +|-------|------|---------|-------------| |
| 31 | +| `HostAddr` | string | `0.0.0.0:8080` | Host address and port to bind the GraphQL server to | |
| 32 | +| `MaxComplexity` | int | `10000` | Maximum query complexity allowed per request. Requests exceeding this limit are rejected | |
| 33 | + |
| 34 | +```json title="gqlConfig.json" |
| 35 | +{ |
| 36 | + "HostAddr": "0.0.0.0:8080", |
| 37 | + "MaxComplexity": 10000 |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +The GraphQL sandbox is available at `http://<HostAddr>/sandbox` when the node is running. |
| 42 | + |
| 43 | +## Hive |
| 44 | + |
| 45 | +Configures the Hive API endpoints used for block streaming and transaction broadcasting. |
| 46 | + |
| 47 | +| Field | Type | Default | Description | |
| 48 | +|-------|------|---------|-------------| |
| 49 | +| `HiveURIs` | string[] | See below | List of Hive API node URLs. The node will use these endpoints for reading Hive blockchain data | |
| 50 | + |
| 51 | +```json title="hiveConfig.json" |
| 52 | +{ |
| 53 | + "HiveURIs": [ |
| 54 | + "https://api.hive.blog", |
| 55 | + "https://techcoderx.com", |
| 56 | + "https://hive-api.3speak.tv", |
| 57 | + "https://api.openhive.network", |
| 58 | + "https://api.deathwing.me" |
| 59 | + ] |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +## Identity |
| 64 | + |
| 65 | +Configures the node's cryptographic identity and Hive account credentials. |
| 66 | + |
| 67 | +| Field | Type | Default | Description | |
| 68 | +|-------|------|---------|-------------| |
| 69 | +| `HiveUsername` | string | *(empty)* | Hive account username for the witness | |
| 70 | +| `HiveActiveKey` | string | *(empty)* | Hive account active key in WIF format, used for signing transactions on the Hive blockchain | |
| 71 | +| `BlsPrivKeySeed` | string | *(generated)* | BLS private key seed used for threshold signatures. Generated automatically on `-init` | |
| 72 | +| `Libp2pPrivKey` | string | *(generated)* | libp2p private key for P2P network identity. Generated automatically on `-init` | |
| 73 | + |
| 74 | +```json title="identityConfig.json" |
| 75 | +{ |
| 76 | + "BlsPrivKeySeed": "<generated>", |
| 77 | + "HiveActiveKey": "ADD_YOUR_PRIVATE_WIF", |
| 78 | + "HiveUsername": "ADD_YOUR_USERNAME", |
| 79 | + "Libp2pPrivKey": "<generated>" |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +:::caution |
| 84 | +`HiveActiveKey` and the generated private keys are sensitive. Do not share or commit this file. |
| 85 | +::: |
| 86 | + |
| 87 | +## Oracle |
| 88 | + |
| 89 | +Configures external chain RPC connections used by the oracle module. |
| 90 | + |
| 91 | +| Field | Type | Description | |
| 92 | +|-------|------|-------------| |
| 93 | +| `Chains` | object | Map of chain identifiers to their RPC configuration | |
| 94 | +| `Chains.<ID>.RpcHost` | string | RPC host and port for the chain (e.g. `bitcoind:48332`) | |
| 95 | +| `Chains.<ID>.RpcUser` | string | RPC username | |
| 96 | +| `Chains.<ID>.RpcPass` | string | RPC password | |
| 97 | + |
| 98 | +```json title="oracleConfig.json" |
| 99 | +{ |
| 100 | + "Chains": { |
| 101 | + "BTC": { |
| 102 | + "RpcHost": "bitcoind:48332", |
| 103 | + "RpcUser": "vsc-node-user", |
| 104 | + "RpcPass": "vsc-node-pass" |
| 105 | + } |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +Currently `BTC` is the only supported chain identifier. |
| 111 | + |
| 112 | +## P2P |
| 113 | + |
| 114 | +Configures the libp2p networking layer. |
| 115 | + |
| 116 | +| Field | Type | Default | Description | |
| 117 | +|-------|------|---------|-------------| |
| 118 | +| `Port` | int | `10720` | TCP port to listen on for P2P connections | |
| 119 | +| `ServerMode` | bool | `false` | When `true`, runs the Kademlia DHT in server mode, making this node reachable for peer discovery. Recommended for nodes with a stable public IP | |
| 120 | +| `AllowPrivate` | bool | `false` | When `true`, allows connections to and announcement of private/LAN IP addresses. Useful for local devnets | |
| 121 | +| `Bootnodes` | string[] | `[]` | List of bootstrap peer multiaddresses used for initial peer discovery. If empty, the node falls back to the built-in default bootnodes | |
| 122 | +| `AnnounceAddrs` | string[] | `[]` | Explicit multiaddresses to announce to the network. When set, overrides automatic address detection | |
| 123 | + |
| 124 | +```json title="p2pConfig.json" |
| 125 | +{ |
| 126 | + "Port": 10720, |
| 127 | + "ServerMode": false, |
| 128 | + "AllowPrivate": false, |
| 129 | + "Bootnodes": [], |
| 130 | + "AnnounceAddrs": [] |
| 131 | +} |
| 132 | +``` |
| 133 | + |
| 134 | +Bootnodes are specified as libp2p multiaddresses, for example: |
| 135 | + |
| 136 | +``` |
| 137 | +/ip4/1.2.3.4/tcp/10720/p2p/12D3KooW... |
| 138 | +``` |
0 commit comments