@@ -34,7 +34,7 @@ const log = logger('libp2p:autonat')
34
34
// https://github.com/libp2p/specs/blob/master/autonat/README.md#autonat-protocol
35
35
const REQUIRED_SUCCESSFUL_DIALS = 4
36
36
37
- export interface AutonatServiceInit {
37
+ export interface AutoNATServiceInit {
38
38
/**
39
39
* Allows overriding the protocol prefix used
40
40
*/
@@ -56,17 +56,17 @@ export interface AutonatServiceInit {
56
56
refreshInterval ?: number
57
57
58
58
/**
59
- * How many parallel inbound autonat streams we allow per-connection
59
+ * How many parallel inbound autoNAT streams we allow per-connection
60
60
*/
61
61
maxInboundStreams ?: number
62
62
63
63
/**
64
- * How many parallel outbound autonat streams we allow per-connection
64
+ * How many parallel outbound autoNAT streams we allow per-connection
65
65
*/
66
66
maxOutboundStreams ?: number
67
67
}
68
68
69
- export interface AutonatComponents {
69
+ export interface AutoNATComponents {
70
70
registrar : Registrar
71
71
addressManager : AddressManager
72
72
transportManager : TransportManager
@@ -75,8 +75,8 @@ export interface AutonatComponents {
75
75
peerRouting : PeerRouting
76
76
}
77
77
78
- class DefaultAutonatService implements Startable {
79
- private readonly components : AutonatComponents
78
+ class DefaultAutoNATService implements Startable {
79
+ private readonly components : AutoNATComponents
80
80
private readonly startupDelay : number
81
81
private readonly refreshInterval : number
82
82
private readonly protocol : string
@@ -86,7 +86,7 @@ class DefaultAutonatService implements Startable {
86
86
private verifyAddressTimeout ?: ReturnType < typeof setTimeout >
87
87
private started : boolean
88
88
89
- constructor ( components : AutonatComponents , init : AutonatServiceInit ) {
89
+ constructor ( components : AutoNATComponents , init : AutoNATServiceInit ) {
90
90
this . components = components
91
91
this . started = false
92
92
this . protocol = `/${ init . protocolPrefix ?? PROTOCOL_PREFIX } /${ PROTOCOL_NAME } /${ PROTOCOL_VERSION } `
@@ -130,7 +130,7 @@ class DefaultAutonatService implements Startable {
130
130
}
131
131
132
132
/**
133
- * Handle an incoming autonat request
133
+ * Handle an incoming AutoNAT request
134
134
*/
135
135
async handleIncomingAutonatStream ( data : IncomingStreamData ) : Promise < void > {
136
136
const signal = anySignal ( [ AbortSignal . timeout ( this . timeout ) ] )
@@ -565,8 +565,8 @@ class DefaultAutonatService implements Startable {
565
565
}
566
566
}
567
567
568
- export function autonatService ( init : AutonatServiceInit = { } ) : ( components : AutonatComponents ) => { } {
568
+ export function autoNATService ( init : AutoNATServiceInit = { } ) : ( components : AutoNATComponents ) => { } {
569
569
return ( components ) => {
570
- return new DefaultAutonatService ( components , init )
570
+ return new DefaultAutoNATService ( components , init )
571
571
}
572
572
}
0 commit comments