@@ -117,11 +117,11 @@ export class OceanP2P extends EventEmitter {
117117 this . _libp2p . addEventListener ( 'peer:discovery' , ( details : any ) => {
118118 this . handlePeerDiscovery ( details )
119119 } )
120- this . _libp2p . addEventListener ( 'certificate:provision' , ( details : any ) => {
121- this . handleCertificateProvision ( details )
120+ this . _libp2p . addEventListener ( 'certificate:provision' , ( ) => {
121+ this . handleCertificateProvision ( )
122122 } )
123- this . _libp2p . addEventListener ( 'certificate:renew' , ( details : any ) => {
124- this . handleCertificateProvision ( details )
123+ this . _libp2p . addEventListener ( 'certificate:renew' , ( ) => {
124+ this . handleCertificateRenew ( )
125125 } )
126126 this . _options = Object . assign (
127127 { } ,
@@ -198,22 +198,26 @@ export class OceanP2P extends EventEmitter {
198198 }
199199 }
200200
201- handleCertificateProvision ( details : any ) {
202- console . log ( 'A TLS certificate was provisioned' )
203- console . log ( 'Details: ' + JSON . stringify ( details ) )
201+ handleCertificateProvision ( ) {
202+ console . log ( '----- A TLS certificate was provisioned -----' )
204203 const interval = setInterval ( ( ) => {
205204 const mas = this . _libp2p
206205 . getMultiaddrs ( )
207206 . filter ( ( ma : any ) => ma . toString ( ) . includes ( '/sni/' ) )
208207 . map ( ( ma : any ) => ma . toString ( ) )
209208 if ( mas . length > 0 ) {
210- console . log ( 'addresses:' )
209+ console . log ( '----- TLS addresses: ----- ' )
211210 console . log ( mas . join ( '\n' ) )
211+ console . log ( '----- End of TLS addresses -----' )
212212 }
213213 clearInterval ( interval )
214214 } , 1_000 )
215215 }
216216
217+ handleCertificateRenew ( ) {
218+ console . log ( '----- A TLS certificate was renewed -----' )
219+ }
220+
217221 handlePeerJoined ( details : any ) {
218222 P2P_LOGGER . debug ( 'New peer joined us:' + details )
219223 }
@@ -316,7 +320,7 @@ export class OceanP2P extends EventEmitter {
316320 listen : bindInterfaces ,
317321 announceFilter : ( multiaddrs : any [ ] ) =>
318322 multiaddrs . filter ( ( m ) => this . shouldAnnounce ( m ) ) ,
319- appendAnnounce : config . p2pConfig . announceAddresses
323+ announce : config . p2pConfig . announceAddresses
320324 }
321325 } else {
322326 addresses = {
0 commit comments