Skip to main content

Crate nklave_cosmos

Crate nklave_cosmos 

Source
Expand description

Nklave Cosmos - Remote signer protocol handler for Cosmos/CometBFT

This crate implements the Tendermint private validator protocol (privval), allowing Nklave to serve as a remote signer for Cosmos validators.

§Protocol Support

  • gRPC PrivValidatorAPI service
  • PubKeyRequest/Response
  • SignVoteRequest/Response
  • SignProposalRequest/Response
  • Ping/Pong keepalive

§Usage

use nklave_cosmos::{CosmosServer, CosmosServerConfig};
use nklave_core::SigningService;

let config = CosmosServerConfig {
    listen_addr: "[::1]:26659".to_string(),
    chain_id: "cosmoshub-4".to_string(),
};

let server = CosmosServer::new(signing_service, config);
server.serve().await?;

Re-exports§

pub use error::CosmosError;
pub use server::CosmosServer;
pub use server::CosmosServerConfig;
pub use server::CosmosServerHandle;
pub use service::CosmosSigningService;
pub use types::SignedMsgType;
pub use types::VoteInfo;
pub use types::ProposalInfo;

Modules§

error
Error types for Cosmos protocol handling
server
TCP/Unix socket server implementing the Tendermint PrivValidator protocol
service
Cosmos signing service wrapper
types
Type wrappers and conversions for Tendermint protocol types