Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Nov 30, 2021
1 parent 0c2fadc commit 205da3d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COMMAND='cargo run --release -- --sync --trial'
function exit_node()
{
echo "Exiting..."
kill -INT $!
kill $!
exit
}

Expand Down
2 changes: 1 addition & 1 deletion run-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COMMAND='cargo run --release -- --trial --verbosity 2'
function exit_node()
{
echo "Exiting..."
kill -INT $!
kill $!
exit
}

Expand Down
2 changes: 1 addition & 1 deletion run-miner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COMMAND="cargo run --release -- --miner ${MINER_ADDRESS} --trial --verbosity 2"
function exit_node()
{
echo "Exiting..."
kill -INT $!
kill $!
exit
}

Expand Down
24 changes: 24 additions & 0 deletions src/display/aleo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,27 @@ pub fn welcome_message() -> String {
output += &"Welcome to Aleo! We thank you for running a network node and supporting privacy.\n".bold();
output
}

pub fn notification_message() -> String {
let mut output = String::new();
output += &r#"
=================================================================================================
Aleo Testnet2 - Incentivization Period
=================================================================================================
The incentivized testnet is about to begin:
1. Generate one Aleo account, and save the account private key and view key.
2. Ensure your Aleo node is running the `run-client.sh` or `run-miner.sh` script,
in order to automatically stay up to date on the incentivized testnet.
3. File all issues on Github at https://github.com/AleoHQ/snarkOS/issues/new/choose
4. Please be respectful to all members of the Aleo community.
Thank you for participating in the incentivized testnet and for supporting privacy!
=================================================================================================
"#
.white()
.bold();
output
}
21 changes: 2 additions & 19 deletions src/network/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with the snarkOS library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
display::notification_message,
helpers::{State, Status, Tasks},
ledger::{Ledger, LedgerRequest, LedgerRouter},
peers::{Peers, PeersRequest, PeersRouter},
Expand Down Expand Up @@ -306,25 +307,7 @@ impl<N: Network, E: Environment> Server<N, E> {
// Notify the outer function that the task is ready.
let _ = router.send(());
loop {
info!(
r"
=========================================================================================================
Aleo Testnet2 - Incentivization Period
=========================================================================================================
The incentivized testnet is about to begin:
1. Generate one Aleo account, and save the account private key and view key.
2. Ensure your Aleo node is running the `run-client.sh` or `run-miner.sh` script,
in order to automatically stay up to date on the incentivized testnet.
3. File all issues on Github at https://github.com/AleoHQ/snarkOS/issues/new/choose
4. Please be respectful to all members of the Aleo community.
Thank you for participating in the incentivized testnet and for supporting privacy!
=========================================================================================================
"
);
info!("{}", notification_message());

if E::NODE_TYPE == NodeType::Miner {
if let Some(miner) = miner {
Expand Down
2 changes: 2 additions & 0 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ impl Node {
println!("{}", crate::display::welcome_message());
println!("Your Aleo address is {}.\n", miner_address);
println!("Starting a mining node on {}.\n", N::NETWORK_NAME);
println!("{}", crate::display::notification_message());
Some(miner_address)
}
_ => {
println!("{}", crate::display::welcome_message());
println!("Starting a client node on {}.\n", N::NETWORK_NAME);
println!("{}", crate::display::notification_message());
None
}
};
Expand Down

0 comments on commit 205da3d

Please sign in to comment.