tahoe-lafs/src/allmydata/queen.py

33 lines
1.1 KiB
Python
Raw Normal View History

2006-11-30 22:39:24 +00:00
import os.path
from allmydata import node
from allmydata.filetable import GlobalVirtualDrive
from allmydata.introducer import Introducer
2006-11-30 22:39:24 +00:00
class Queen(node.Node):
CERTFILE = "introducer.pem"
PORTNUMFILE = "introducer.port"
NODETYPE = "introducer"
2006-11-30 22:39:24 +00:00
def __init__(self, basedir="."):
node.Node.__init__(self, basedir)
2006-11-30 22:39:24 +00:00
self.urls = {}
2006-12-01 02:38:38 +00:00
def tub_ready(self):
r = self.add_service(Introducer())
self.urls["introducer"] = self.tub.registerReference(r, "introducer")
self.log(" introducer is at %s" % self.urls["introducer"])
f = open(os.path.join(self.basedir, "introducer.furl"), "w")
f.write(self.urls["introducer"] + "\n")
f.close()
gvd = self.add_service(GlobalVirtualDrive(self.basedir))
self.urls["vdrive"] = self.tub.registerReference(gvd.get_root(),
"vdrive")
self.log(" vdrive is at %s" % self.urls["vdrive"])
f = open(os.path.join(self.basedir, "vdrive.furl"), "w")
f.write(self.urls["vdrive"] + "\n")
f.close()
2006-11-30 22:39:24 +00:00