Skip to content

Commit a7a1f9f

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

File tree

7 files changed

+29
-2
lines changed

7 files changed

+29
-2
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-cli.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use neptune_cash::models::state::wallet::wallet_file::WalletFile;
3434
use neptune_cash::models::state::wallet::wallet_file::WalletFileContext;
3535
use neptune_cash::models::state::wallet::wallet_status::WalletStatus;
3636
use neptune_cash::models::state::wallet::wallet_status::WalletStatusExportFormat;
37-
use neptune_cash::rpc_auth;
37+
use neptune_cash::{display_banner, rpc_auth};
3838
use neptune_cash::rpc_server::error::RpcError;
3939
use neptune_cash::rpc_server::RPCClient;
4040
use rand::Rng;
@@ -405,6 +405,7 @@ struct Config {
405405

406406
#[tokio::main]
407407
async fn main() -> Result<()> {
408+
display_banner();
408409
let args: Config = Config::parse();
409410

410411
// Handle commands that don't require a server

src/bin/neptune-dashboard.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crossterm::terminal::LeaveAlternateScreen;
99
use dashboard_src::dashboard_app::Config;
1010
use dashboard_src::dashboard_app::DashboardApp;
1111
use neptune_cash::config_models::data_directory::DataDirectory;
12-
use neptune_cash::rpc_auth;
12+
use neptune_cash::{display_banner, rpc_auth};
1313
use neptune_cash::rpc_server::error::RpcError;
1414
use neptune_cash::rpc_server::RPCClient;
1515
use tarpc::client;
@@ -20,6 +20,7 @@ pub mod dashboard_src;
2020

2121
#[tokio::main]
2222
async fn main() {
23+
display_banner();
2324
// we set this panic hook so we can drop out of raw mode in order to
2425
// display the panic message. else there is wicked screen corruption.
2526
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)