From 47a55d62e03a296c1c7017242740004ae72eac18 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 3 Aug 2015 02:47:21 +0200 Subject: [PATCH] staging progress --- eth/main.cpp | 16 +++++++++++++++- libp2p/Host.h | 11 +++++++++++ libp2p/Network.h | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index a17e04e9c..62669eff6 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -178,8 +178,22 @@ void help() << " --port Connect to remote port (default: 30303)." << endl << " --network-id Only connect to other hosts with this network id." << endl << " --upnp Use UPnP for NAT (default: on)." << endl + + // "initial, required" + // network.peers + // network.hosts + << " --peers Text list of type:publickey@host[:port] (default: bootstrap.txt)" << endl + << " Types:" << endl + << " default Attempt connection when no other peers are available and pinning is disable." << endl + << " trusted Keep connected at all times." << endl + << " --trust-peers Text list of publickeys." << endl + + << " --accept-hosts List of host:port Always accept connections from specified hosts." << endl +// TODO (req'd update to UDP for signaling ingress connect): +// << " --accept-peers List of publickey Always accept connections from peers with specified public keys." << endl + << " --no-discovery Disable Node discovery." << endl - << " --pin Only connect to required (trusted) peers." << endl + << " --pin Only accept or connect to required peers." << endl << " --hermit Equivalent to --no-discovery --pin." << endl << " --sociable Forces discovery and no pinning." << endl // << " --require-peers List of required (trusted) peers. (experimental)" << endl diff --git a/libp2p/Host.h b/libp2p/Host.h index d015a2f65..487147074 100644 --- a/libp2p/Host.h +++ b/libp2p/Host.h @@ -119,6 +119,17 @@ struct NodeInfo std::string version; }; +struct NetworkHosts +{ + NetworkHosts() {} + + std::list const initialPeers; + std::list const requiredPeers; + std::list const acceptedHosts; + + std::list const bootstrapPeers; +}; + /** * @brief The Host class * Capabilities should be registered prior to startNetwork, since m_capabilities is not thread-safe. diff --git a/libp2p/Network.h b/libp2p/Network.h index e70dd89ea..ee0ff2ab1 100644 --- a/libp2p/Network.h +++ b/libp2p/Network.h @@ -53,7 +53,7 @@ struct NetworkPreferences unsigned short listenPort = 30303; bool traverseNAT = true; bool discovery = true; // Discovery is activated with network. - bool pin = false; // Only connect to trusted ("required") peers. + bool pin = false; // Only accept or connect to required peers. }; /**