@@ -46,26 +46,6 @@ import TaskManager from './tasks/TaskManager';
4646import { serverManifest as clientServerManifest } from './client/handlers' ;
4747import { serverManifest as agentServerManifest } from './agent/handlers' ;
4848
49- type NetworkConfig = {
50- // Agent QUICSocket config
51- agentHost ?: string ;
52- agentPort ?: number ;
53- ipv6Only ?: boolean ;
54- agentKeepAliveIntervalTime ?: number ;
55- agentMaxIdleTimeout ?: number ;
56- // RPCServer for client service
57- clientHost ?: string ;
58- clientPort ?: number ;
59- // Websocket server config
60- maxIdleTimeout ?: number ;
61- pingIntervalTime ?: number ;
62- pingTimeoutTimeTime ?: number ;
63- // RPC config
64- clientParserBufferByteLimit ?: number ;
65- handlerTimeoutTime ?: number ;
66- handlerTimeoutGraceTime ?: number ;
67- } ;
68-
6949interface PolykeyAgent extends CreateDestroyStartStop { }
7050@CreateDestroyStartStop (
7151 new errors . ErrorPolykeyAgentRunning ( ) ,
@@ -123,6 +103,10 @@ class PolykeyAgent {
123103 } : {
124104 password : string ;
125105 nodePath ?: string ;
106+
107+ // WHY IS THERE SO MANY CONFIGURATIONS???
108+
109+
126110 keyRingConfig ?: {
127111 recoveryCode ?: RecoveryCode ;
128112 privateKey ?: PrivateKey ;
@@ -142,7 +126,25 @@ class PolykeyAgent {
142126 connectionHolePunchTimeoutTime ?: number ;
143127 connectionHolePunchIntervalTime ?: number ;
144128 } ;
145- networkConfig ?: NetworkConfig ;
129+ networkConfig ?: {
130+ // Agent QUICSocket config
131+ agentHost ?: string ;
132+ agentPort ?: number ;
133+ ipv6Only ?: boolean ;
134+ agentKeepAliveIntervalTime ?: number ;
135+ agentMaxIdleTimeout ?: number ;
136+ // RPCServer for client service
137+ clientHost ?: string ;
138+ clientPort ?: number ;
139+ // Websocket server config
140+ maxIdleTimeout ?: number ;
141+ pingIntervalTime ?: number ;
142+ pingTimeoutTimeTime ?: number ;
143+ // RPC config
144+ clientParserBufferByteLimit ?: number ;
145+ handlerTimeoutTime ?: number ;
146+ handlerTimeoutGraceTime ?: number ;
147+ } ;
146148 seedNodes ?: SeedNodes ;
147149 workers ?: number ;
148150 status ?: Status ;
@@ -192,12 +194,12 @@ class PolykeyAgent {
192194 } ;
193195
194196 await utils . mkdirExists ( fs , nodePath ) ;
195- const statusPath = path . join ( nodePath , config . defaults . statusBase ) ;
196- const statusLockPath = path . join ( nodePath , config . defaults . statusLockBase ) ;
197- const statePath = path . join ( nodePath , config . defaults . stateBase ) ;
198- const dbPath = path . join ( statePath , config . defaults . dbBase ) ;
199- const keysPath = path . join ( statePath , config . defaults . keysBase ) ;
200- const vaultsPath = path . join ( statePath , config . defaults . vaultsBase ) ;
197+ const statusPath = path . join ( nodePath , config . paths . statusBase ) ;
198+ const statusLockPath = path . join ( nodePath , config . paths . statusLockBase ) ;
199+ const statePath = path . join ( nodePath , config . paths . stateBase ) ;
200+ const dbPath = path . join ( statePath , config . paths . dbBase ) ;
201+ const keysPath = path . join ( statePath , config . paths . keysBase ) ;
202+ const vaultsPath = path . join ( statePath , config . paths . vaultsBase ) ;
201203 const events = new EventBus ( {
202204 captureRejections : true ,
203205 } ) ;
0 commit comments