Skip to content

Merge CoZ development into jseagrave21 development #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ All notable changes to this project are documented in this file.
- Fix ``getcontractstate`` JSON output to match neo-cli 2.9.2 `#746 <https://github.com/CityOfZion/neo-python/issues/746>`_
- Fix ``getrawtransaction`` JSON output to match neo-cli 2.9.2 `#751 <https://github.com/CityOfZion/neo-python/pull/751>`_
- Refactor CLI to be more user friendly and support better future extensibility `#805 <https://github.com/CityOfZion/neo-python/pull/805`_

- Update TestNet seeds

[0.8.2] 2018-10-31
-------------------
Expand Down
3 changes: 3 additions & 0 deletions neo/Network/NodeLeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet import reactor, task
from neo.logging import log_manager
from neo.Network.utils import is_ip_address, hostname_to_ip

logger = log_manager.getLogger('network')

Expand Down Expand Up @@ -124,6 +125,8 @@ def Start(self):
start_delay = 0
for bootstrap in settings.SEED_LIST:
host, port = bootstrap.split(":")
if not is_ip_address(host):
host = hostname_to_ip(host)
setupConnDeferred = task.deferLater(reactor, start_delay, self.SetupConnection, host, port)
setupConnDeferred.addErrback(self.onSetupConnectionErr)
start_delay += 1
Expand Down
15 changes: 15 additions & 0 deletions neo/Network/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import socket
import ipaddress


def hostname_to_ip(hostname):
return socket.gethostbyname(hostname)


def is_ip_address(hostname):
host = hostname.split(':')[0]
try:
ip = ipaddress.ip_address(host)
return True
except ValueError:
return False
20 changes: 15 additions & 5 deletions neo/data/protocol.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@
"AddressVersion": 23,
"Magic": 1953787457,
"SeedList": [
"13.58.169.218:20333",
"13.58.33.157:20333",
"18.222.161.128:20333",
"18.191.171.240:20333",
"18.222.168.189:20333"
"seed1.ngd.network:20333",
"seed2.ngd.network:20333",
"seed3.ngd.network:20333",
"seed4.ngd.network:20333",
"seed5.ngd.network:20333",
"seed6.ngd.network:20333",
"seed7.ngd.network:20333",
"seed8.ngd.network:20333",
"seed9.ngd.network:20333",
"seed10.ngd.network:20333",
"seed1.neo.org:20333",
"seed2.neo.org:20333",
"seed3.neo.org:20333",
"seed4.neo.org:20333",
"seed5.neo.org:20333"
],
"RPCList": [
"http://18.221.221.195:8880",
Expand Down