Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup +nightly component add rustfmt
- name: Run Fmt
run: cargo fmt --all -- --check
run: cargo +nightly fmt --all -- --check

- name: Run Clippy
run: cargo clippy --all-targets --all-features
Expand Down
29 changes: 18 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@

# TODO(template) update for the crate name
[workspace]
members = ["examples", "template_crate"]
members = [
"crates/charon",
"crates/charon-cli",
"crates/charon-cluster",
"crates/charon-consensus",
"crates/charon-core",
"crates/charon-crypto",
"crates/charon-db",
"crates/charon-dkg",
"crates/charon-errors",
"crates/charon-eth2",
"crates/charon-observability",
"crates/charon-p2p",
"crates/charon-serde",
"crates/charon-testutil",
]
resolver = "3"
default-members = ["template_crate"]

[workspace.package]
version = "0.1.0"
edition = "2024"
# TODO(template) update for your repository
repository = "https://github.com/NethermindEth/rust-template"
license = "Apache-2.0" # TODO(template) update license if needed
repository = "https://github.com/NethermindEth/charon-rs"
license = "Apache-2.0" # TODO(template) update license
publish = false

[workspace.dependencies]
proptest = "1"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we need to remove this dependency.


[workspace.lints.rust]
missing_docs = "deny"
# TODO(template) if you use any unsafe code, then running miri in CI is a must
# if for a crate in the workspace you need an unsafe code
# prefer to preserve forbid for the workspace
# and allowing only at a specific crate level
unsafe_code = "forbid"

[workspace.lints.clippy]
Expand Down
14 changes: 0 additions & 14 deletions cargo-generate.toml

This file was deleted.

9 changes: 5 additions & 4 deletions examples/Cargo.toml → crates/charon-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "examples"
publish = false
name = "charon-cli"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]
# TODO(template) update the crate name
template_crate = { path = "../template_crate" }

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon CLI
//!
//! Command-line interface for the Charon distributed validator node.
//! This crate provides the CLI tools and commands for managing and operating
//! Charon validator nodes.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_cli::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
12 changes: 12 additions & 0 deletions crates/charon-cluster/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "charon-cluster"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-cluster/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon Cluster
//!
//! Cluster management and coordination for Charon distributed validator nodes.
//! This crate handles the formation, management, and coordination of validator
//! clusters in the Charon network.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_cluster::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
12 changes: 12 additions & 0 deletions crates/charon-consensus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "charon-consensus"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-consensus/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon Consensus
//!
//! Consensus mechanisms and protocols for Charon distributed validator nodes.
//! This crate implements the consensus algorithms and protocols required for
//! coordinating validator operations across the distributed network.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_consensus::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
12 changes: 12 additions & 0 deletions crates/charon-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "charon-core"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon Core
//!
//! Core functionality and utilities for the Charon distributed validator node.
//! This crate provides the fundamental building blocks, data structures, and
//! core algorithms used throughout the Charon system.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_core::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
12 changes: 12 additions & 0 deletions crates/charon-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "charon-crypto"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-crypto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon Crypto
//!
//! Cryptographic primitives and utilities for the Charon distributed validator
//! node. This crate provides cryptographic functions, key management, and
//! security operations required for distributed validator operations.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_crypto::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
12 changes: 12 additions & 0 deletions crates/charon-db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "charon-db"
version.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true

[dependencies]

[lints]
workspace = true
39 changes: 39 additions & 0 deletions crates/charon-db/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! # Charon Database
//!
//! Database layer and persistence for the Charon distributed validator node.
//! This crate provides database abstractions, storage backends, and data
//! persistence mechanisms for validator state and operations.

/// Adds two numbers together.
///
/// # Arguments
///
/// * `left` - The first number to add
/// * `right` - The second number to add
///
/// # Returns
///
/// The sum of the two numbers
///
/// # Examples
///
/// ```
/// use charon_db::add;
///
/// let result = add(2, 2);
/// assert_eq!(result, 4);
/// ```
pub fn add(left: u64, right: u64) -> u64 {
left.wrapping_add(right)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
Loading
Loading