mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-03 03:36:44 +00:00
record our nodeid (for reference) in 'my_nodeid'
This commit is contained in:
parent
5937564a1c
commit
8b96fabf52
@ -13,6 +13,7 @@ class Node(service.MultiService):
|
|||||||
PORTNUMFILE = None
|
PORTNUMFILE = None
|
||||||
CERTFILE = None
|
CERTFILE = None
|
||||||
LOCAL_IP_FILE = "local_ip"
|
LOCAL_IP_FILE = "local_ip"
|
||||||
|
NODEIDFILE = "my_nodeid"
|
||||||
|
|
||||||
def __init__(self, basedir="."):
|
def __init__(self, basedir="."):
|
||||||
service.MultiService.__init__(self)
|
service.MultiService.__init__(self)
|
||||||
@ -29,6 +30,9 @@ class Node(service.MultiService):
|
|||||||
f.write(self.tub.getCertData())
|
f.write(self.tub.getCertData())
|
||||||
f.close()
|
f.close()
|
||||||
self.nodeid = idlib.a2b(self.tub.tubID)
|
self.nodeid = idlib.a2b(self.tub.tubID)
|
||||||
|
f = open(os.path.join(self.basedir, self.NODEIDFILE), "w")
|
||||||
|
f.write(idlib.b2a(self.nodeid) + "\n")
|
||||||
|
f.close()
|
||||||
self.short_nodeid = self.tub.tubID[:4] # ready for printing
|
self.short_nodeid = self.tub.tubID[:4] # ready for printing
|
||||||
portnum = 0
|
portnum = 0
|
||||||
assert self.PORTNUMFILE, "Your node.Node subclass must provide PORTNUMFILE"
|
assert self.PORTNUMFILE, "Your node.Node subclass must provide PORTNUMFILE"
|
||||||
|
Loading…
Reference in New Issue
Block a user