darkfi/
lib.rs

1/* This file is part of DarkFi (https://dark.fi)
2 *
3 * Copyright (C) 2020-2025 Dyne.org foundation
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 */
18
19pub mod error;
20pub use error::{ClientFailed, ClientResult, Error, Result};
21
22#[cfg(feature = "blockchain")]
23pub mod blockchain;
24
25#[cfg(feature = "validator")]
26pub mod validator;
27
28#[cfg(feature = "geode")]
29pub mod geode;
30
31#[cfg(feature = "event-graph")]
32pub mod event_graph;
33
34#[cfg(feature = "net")]
35pub mod net;
36
37#[cfg(feature = "rpc")]
38pub mod rpc;
39
40#[cfg(feature = "system")]
41pub mod system;
42
43#[cfg(feature = "tx")]
44pub mod tx;
45
46#[cfg(feature = "util")]
47pub mod util;
48
49#[cfg(feature = "wasm-runtime")]
50pub mod runtime;
51
52#[cfg(feature = "zk")]
53pub mod zk;
54
55#[cfg(feature = "zkas")]
56pub mod zkas;
57
58#[cfg(feature = "dht")]
59pub mod dht;
60
61pub const ANSI_LOGO: &str = include_str!("../contrib/darkfi.ansi");
62
63#[macro_export]
64macro_rules! cli_desc {
65    () => {{
66        let commitish = match option_env!("COMMITISH") {
67            Some(c) => &format!("-{}", c),
68            None => "",
69        };
70        let desc = format!(
71            "{} {}\n{}{}\n{}",
72            env!("CARGO_PKG_NAME").to_string(),
73            env!("CARGO_PKG_VERSION").to_string(),
74            commitish,
75            env!("CARGO_PKG_DESCRIPTION").to_string(),
76            darkfi::ANSI_LOGO,
77        );
78
79        Box::leak(desc.into_boxed_str()) as &'static str
80    }};
81}