This repository was archived by the owner on Jul 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ export const main = async () => {
3636
3737 console . log ( 'connected' ) ;
3838
39+ const relayPeerId = ( await Fluence . getClient ( ) ) . getRelayPeerId ( ) ;
40+ console . log ( 'relay:' , relayPeerId ) ;
41+
3942 await registerHelloWorld ( {
4043 hello ( str ) {
4144 return 'Hello, ' + str + '!' ;
Original file line number Diff line number Diff line change @@ -141,15 +141,20 @@ export interface IFluenceClient {
141141 onConnectionStateChange ( handler : ( state : ConnectionState ) => void ) : ConnectionState ;
142142
143143 /**
144- * Return peers secret key as byte array.
144+ * Return peer's secret key as byte array.
145145 */
146146 getPeerSecretKey ( ) : Uint8Array ;
147147
148148 /**
149- * Return peers public key as a base58 string (multihash/CIDv0).
149+ * Return peer's public key as a base58 string (multihash/CIDv0).
150150 */
151151 getPeerId ( ) : string ;
152152
153+ /**
154+ * Return relay's public key as a base58 string (multihash/CIDv0).
155+ */
156+ getRelayPeerId ( ) : string ;
157+
153158 // TODO: come up with a working interface for
154159 // - particle creation
155160 // - particle initialization
Original file line number Diff line number Diff line change @@ -142,6 +142,10 @@ export class FluencePeer implements IFluenceClient {
142142 return this . getStatus ( ) . peerId ! ;
143143 }
144144
145+ getRelayPeerId ( ) : string {
146+ return this . getStatus ( ) . relayPeerId ! ;
147+ }
148+
145149 getPeerSecretKey ( ) : Uint8Array {
146150 if ( ! this . _keyPair ) {
147151 throw new Error ( "Can't get key pair: peer is not initialized" ) ;
You can’t perform that action at this time.
0 commit comments