mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
Add rpc call to get current addresses for our node
This commit is contained in:
parent
01611c2282
commit
0721ce4d34
@ -201,6 +201,7 @@ namespace llarp
|
|||||||
{"llarp.admin.exit.list", [=]() { return ListExitLevels(); }},
|
{"llarp.admin.exit.list", [=]() { return ListExitLevels(); }},
|
||||||
{"llarp.admin.dumpstate", [=]() { return DumpState(); }},
|
{"llarp.admin.dumpstate", [=]() { return DumpState(); }},
|
||||||
{"llarp.admin.status", [=]() { return DumpStatus(); }},
|
{"llarp.admin.status", [=]() { return DumpStatus(); }},
|
||||||
|
{"llarp.our.addresses", [=]() { return OurAddresses(); }},
|
||||||
{"llarp.version", [=]() { return DumpVersion(); }}}
|
{"llarp.version", [=]() { return DumpVersion(); }}}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -279,6 +280,21 @@ namespace llarp
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Response
|
||||||
|
OurAddresses() const
|
||||||
|
{
|
||||||
|
Response services;
|
||||||
|
router->hiddenServiceContext().ForEachService(
|
||||||
|
[&](const std::string&,
|
||||||
|
const std::shared_ptr< service::Endpoint >& service) {
|
||||||
|
const service::Address addr = service->GetIdentity().pub.Addr();
|
||||||
|
services.push_back(addr.ToString());
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
return Response{{"services", services}};
|
||||||
|
}
|
||||||
|
|
||||||
Response
|
Response
|
||||||
DumpVersion() const
|
DumpVersion() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user