Node endpoints (#1778)

## Issue Addressed

`node` endpoints in #1434

## Proposed Changes

Implement these:
```
 /eth/v1/node/health
 /eth/v1/node/peers/{peer_id}
 /eth/v1/node/peers
```
- Add an `Option<Enr>` to `PeerInfo`
- Finish implementation of `/eth/v1/node/identity`

## Additional Info
- should update the `peers` endpoints when #1764 is resolved



Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
realbigsean
2020-10-22 02:59:42 +00:00
parent 8f86baa48d
commit a3552a4b70
12 changed files with 493 additions and 50 deletions

View File

@@ -5,7 +5,7 @@ pub mod enr_ext;
// Allow external use of the lighthouse ENR builder
pub use enr::{build_enr, create_enr_builder_from_config, use_or_load_enr, CombinedKey, Eth2Enr};
pub use enr_ext::{peer_id_to_node_id, CombinedKeyExt, EnrExt};
pub use libp2p::core::identity::Keypair;
pub use libp2p::core::identity::{Keypair, PublicKey};
use crate::metrics;
use crate::{error, Enr, NetworkConfig, NetworkGlobals, SubnetDiscovery};