mirror of https://github.com/waku-org/js-waku.git
Add /info command
This commit is contained in:
parent
f5edd09fa9
commit
e467cf1379
|
@ -82,6 +82,7 @@ export default function App() {
|
|||
switch (cmd) {
|
||||
case '/help':
|
||||
commandResponses.push('/nick <nickname>: set a new nickname');
|
||||
commandResponses.push('/info: some information about the node');
|
||||
commandResponses.push(
|
||||
'/connect <Multiaddr>: connect to the given peer'
|
||||
);
|
||||
|
@ -96,6 +97,15 @@ export default function App() {
|
|||
commandResponses.push(`New nick: ${arg}`);
|
||||
}
|
||||
break;
|
||||
case '/info':
|
||||
if (!stateWaku) {
|
||||
commandResponses.push(`Waku node is starting`);
|
||||
} else {
|
||||
commandResponses.push(
|
||||
`PeerId: ${stateWaku.libp2p.peerId.toB58String()}`
|
||||
);
|
||||
}
|
||||
break;
|
||||
case '/connect':
|
||||
const peer = args.shift();
|
||||
if (!peer) {
|
||||
|
|
Loading…
Reference in New Issue