added intruction for nodes

This commit is contained in:
Kevin Froman 2018-04-18 20:17:47 -05:00
parent edce30ea20
commit 77f811c455
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
4 changed files with 36 additions and 2 deletions

View file

@ -41,6 +41,7 @@ class Core:
self.blockDB = 'data/blocks.db'
self.blockDataLocation = 'data/blocks/'
self.addressDB = 'data/address.db'
self.hsAdder = ''
if not os.path.exists('data/'):
os.mkdir('data/')
@ -48,6 +49,10 @@ class Core:
os.mkdir('data/blocks/')
if not os.path.exists(self.blockDB):
self.createBlockDB()
if os.path.exists('data/hs/hostname'):
with open('data/hs/hostname', 'r') as hs:
self.hsAdder = hs.read()
self._utils = onionrutils.OnionrUtils(self)
# Initialize the crypto object
@ -540,4 +545,12 @@ class Core:
self.addToBlockDB(addedHash, selfInsert=True)
self.setBlockType(addedHash, header)
retData = addedHash
return retData
return retData
def introduceNode(self):
'''
Introduces our node into the network by telling X many nodes our HS address
'''
nodeList = self.listAdders().split('\n')
self.daemonQueueAdd('announceNode', nodeList)
return