Skip to content

Commit

Permalink
p2p: migrate secret_connection from tmkms
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed Nov 20, 2020
1 parent 0fc7f40 commit 06caa0d
Show file tree
Hide file tree
Showing 9 changed files with 860 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
members = [
"light-client",
"light-node",
"p2p",
"proto",
"rpc",
"rpc-probe",
Expand Down
33 changes: 33 additions & 0 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "p2p"
version = "0.1.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
readme = "README.md"
keywords = ["p2p", "tendermint", "cosmos"]
authors = [
"Tony Arcieri <tony@iqlusion.io>",
"Ismail Khoffi <Ismail.Khoffi@gmail.com>"
]

description = """
The Tendermint P2P stack.
"""

[dependencies]
chacha20poly1305 = "0.7"
ed25519-dalek = "1"
eyre = "0.6"
hkdf = "0.10.0"
merlin = "2"
prost = "0.6"
rand_core = { version = "0.5", features = ["std"] }
sha2 = "0.9"
subtle = "2"
subtle-encoding = { version = "0.5", features = ["bech32-preview"] }
tendermint = { version = "=0.17.0-rc3", features = ["secp256k1"] }
tendermint-proto = "=0.17.0-rc3"
thiserror = "1"
x25519-dalek = "1.1"
zeroize = "1"
20 changes: 20 additions & 0 deletions p2p/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//! Error types

pub use eyre::{Report, Result};
use thiserror::Error;

/// Kinds of errors
#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
pub enum Error {
/// Cryptographic operation failed
#[error("cryptographic error")]
CryptoError,

/// Malformatted or otherwise invalid cryptographic key
#[error("invalid key")]
InvalidKey,

/// Network protocol-related errors
#[error("protocol error")]
ProtocolError,
}
24 changes: 24 additions & 0 deletions p2p/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//! p2p
//!
//! The Tendermint P2P stack.

// Tip: Deny warnings with `RUSTFLAGS="-D warnings"` environment variable in CI

#![forbid(unsafe_code)]
#![deny(
warnings,
missing_docs,
trivial_casts,
trivial_numeric_casts,
unused_import_braces,
unused_qualifications,
rust_2018_idioms,
nonstandard_style
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-p2p/0.1.0",
html_logo_url = "https://raw.githubusercontent.com/informalsystems/tendermint-rs/master/img/logo-tendermint-rs_3961x4001.png"
)]

pub mod error;
pub mod secret_connection;
Loading

0 comments on commit 06caa0d

Please sign in to comment.