From 16d851410b7571fb00d0171b4e08d59c102782a5 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 16 Jan 2013 12:27:24 -0500 Subject: [PATCH 1/2] added DNS-based bootstrap method --- bitmessagemain.py | 13 +++++++++++++ defaultKnownNodes.py | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 136100d6..91c39119 100644 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -3641,6 +3641,19 @@ if __name__ == "__main__": print 'Bitmessage cannot read future versions of the keys file (keys.dat). Run the newer version of Bitmessage.' raise SystemExit + #DNS bootstrap method. Note that this lookup doesn't use the proxy server if configured; adding that feature will require more careful testing to verify that it is working. + try: + for item in socket.getaddrinfo('bootstrap8080.bitmessage.org',80): + print 'Adding', item[4][0],'to knownNodes based on DNS boostrap method' + knownNodes[1][item[4][0]] = (8080,int(time.time())) + except: + print 'bootstrap8080.bitmessage.org DNS bootstraping failed.' + try: + for item in socket.getaddrinfo('bootstrap8444.bitmessage.org',80): + print 'Adding', item[4][0],'to knownNodes based on DNS boostrap method' + knownNodes[1][item[4][0]] = (8444,int(time.time())) + except: + print 'bootstrap8444.bitmessage.org DNS bootstrapping failed.' app = QtGui.QApplication(sys.argv) app.setStyleSheet("QStatusBar::item { border: 0px solid black }") diff --git a/defaultKnownNodes.py b/defaultKnownNodes.py index 28212a2e..53798024 100644 --- a/defaultKnownNodes.py +++ b/defaultKnownNodes.py @@ -10,10 +10,10 @@ def createDefaultKnownNodes(appdata): ############## Stream 1 ################ stream1 = {} - stream1['75.186.58.44'] = (8080,int(time.time())) - stream1['74.66.249.244'] = (8080,int(time.time())) - stream1['76.113.50.103'] = (8444,int(time.time())) - stream1['188.122.235.58'] = (8444,int(time.time())) + #stream1['75.186.58.44'] = (8080,int(time.time())) + #stream1['74.66.249.244'] = (8080,int(time.time())) + #stream1['76.113.50.103'] = (8444,int(time.time())) + #stream1['188.122.235.58'] = (8444,int(time.time())) ############# Stream 2 ################# stream2 = {} -- 2.45.1 From bdf426b0d6440536322941e941c0569796cf2c74 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 16 Jan 2013 12:27:42 -0500 Subject: [PATCH 2/2] added DNS-based bootstrap method --- bitmessagemain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 91c39119..0fc5754d 100644 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -5,7 +5,7 @@ #Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams. -softwareVersion = '0.1.5' +softwareVersion = '0.1.6' verbose = 2 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 #Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 #Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. -- 2.45.1