Skip to content

Commit bbae16b

Browse files
committed
feat: neptune banner
1 parent e58dc80 commit bbae16b

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ sysinfo = "0.31.4"
125125
thread-priority = "1.2.0"
126126
rayon = "1.10"
127127
humantime = "2.1.0"
128+
owo-colors = "4.2.2"
128129

129130
[dev-dependencies]
130131

assets/neptune-banner.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
███╗ ██╗███████╗██████╗ ████████╗██╗ ██╗███╗ ██╗███████╗
3+
████╗ ██║██╔════╝██╔══██╗╚══██╔══╝██║ ██║████╗ ██║██╔════╝
4+
██╔██╗ ██║█████╗ ██████╔╝ ██║ ██║ ██║██╔██╗ ██║█████╗
5+
██║╚██╗██║██╔══╝ ██╔═══╝ ██║ ██║ ██║██║╚██╗██║██╔══╝
6+
██║ ╚████║███████╗██║ ██║ ╚██████╔╝██║ ╚████║███████╗
7+
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
8+

src/bin/neptune-dashboard.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use dashboard_src::dashboard_app::Config;
1010
use dashboard_src::dashboard_app::DashboardApp;
1111
use neptune_cash::config_models::data_directory::DataDirectory;
1212
use neptune_cash::rpc_auth;
13+
use neptune_cash::display_banner;
1314
use neptune_cash::rpc_server::error::RpcError;
1415
use neptune_cash::rpc_server::RPCClient;
1516
use tarpc::client;
@@ -20,6 +21,7 @@ pub mod dashboard_src;
2021

2122
#[tokio::main]
2223
async fn main() {
24+
display_banner();
2325
// we set this panic hook so we can drop out of raw mode in order to
2426
// display the panic message. else there is wicked screen corruption.
2527
set_panic_hook();

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ use config_models::cli_args;
6060
use futures::future;
6161
use futures::Future;
6262
use futures::StreamExt;
63+
use owo_colors::OwoColorize;
6364
use models::blockchain::block::Block;
6465
use models::blockchain::shared::Hash;
6566
use models::peer::handshake_data::HandshakeData;
@@ -105,6 +106,12 @@ const MINER_CHANNEL_CAPACITY: usize = 10;
105106
const RPC_CHANNEL_CAPACITY: usize = 1000;
106107
const VERSION: &str = env!("CARGO_PKG_VERSION");
107108

109+
pub const NEPTUNE_BANNER: &str = include_str!("../assets/neptune-banner.txt");
110+
111+
pub fn display_banner() {
112+
println!("{}", NEPTUNE_BANNER.fg_rgb::<255, 255, 255>().bold());
113+
}
114+
108115
/// Causes compilation failures on targets where `u32` does not fit within a
109116
/// `usize`.
110117
const _MIN_PTR_WIDTH: () = {

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ use clap::Parser;
55
use neptune_cash::config_models::cli_args;
66
use tracing_subscriber::EnvFilter;
77
use tracing_subscriber::FmtSubscriber;
8+
use neptune_cash::display_banner;
89

910
pub fn main() -> Result<()> {
11+
display_banner();
1012
let tokio_runtime = tokio::runtime::Builder::new_multi_thread()
1113
.enable_io()
1214
.enable_time()

0 commit comments

Comments
 (0)