---
title: llarp::rpc::LokidRpcClient
summary: The LokidRpcClient uses loki-mq to talk to make API requests to lokid. 

---

# llarp::rpc::LokidRpcClient



The [LokidRpcClient]() uses loki-mq to talk to make API requests to lokid. 


`#include <lokid_rpc_client.hpp>`

Inherits from std::enable_shared_from_this< LokidRpcClient >

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[LokidRpcClient](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-lokidrpcclient)**(LMQ_ptr lmq, std::weak_ptr< [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) > r) |
| void | **[ConnectAsync](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-connectasync)**(oxenmq::address url)<br>Connect to lokid async.  |
| [SecretKey](Classes/structllarp_1_1SecretKey.md) | **[ObtainIdentityKey](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-obtainidentitykey)**()<br>blocking request identity key from lokid throws on failure  |
| uint64_t | **[BlockHeight](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-blockheight)**() const<br>get what the current block height is according to oxend  |
| void | **[LookupLNSNameHash](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-lookuplnsnamehash)**([dht::Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) namehash, std::function< void(std::optional< [service::EncryptedName](Classes/structllarp_1_1service_1_1EncryptedName.md) >)> resultHandler) |
| void | **[InformConnection](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md#function-informconnection)**([RouterID](Classes/structllarp_1_1RouterID.md) router, bool success)<br>inform that if connected to a router successfully  |

## Public Functions Documentation

### function LokidRpcClient

```cpp
explicit LokidRpcClient(
    LMQ_ptr lmq,
    std::weak_ptr< AbstractRouter > r
)
```


### function ConnectAsync

```cpp
void ConnectAsync(
    oxenmq::address url
)
```

Connect to lokid async. 

### function ObtainIdentityKey

```cpp
SecretKey ObtainIdentityKey()
```

blocking request identity key from lokid throws on failure 

### function BlockHeight

```cpp
inline uint64_t BlockHeight() const
```

get what the current block height is according to oxend 

### function LookupLNSNameHash

```cpp
void LookupLNSNameHash(
    dht::Key_t namehash,
    std::function< void(std::optional< service::EncryptedName >)> resultHandler
)
```


### function InformConnection

```cpp
void InformConnection(
    RouterID router,
    bool success
)
```

inform that if connected to a router successfully 

-------------------------------

Updated on 2023-01-26 at 19:35:17 +0000