Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/autocertifier-client/src/AutoCertifierClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface AutoCertifierClientEvents {

export type HasSession = (request: HasSessionRequest, context: ServerCallContext) => Promise<HasSessionResponse>

const logger = new Logger(module)
const logger = new Logger('AutoCertifierClient')

const ensureConfigFileWritable = (directory: string): void => {
const baseDirectory = getBaseDirectory(directory)
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-client/src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CreateCertifiedSubdomainRequest } from './data/CreateCertifiedSubdomain
import { Logger } from '@streamr/utils'
import { makeHttpRequest } from './makeHttpRequest'

const logger = new Logger(module)
const logger = new Logger('RestClient')

export class RestClient {

Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/bin/copyARecordsToRoute53.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import chunk from 'lodash/chunk'
import { ChangeAction } from '@aws-sdk/client-route-53'

(async () => {
const logger = new Logger(module)
const logger = new Logger('copyARecordsToRoute53')

const domainName = validateEnvironmentVariable('AUTOCERTIFIER_DOMAIN_NAME')
const databaseFilePath = validateEnvironmentVariable('AUTOCERTIFIER_DATABASE_FILE_PATH')
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/AutoCertifierServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ChallengeManager } from './ChallengeManager'
import { RRType } from '@aws-sdk/client-route-53'
import { Route53Api } from './Route53Api'

const logger = new Logger(module)
const logger = new Logger('AutoCertifierServer')

export const validateEnvironmentVariable = (name: string): string | never => {
const value = process.env[name]
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/CertificateCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
import { ChallengeManager } from './ChallengeManager'
import { Challenge } from 'acme-client/types/rfc8555'

const logger = new Logger(module)
const logger = new Logger('CertificateCreator')

// https://letsencrypt.org/docs/challenge-types/#dns-01-challenge
const DNS_01_CHALLENGE = 'dns-01'
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { open, Statement, Database as SqliteDatabase } from 'sqlite'
import { Logger, filePathToNodeFormat } from '@streamr/utils'
import { DatabaseError, InvalidSubdomainOrToken } from '@streamr/autocertifier-client'

const logger = new Logger(module)
const logger = new Logger('Database')

export class Database {

Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/DnsServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type AsyncDnsHandler = (
...args: Parameters<DnsHandler>
) => Promise<void>

const logger = new Logger(module)
const logger = new Logger('DnsServer')

// https://help.dnsfilter.com/hc/en-us/articles/4408415850003-DNS-Return-Codes
// DNS Query Format Error
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/RestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import bodyParser from 'body-parser'
import * as https from 'https'
import * as fs from 'fs'

const logger = new Logger(module)
const logger = new Logger('RestServer')

type ExpressType = ReturnType<typeof express>
type ServerType = ReturnType<ExpressType['listen']>
Expand Down
2 changes: 1 addition & 1 deletion packages/autocertifier-server/src/StreamrChallenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { toProtoRpcClient } from '@streamr/proto-rpc'
import { Logger } from '@streamr/utils'
import { FailedToConnectToStreamrWebSocket, AutoCertifierRpcClient, SERVICE_ID } from '@streamr/autocertifier-client'

const logger = new Logger(module)
const logger = new Logger('StreamrChallenger')

// This is a dummy peer descriptor that is used to connect to the streamr websocket
// To ensure that the autocertified subdomain is used for the Streamr Network
Expand Down
2 changes: 1 addition & 1 deletion packages/cdn-location/src/fetchAirportCodeFromCdn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger, withTimeout } from '@streamr/utils'

const logger = new Logger(module)
const logger = new Logger('fetchAirportCodeFromCdn')

const fetchHeader: (url: string, header: string, timeout: number) => Promise<string | null> = async (
url: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/cdn-location/src/getLocalRegion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import haversine from 'haversine'

const DEFAULT_MAX_CACHE_AGE = 1000 * 60 * 60 // 1 hour

const logger = new Logger(module)
const logger = new Logger('getLocalRegion')

let cachedLocalRegion: number | undefined = undefined
let cachedLocalRegionFetchTime: number | undefined = undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
fetchAirportCodeFromFastly } from '../../src/fetchAirportCodeFromCdn'
import { airportCodeToRegion } from '../../src/airportCodeToRegion'

const logger = new Logger(module)
const logger = new Logger('fetchAirportCodeFromCdn.test')

describe('fetchAirportCodeFromCdn', () => {

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/bin/streamr-internal-node-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { binaryToHex, ChangeFieldType, Logger } from '@streamr/utils'
import { createClientCommand } from '../src/command'
import semver from 'semver'

const logger = new Logger(module)
const logger = new Logger('streamr-internal-node-info')

export type NormalizedNodeInfo = ChangeFieldType<
NodeInfo,
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectionLockRpcLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ConnectionLockRpcLocalOptions {
setPrivate: (id: DhtAddress, isPrivate: boolean) => void
}

const logger = new Logger(module)
const logger = new Logger('ConnectionLockRpcLocal')

export class ConnectionLockRpcLocal implements IConnectionLockRpc {

Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectionLockRpcRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConnectionLockRpcClient } from '../../generated/packages/dht/protos/Dht
import { LockID } from './ConnectionLockStates'
import { toNodeId } from '../identifiers'

const logger = new Logger(module)
const logger = new Logger('ConnectionLockRpcRemote')

export class ConnectionLockRpcRemote extends RpcRemote<ConnectionLockRpcClient> {

Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface ConnectionManagerMetrics extends MetricsDefinition {
connectionTotalFailureCount: Metric
}

const logger = new Logger(module)
const logger = new Logger('ConnectionManager')

enum ConnectionManagerState {
IDLE = 'idle',
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectorFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ConnectorFacade {
stop: () => Promise<void>
}

const logger = new Logger(module)
const logger = new Logger('ConnectorFacade')

// TODO: Wrap component specific configs to their own objects.
export interface DefaultConnectorFacadeOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/Handshaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { toNodeId } from '../identifiers'
import { PendingConnection } from './PendingConnection'
import { version as applicationVersion } from '../../package.json'

const logger = new Logger(module)
const logger = new Logger('Handshaker')

interface HandshakerEvents {
handshakeRequest: (source: PeerDescriptor, protocolVersion: string, target?: PeerDescriptor) => void
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ManagedConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface ManagedConnectionEvents {
disconnected: (gracefulLeave: boolean) => void
}

const logger = new Logger(module)
const logger = new Logger('ManagedConnection')

// ManagedConnection is a component used as a wrapper for IConnection after they have been successfully handshaked.
// Should only be used in the ConnectionManager.
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/PendingConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface PendingConnectionEvents {
disconnected: (gracefulLeave: boolean) => void
}

const logger = new Logger(module)
const logger = new Logger('PendingConnection')

// PendingConnection is used as a reference to a connection that should be opened and handshaked to a given PeerDescriptor
// It does not hold a connection internally. The public method onHandshakedCompleted should be called once a connection for the
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/connectivityChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { WebsocketClientConnection } from './websocket/NodeWebsocketClientConnec
import { connectivityMethodToWebsocketUrl } from './websocket/WebsocketClientConnector'
import { isMaybeSupportedProtocolVersion } from '../helpers/version'

const logger = new Logger(module)
const logger = new Logger('connectivityChecker')

// TODO use options option or named constant?
export const connectAsync = async ({ url, allowSelfSignedCertificate, timeoutMs = 1000 }:
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/connectivityRequestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { GeoIpLocator } from '@streamr/geoip-location'

export const DISABLE_CONNECTIVITY_PROBE = 0

const logger = new Logger(module)
const logger = new Logger('connectivityRequestHandler')

export const attachConnectivityRequestHandler = (connectionToListenTo: WebsocketServerConnection, geoIpLocator?: GeoIpLocator): void => {
connectionToListenTo.on('data', async (data: Uint8Array) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/simulator/Simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Heap from 'heap'
import { debugVars } from '../../helpers/debugHelpers'
import { DhtAddress, toNodeId } from '../../identifiers'

const logger = new Logger(module)
const logger = new Logger('Simulator')

export enum LatencyType { NONE = 'NONE', RANDOM = 'RANDOM', REAL = 'REAL', FIXED = 'FIXED' }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Logger } from '@streamr/utils'
import { protoToString } from '../../helpers/protoToString'
import { toNodeId } from '../../identifiers'

const logger = new Logger(module)
const logger = new Logger('SimulatorConnection')

export class SimulatorConnection extends Connection implements IConnection {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DhtAddress, toNodeId } from '../../identifiers'
import { acceptHandshake, createIncomingHandshaker, createOutgoingHandshaker, rejectHandshake } from '../Handshaker'
import { PendingConnection } from '../PendingConnection'

const logger = new Logger(module)
const logger = new Logger('SimulatorConnector')

export class SimulatorConnector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum DisconnectedRtcPeerConnectionStateEnum {
CLOSED = 'closed',
}

const logger = new Logger(module)
const logger = new Logger('BrowserWebrtcConnection')

interface Params {
iceServers?: IceServer[]
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/webrtc/NodeWebrtcConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PortRange } from '../ConnectionManager'
import { toNodeId } from '../../identifiers'
import { createRandomConnectionId } from '../Connection'

const logger = new Logger(module)
const logger = new Logger('NodeWebrtcConnection')

export interface Params {
remotePeerDescriptor: PeerDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ConnectionID } from '../IConnection'
import { ConnectingConnection } from './WebrtcConnector'
import { PendingConnection } from '../PendingConnection'

const logger = new Logger(module)
const logger = new Logger('WebrtcConnectorRpcLocal')

interface WebrtcConnectorRpcLocalOptions {
connect: (targetPeerDescriptor: PeerDescriptor, doNotRequestConnection: boolean) => PendingConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '../../../generated/packages/dht/protos/DhtRpc'
import { WebrtcConnectorRpcClient } from '../../../generated/packages/dht/protos/DhtRpc.client'

const logger = new Logger(module)
const logger = new Logger('WebrtcConnectorRpcRemote')

export class WebrtcConnectorRpcRemote extends RpcRemote<WebrtcConnectorRpcClient> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CUSTOM_GOING_AWAY = 3001
// https://github.com/websockets/ws/blob/master/doc/ws.md#ready-state-constants
const OPEN = 1

const logger = new Logger(module)
const logger = new Logger('AbstractWebsocketClientConnection')

export abstract class AbstractWebsocketClientConnection extends EventEmitter<ConnectionEvents> implements IConnection {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface AutoCertifierClientFacadeOptions {
createClientFactory?: () => IAutoCertifierClient
}

const logger = new Logger(module)
const logger = new Logger('AutoCertifierClientFacade')

export class AutoCertifierClientFacade {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Logger } from '@streamr/utils'
import { ICloseEvent, IMessageEvent, w3cwebsocket as Websocket } from 'websocket'
import { AbstractWebsocketClientConnection } from './AbstractWebsocketClientConnection'

const logger = new Logger(module)
const logger = new Logger('BrowserWebsocketClientConnection')

const BINARY_TYPE = 'arraybuffer'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Logger, binaryToUtf8 } from '@streamr/utils'
import { WebSocket } from 'ws'
import { AbstractWebsocketClientConnection } from './AbstractWebsocketClientConnection'

const logger = new Logger(module)
const logger = new Logger('NodeWebsocketClientConnection')

const BINARY_TYPE = 'nodebuffer'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RpcRemote } from '../../dht/contact/RpcRemote'
import { WebsocketClientConnectorRpcClient } from '../../../generated/packages/dht/protos/DhtRpc.client'
import { toNodeId } from '../../identifiers'

const logger = new Logger(module)
const logger = new Logger('WebsocketClientConnectorRpcRemote')

export class WebsocketClientConnectorRpcRemote extends RpcRemote<WebsocketClientConnectorRpcClient> {

Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/websocket/WebsocketServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { v4 as uuid } from 'uuid'
import { parse } from 'url'
import { IConnection } from '../IConnection'

const logger = new Logger(module)
const logger = new Logger('WebsocketServer')

interface WebsocketServerOptions {
portRange: PortRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Url } from 'url'
import { CUSTOM_GOING_AWAY, GOING_AWAY } from './AbstractWebsocketClientConnection'
import { createRandomConnectionId } from '../Connection'

const logger = new Logger(module)
const logger = new Logger('WebsocketServerConnection')

export class WebsocketServerConnection extends EventEmitter<ConnectionEvents> implements IConnection {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as Err from '../../helpers/errors'
import { expectedConnectionType } from '../../helpers/Connectivity'
import { PendingConnection } from '../PendingConnection'

const logger = new Logger(module)
const logger = new Logger('WebsocketServerConnector')

export interface WebsocketServerConnectorOptions {
onNewConnection: (connection: PendingConnection) => boolean
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/DhtNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ type StrictDhtNodeOptions = MarkRequired<DhtNodeOptions,
'storageRedundancyFactor' |
'metricsContext'>

const logger = new Logger(module)
const logger = new Logger('DhtNode')

export const NUMBER_OF_NODES_PER_KBUCKET_DEFAULT = 8
const PERIODICAL_PING_INTERVAL = 60 * 1000
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/DhtNodeRpcLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface DhtNodeRpcLocalOptions {
removeContact: (nodeId: DhtAddress) => void
}

const logger = new Logger(module)
const logger = new Logger('DhtNodeRpcLocal')

export class DhtNodeRpcLocal implements IDhtNodeRpc {

Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/DhtNodeRpcRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DhtCallContext } from '../rpc-protocol/DhtCallContext'
import { RingIdRaw } from './contact/ringIdentifiers'
import { RingContacts } from './contact/RingContactList'

const logger = new Logger(module)
const logger = new Logger('DhtNodeRpcRemote')

// Fields required by objects stored in the k-bucket library
export interface KBucketContact {
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/PeerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { RingContactList } from './contact/RingContactList'
import { ReadonlySortedContactList, SortedContactList } from './contact/SortedContactList'
import { RingIdRaw, getRingIdRawFromPeerDescriptor } from './contact/ringIdentifiers'

const logger = new Logger(module)
const logger = new Logger('PeerManager')

interface PeerManagerOptions {
numberOfNodesPerKBucket: number
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/discovery/DiscoverySession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DhtNodeRpcRemote } from '../DhtNodeRpcRemote'
import { PeerManager, getDistance } from '../PeerManager'
import { getClosestNodes } from '../contact/getClosestNodes'

const logger = new Logger(module)
const logger = new Logger('DiscoverySession')

interface DiscoverySessionOptions {
targetId: DhtAddress
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/discovery/PeerDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const createDistantDhtAddress = (address: DhtAddress): DhtAddress => {
return toDhtAddress(flipped)
}

const logger = new Logger(module)
const logger = new Logger('PeerDiscovery')

export class PeerDiscovery {

Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/dht/discovery/RingDiscoverySession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PeerManager } from '../PeerManager'
import { RingContacts } from '../contact/RingContactList'
import { RingId, RingIdRaw, getLeftDistance, getRingIdFromPeerDescriptor, getRingIdFromRaw } from '../contact/ringIdentifiers'

const logger = new Logger(module)
const logger = new Logger('RingDiscoverySession')

interface RingDiscoverySessionOptions {
targetId: RingIdRaw
Expand Down
Loading