improved tor support for bitcoin

This commit is contained in:
Kevin Froman 2018-02-24 15:43:10 -06:00
parent 34fa1a755f
commit 152f9e7dee
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
3 changed files with 7 additions and 2 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "onionr/bitpeer"]
path = onionr/bitpeer
url = https://github.com/beardog108/bitpeer.py

1
onionr/bitpeer Submodule

@ -0,0 +1 @@
Subproject commit d179f625b3a1bf1b6fc544e65a81c103ab01ec7c

View File

@ -20,8 +20,9 @@
from bitpeer.node import * from bitpeer.node import *
from bitpeer.storage.shelve import ShelveStorage from bitpeer.storage.shelve import ShelveStorage
import logging, time import logging, time
import socks, sys
class OnionrBTC: class OnionrBTC:
def __init__(self, lastBlock='00000000000000000021ee6242d08e3797764c9258e54e686bc2afff51baf599', lastHeight=510613): def __init__(self, lastBlock='00000000000000000021ee6242d08e3797764c9258e54e686bc2afff51baf599', lastHeight=510613, torP=9050):
stream = logging.StreamHandler() stream = logging.StreamHandler()
logger = logging.getLogger('halfnode') logger = logging.getLogger('halfnode')
logger.addHandler(stream) logger.addHandler(stream)
@ -29,7 +30,7 @@ class OnionrBTC:
LASTBLOCK = lastBlock LASTBLOCK = lastBlock
LASTBLOCKINDEX = lastHeight LASTBLOCKINDEX = lastHeight
self.node = Node ('BTC', ShelveStorage ('./btc-blocks.db'), lastblockhash=LASTBLOCK, lastblockheight=LASTBLOCKINDEX) self.node = Node ('BTC', ShelveStorage ('data/btc-blocks.db'), lastblockhash=LASTBLOCK, lastblockheight=LASTBLOCKINDEX, torPort=torP)
self.node.bootstrap () self.node.bootstrap ()
self.node.connect () self.node.connect ()