Skip to content

Commit

Permalink
Save Fri Feb 23 09:17:59 AM -03 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Arregui committed Feb 23, 2024
1 parent e8375a4 commit 710679b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ws-connector/src/components.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTTPProvider } from 'eth-connect'
import { createDotEnvConfigComponent } from '@well-known-components/env-config-provider'
import { createConfigComponent, createDotEnvConfigComponent } from '@well-known-components/env-config-provider'
import { createLogComponent } from '@well-known-components/logger'
import { AppComponents } from './types'
import { metricDeclarations } from './metrics'
Expand All @@ -18,7 +18,10 @@ export async function initComponents(): Promise<AppComponents> {
const server = await createUWsComponent({ config, logs })

const fetch = createFetchComponent()
const nats = await createNatsComponent({ config, logs })

const natsLogs = await createLogComponent({ config: createConfigComponent({ LOG_LEVEL: 'WARN' }) })
const nats = await createNatsComponent({ config, logs: natsLogs })

const peersRegistry = await createPeersRegistry()

const ethNetwork = (await config.getString('ETH_NETWORK')) ?? 'sepolia'
Expand Down
2 changes: 1 addition & 1 deletion ws-connector/src/controllers/handlers/ws-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function registerWsHandler(
try {
packet = ClientPacket.decode(Buffer.from(message))
} catch (err: any) {
console.log(Buffer.from(message).toString('hex').match(/../g)!.join(' '))
logger.log(Buffer.from(message).toString('hex').match(/../g)!.join(' '))

logger.error(err)
ws.end(1007, Buffer.from('Cannot decode ClientPacket'))
Expand Down

0 comments on commit 710679b

Please sign in to comment.