Skip to content

Commit f2fdff3

Browse files
committed
feat: add node configuration JSON schema
1 parent 01c1f62 commit f2fdff3

File tree

1 file changed

+287
-0
lines changed

1 file changed

+287
-0
lines changed

schemas/node_config.json

Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "LDK Node Configuration",
4+
"description": "Configuration options for LDK Node Flutter. Used to configure a Node instance via Builder.",
5+
"type": "object",
6+
"properties": {
7+
"network": {
8+
"type": "string",
9+
"enum": ["bitcoin", "testnet", "signet", "regtest"],
10+
"description": "Bitcoin network to connect to. Use 'testnet' or 'signet' for development, 'bitcoin' for mainnet (real money)."
11+
},
12+
"storageDirPath": {
13+
"type": "string",
14+
"description": "Path to store node data (channels, wallet, keys). Must be writable. Use path_provider to get a valid directory."
15+
},
16+
"listeningAddresses": {
17+
"type": "array",
18+
"description": "IP addresses and TCP ports the node will listen on for incoming connections.",
19+
"items": {
20+
"type": "object",
21+
"properties": {
22+
"type": {
23+
"type": "string",
24+
"enum": ["hostname", "tcpIpV4", "tcpIpV6", "onionV3"],
25+
"description": "Address type"
26+
},
27+
"addr": {
28+
"type": "string",
29+
"description": "IP address or hostname"
30+
},
31+
"port": {
32+
"type": "integer",
33+
"minimum": 1,
34+
"maximum": 65535,
35+
"default": 9735,
36+
"description": "TCP port number"
37+
}
38+
},
39+
"required": ["addr", "port"]
40+
},
41+
"default": [{"type": "hostname", "addr": "0.0.0.0", "port": 9735}]
42+
},
43+
"announcementAddresses": {
44+
"type": "array",
45+
"description": "Addresses announced to the gossip network. Required for public channels.",
46+
"items": {
47+
"$ref": "#/properties/listeningAddresses/items"
48+
}
49+
},
50+
"nodeAlias": {
51+
"type": "string",
52+
"maxLength": 32,
53+
"description": "Node alias for gossip network announcements. Max 32 bytes UTF-8. Required for public channels."
54+
},
55+
"trustedPeers0Conf": {
56+
"type": "array",
57+
"description": "List of peer public keys (hex) allowed to open zero-confirmation channels. Use with caution.",
58+
"items": {
59+
"type": "string",
60+
"pattern": "^[0-9a-fA-F]{66}$",
61+
"description": "Peer's public key in hex format (33 bytes = 66 hex chars)"
62+
},
63+
"default": []
64+
},
65+
"probingLiquidityLimitMultiplier": {
66+
"type": "integer",
67+
"minimum": 1,
68+
"default": 3,
69+
"description": "Multiplier for liquidity probing limits."
70+
},
71+
"anchorChannelsConfig": {
72+
"type": "object",
73+
"description": "Configuration for Anchor channels (improved fee handling).",
74+
"properties": {
75+
"trustedPeersNoReserve": {
76+
"type": "array",
77+
"description": "Peers trusted to handle anchor outputs. No reserve maintained for these peers.",
78+
"items": {
79+
"type": "string",
80+
"pattern": "^[0-9a-fA-F]{66}$"
81+
},
82+
"default": []
83+
},
84+
"perChannelReserveSats": {
85+
"type": "integer",
86+
"minimum": 0,
87+
"default": 25000,
88+
"description": "Satoshis reserved per anchor channel for emergency fee bumping."
89+
}
90+
}
91+
},
92+
"routeParameters": {
93+
"type": "object",
94+
"description": "Default routing parameters for payments. Can be overridden per-payment.",
95+
"properties": {
96+
"maxTotalRoutingFeeMsat": {
97+
"oneOf": [
98+
{
99+
"type": "object",
100+
"properties": {
101+
"type": {"const": "noFeeCap"}
102+
}
103+
},
104+
{
105+
"type": "object",
106+
"properties": {
107+
"type": {"const": "feeCap"},
108+
"amountMsat": {"type": "integer", "minimum": 0}
109+
},
110+
"required": ["amountMsat"]
111+
}
112+
],
113+
"description": "Maximum routing fees. Either 'noFeeCap' or 'feeCap' with amountMsat."
114+
},
115+
"maxTotalCltvExpiryDelta": {
116+
"type": "integer",
117+
"minimum": 0,
118+
"description": "Maximum CLTV expiry delta for the entire route."
119+
},
120+
"maxPathCount": {
121+
"type": "integer",
122+
"minimum": 1,
123+
"description": "Maximum number of paths for multi-path payments (MPP)."
124+
},
125+
"maxChannelSaturationPowerOfHalf": {
126+
"type": "integer",
127+
"minimum": 0,
128+
"maximum": 8,
129+
"default": 2,
130+
"description": "Max channel utilization as power of 1/2. 0=100%, 1=50%, 2=25%, etc."
131+
}
132+
}
133+
},
134+
"chainDataSource": {
135+
"type": "object",
136+
"description": "Blockchain data source configuration.",
137+
"oneOf": [
138+
{
139+
"type": "object",
140+
"properties": {
141+
"type": {"const": "esplora"},
142+
"serverUrl": {"type": "string", "format": "uri"},
143+
"backgroundSyncConfig": {"$ref": "#/definitions/backgroundSyncConfig"}
144+
},
145+
"required": ["type", "serverUrl"]
146+
},
147+
{
148+
"type": "object",
149+
"properties": {
150+
"type": {"const": "electrum"},
151+
"serverUrl": {"type": "string"},
152+
"backgroundSyncConfig": {"$ref": "#/definitions/backgroundSyncConfig"}
153+
},
154+
"required": ["type", "serverUrl"]
155+
},
156+
{
157+
"type": "object",
158+
"properties": {
159+
"type": {"const": "bitcoindRpc"},
160+
"rpcHost": {"type": "string"},
161+
"rpcPort": {"type": "integer", "minimum": 1, "maximum": 65535},
162+
"rpcUser": {"type": "string"},
163+
"rpcPassword": {"type": "string"}
164+
},
165+
"required": ["type", "rpcHost", "rpcPort", "rpcUser", "rpcPassword"]
166+
}
167+
]
168+
},
169+
"gossipSource": {
170+
"type": "object",
171+
"description": "Source for Lightning network gossip data.",
172+
"oneOf": [
173+
{
174+
"type": "object",
175+
"properties": {
176+
"type": {"const": "p2pNetwork"}
177+
},
178+
"required": ["type"]
179+
},
180+
{
181+
"type": "object",
182+
"properties": {
183+
"type": {"const": "rapidGossipSync"},
184+
"serverUrl": {"type": "string", "format": "uri"}
185+
},
186+
"required": ["type", "serverUrl"]
187+
}
188+
]
189+
},
190+
"liquiditySource": {
191+
"type": "object",
192+
"description": "LSPS2 liquidity source for JIT channels.",
193+
"properties": {
194+
"address": {
195+
"type": "object",
196+
"properties": {
197+
"addr": {"type": "string"},
198+
"port": {"type": "integer", "minimum": 1, "maximum": 65535}
199+
},
200+
"required": ["addr", "port"]
201+
},
202+
"publicKey": {
203+
"type": "string",
204+
"pattern": "^[0-9a-fA-F]{66}$",
205+
"description": "LSP node public key in hex"
206+
},
207+
"token": {
208+
"type": "string",
209+
"description": "Optional authentication token for LSP"
210+
}
211+
},
212+
"required": ["address", "publicKey"]
213+
},
214+
"logLevel": {
215+
"type": "string",
216+
"enum": ["gossip", "trace", "debug", "info", "warn", "error"],
217+
"default": "debug",
218+
"description": "Minimum log level. 'gossip' is most verbose, 'error' is least."
219+
}
220+
},
221+
"required": ["network", "storageDirPath"],
222+
"definitions": {
223+
"backgroundSyncConfig": {
224+
"type": "object",
225+
"description": "Background sync intervals. Set to null to disable background sync (manual only).",
226+
"properties": {
227+
"onchainWalletSyncIntervalSecs": {
228+
"type": "integer",
229+
"minimum": 10,
230+
"default": 80,
231+
"description": "On-chain wallet sync interval in seconds. Minimum 10."
232+
},
233+
"lightningWalletSyncIntervalSecs": {
234+
"type": "integer",
235+
"minimum": 10,
236+
"default": 30,
237+
"description": "Lightning wallet sync interval in seconds. Minimum 10."
238+
},
239+
"feeRateCacheUpdateIntervalSecs": {
240+
"type": "integer",
241+
"minimum": 10,
242+
"default": 600,
243+
"description": "Fee rate cache update interval in seconds. Minimum 10."
244+
}
245+
}
246+
}
247+
},
248+
"examples": [
249+
{
250+
"network": "testnet",
251+
"storageDirPath": "/data/user/0/com.example.app/files/ldk_node",
252+
"listeningAddresses": [
253+
{"type": "hostname", "addr": "0.0.0.0", "port": 9735}
254+
],
255+
"chainDataSource": {
256+
"type": "esplora",
257+
"serverUrl": "https://testnet.ltbl.io/api"
258+
},
259+
"gossipSource": {
260+
"type": "rapidGossipSync",
261+
"serverUrl": "https://testnet.ltbl.io/snapshot"
262+
}
263+
},
264+
{
265+
"network": "signet",
266+
"storageDirPath": "/data/user/0/com.example.app/files/ldk_node",
267+
"chainDataSource": {
268+
"type": "esplora",
269+
"serverUrl": "https://mutinynet.ltbl.io/api",
270+
"backgroundSyncConfig": {
271+
"onchainWalletSyncIntervalSecs": 60,
272+
"lightningWalletSyncIntervalSecs": 60,
273+
"feeRateCacheUpdateIntervalSecs": 600
274+
}
275+
},
276+
"gossipSource": {
277+
"type": "rapidGossipSync",
278+
"serverUrl": "https://mutinynet.ltbl.io/snapshot"
279+
},
280+
"liquiditySource": {
281+
"address": {"addr": "44.219.111.31", "port": 39735},
282+
"publicKey": "0371d6fd7d75de2d0372d03ea00e8bacdacb50c27d0eaea0a76a0622eff1f5ef2b",
283+
"token": "JZWN9YLW"
284+
}
285+
}
286+
]
287+
}

0 commit comments

Comments
 (0)