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