Skip to content

Commit

Permalink
client: fix config object issue (#694)
Browse files Browse the repository at this point in the history
* client: fix config issue

* CLI: log discv5 config on startup

* Fix shouldRefresh opt

---------

Co-authored-by: acolytec3 <[email protected]>
  • Loading branch information
ScottyPoi and acolytec3 authored Dec 18, 2024
1 parent b1e7850 commit 5e475e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const main = async () => {

const portal = await PortalNetwork.create(portalConfig)

log(`discv5Config: ${JSON.stringify(portal.discv5['config'], null, 2)}`)

const rpcAddr = args.rpcAddr ?? ip // Set RPC address (used by metrics server and rpc server)
let metricsServer: http.Server | undefined

Expand Down
2 changes: 2 additions & 0 deletions packages/portalnetwork/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class PortalNetwork extends (EventEmitter as { new (): PortalNetworkEvent
},
}
const config = { ...defaultConfig, ...opts.config }
config.config = { ...defaultConfig.config, ...opts.config?.config }
let bootnodes = opts.bootnodes
if (opts.rebuildFromMemory === true && opts.db) {
const prevEnrString = await opts.db.get('enr')
Expand Down Expand Up @@ -142,6 +143,7 @@ export class PortalNetwork extends (EventEmitter as { new (): PortalNetworkEvent
eventLog: opts.eventLog,
utpTimeout: opts.utpTimeout,
gossipCount: opts.gossipCount,
shouldRefresh: opts.shouldRefresh,
})
for (const network of portal.networks.values()) {
try {
Expand Down

0 comments on commit 5e475e2

Please sign in to comment.