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 () => {
36
36
37
37
console . log ( 'connected' ) ;
38
38
39
+ const relayPeerId = ( await Fluence . getClient ( ) ) . getRelayPeerId ( ) ;
40
+ console . log ( 'relay:' , relayPeerId ) ;
41
+
39
42
await registerHelloWorld ( {
40
43
hello ( str ) {
41
44
return 'Hello, ' + str + '!' ;
Original file line number Diff line number Diff line change @@ -141,15 +141,20 @@ export interface IFluenceClient {
141
141
onConnectionStateChange ( handler : ( state : ConnectionState ) => void ) : ConnectionState ;
142
142
143
143
/**
144
- * Return peers secret key as byte array.
144
+ * Return peer's secret key as byte array.
145
145
*/
146
146
getPeerSecretKey ( ) : Uint8Array ;
147
147
148
148
/**
149
- * Return peers public key as a base58 string (multihash/CIDv0).
149
+ * Return peer's public key as a base58 string (multihash/CIDv0).
150
150
*/
151
151
getPeerId ( ) : string ;
152
152
153
+ /**
154
+ * Return relay's public key as a base58 string (multihash/CIDv0).
155
+ */
156
+ getRelayPeerId ( ) : string ;
157
+
153
158
// TODO: come up with a working interface for
154
159
// - particle creation
155
160
// - particle initialization
Original file line number Diff line number Diff line change @@ -142,6 +142,10 @@ export class FluencePeer implements IFluenceClient {
142
142
return this . getStatus ( ) . peerId ! ;
143
143
}
144
144
145
+ getRelayPeerId ( ) : string {
146
+ return this . getStatus ( ) . relayPeerId ! ;
147
+ }
148
+
145
149
getPeerSecretKey ( ) : Uint8Array {
146
150
if ( ! this . _keyPair ) {
147
151
throw new Error ( "Can't get key pair: peer is not initialized" ) ;
You can’t perform that action at this time.
0 commit comments