Class: Bitcoin::Network::PeerDiscovery
- Inherits:
-
Object
- Object
- Bitcoin::Network::PeerDiscovery
- Defined in:
- lib/bitcoin/network/peer_discovery.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ PeerDiscovery
constructor
A new instance of PeerDiscovery.
-
#peers ⇒ Object
get peer addresses, from DNS seeds.
Constructor Details
#initialize(configuration) ⇒ PeerDiscovery
Returns a new instance of PeerDiscovery.
8 9 10 11 |
# File 'lib/bitcoin/network/peer_discovery.rb', line 8 def initialize(configuration) @logger = Bitcoin::Logger.create(:debug) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/bitcoin/network/peer_discovery.rb', line 6 def configuration @configuration end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/bitcoin/network/peer_discovery.rb', line 6 def logger @logger end |
Instance Method Details
#peers ⇒ Object
get peer addresses, from DNS seeds.
14 15 16 17 |
# File 'lib/bitcoin/network/peer_discovery.rb', line 14 def peers # TODO add find from previous connected peer at first. (find_from_dns_seeds + seeds).uniq end |