fn make_gossip_node(
    keypair: Arc<Keypair>,
    entrypoint: Option<&SocketAddr>,
    exit: &Arc<AtomicBool>,
    gossip_addr: Option<&SocketAddr>,
    shred_version: u16,
) -> (GossipService, Option<TcpListener>, Arc<ClusterInfo>) {
    let (node, gossip_socket, ip_echo) = if let Some(gossip_addr) = gossip_addr {
        ClusterInfo::gossip_node(&keypair.pubkey(), gossip_addr, shred_version)
    } else {
        ClusterInfo::spy_node(&keypair.pubkey(), shred_version)
    };
    let cluster_info = ClusterInfo::new(node, keypair);
    if let Some(entrypoint) = entrypoint {
        cluster_info.set_entrypoint(ContactInfo::new_gossip_entry_point(entrypoint));
    }
    let cluster_info = Arc::new(cluster_info);
    let gossip_service = GossipService::new(&cluster_info, None, gossip_socket, None, &exit);
    (gossip_service, ip_echo, cluster_info)
}
/// Makes a spy or gossip node based on whether or not a gossip_addr was passed in
/// Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in
Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
fn make_gossip_node(
    keypair: Arc<Keypair>,
    entrypoint: Option<&SocketAddr>,
    exit: &Arc<AtomicBool>,
    gossip_addr: Option<&SocketAddr>,
    shred_version: u16,
) -> (GossipService, Option<TcpListener>, Arc<ClusterInfo>) {
    let (node, gossip_socket, ip_echo) = if let Some(gossip_addr) = gossip_addr {
        ClusterInfo::gossip_node(&keypair.pubkey(), gossip_addr, shred_version)
    } else {
        ClusterInfo::spy_node(&keypair.pubkey(), shred_version)
    };
    let cluster_info = ClusterInfo::new(node, keypair);
    if let Some(entrypoint) = entrypoint {
        cluster_info.set_entrypoint(ContactInfo::new_gossip_entry_point(entrypoint));
    }
    let cluster_info = Arc::new(cluster_info);
    let gossip_service = GossipService::new(&cluster_info, None, gossip_socket, None, &exit);
    (gossip_service, ip_echo, cluster_info)
}
fn make_gossip_node ( keypair : Arc < Keypair > , entrypoint : Option < & SocketAddr > , exit : & Arc < AtomicBool > , gossip_addr : Option < & SocketAddr > , shred_version : u16 , ) -> ( GossipService , Option < TcpListener > , Arc < ClusterInfo > ) { let ( node , gossip_socket , ip_echo ) = if let Some ( gossip_addr ) = gossip_addr { ClusterInfo :: gossip_node ( & keypair . pubkey ( ) , gossip_addr , shred_version ) } else { ClusterInfo :: spy_node ( & keypair . pubkey ( ) , shred_version ) } ; let cluster_info = ClusterInfo :: new ( node , keypair ) ; if let Some ( entrypoint ) = entrypoint { cluster_info . set_entrypoint ( ContactInfo :: new_gossip_entry_point ( entrypoint ) ) ; } let cluster_info = Arc :: new ( cluster_info ) ; let gossip_service = GossipService :: new ( & cluster_info , None , gossip_socket , None , & exit ) ; ( gossip_service , ip_echo , cluster_info ) }
Makes a spy or gossip node based on whether or not a gossip_addr was passed in
Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
keypair
Arc<Keypair>
entrypoint
Option<&SocketAddr>
exit
&Arc<AtomicBool>
gossip_addr
Option<&SocketAddr>
shred_version
u16