Skip to content

Commit

Permalink
Merge branch 'master' into feature/integers
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Jun 5, 2020
2 parents b5f8f41 + 967e205 commit e24c689
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
4 changes: 0 additions & 4 deletions network/src/context/bootnodes.rs

This file was deleted.

3 changes: 0 additions & 3 deletions network/src/context/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
pub mod address_book;
pub use self::address_book::*;

pub mod bootnodes;
pub use self::bootnodes::*;

pub mod connections;
pub use self::connections::*;

Expand Down
11 changes: 1 addition & 10 deletions network/src/server/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
bootnodes::MAINNET_BOOTNODES,
context::Context,
message::{Channel, MessageName},
protocol::*,
Expand Down Expand Up @@ -83,19 +82,11 @@ impl Server {
/// Send a handshake request to all bootnodes from config.
async fn connect_bootnodes(&mut self) -> Result<(), ServerError> {
let local_address = self.context.local_address;
let hardcoded_bootnodes = MAINNET_BOOTNODES
.iter()
.map(|node| (*node).to_string())
.collect::<Vec<String>>();

for bootnode in self.context.bootnodes.clone() {
// Bootnodes should not connect to hardcoded bootnodes.
if self.context.is_bootnode && hardcoded_bootnodes.contains(&bootnode) {
continue;
}

let bootnode_address = bootnode.parse::<SocketAddr>()?;

// This node should not attempt to connect to itself.
if local_address != bootnode_address {
info!("Connecting to bootnode: {:?}", bootnode_address);

Expand Down
6 changes: 5 additions & 1 deletion snarkOS/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ use crate::{
parameters::{flag, option, types::*},
};
use snarkos_errors::node::CliError;
use snarkos_network::bootnodes::*;

use clap::ArgMatches;
use serde::Serialize;

/// Hardcoded bootnodes maintained by Aleo.
/// A node should try and connect to these first after coming online.
pub const MAINNET_BOOTNODES: &'static [&str] = &[]; // "192.168.0.1:4130"
pub const TESTNET_BOOTNODES: &'static [&str] = &[]; // "192.168.0.1:14130"

/// Represents all configuration options for a node.
#[derive(Clone, Debug, Serialize)]
pub struct Config {
Expand Down

0 comments on commit e24c689

Please sign in to comment.