2006-11-30 22:39:24 +00:00
|
|
|
|
2006-12-03 02:37:31 +00:00
|
|
|
import os.path
|
2006-12-03 01:27:18 +00:00
|
|
|
from allmydata import node
|
2006-12-04 02:07:41 +00:00
|
|
|
from allmydata.filetable import GlobalVirtualDrive
|
2007-03-27 23:12:11 +00:00
|
|
|
from allmydata.introducer import Introducer
|
2006-12-01 00:43:15 +00:00
|
|
|
|
2006-11-30 22:39:24 +00:00
|
|
|
|
2006-12-03 01:27:18 +00:00
|
|
|
class Queen(node.Node):
|
2007-04-20 01:24:15 +00:00
|
|
|
CERTFILE = "introducer.pem"
|
|
|
|
PORTNUMFILE = "introducer.port"
|
|
|
|
NODETYPE = "introducer"
|
2006-11-30 22:39:24 +00:00
|
|
|
|
2006-12-03 01:27:18 +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
|
|
|
|
2006-12-03 02:37:31 +00:00
|
|
|
def tub_ready(self):
|
2007-03-27 23:12:11 +00:00
|
|
|
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")
|
2006-12-03 02:37:31 +00:00
|
|
|
f.close()
|
2006-11-30 22:39:24 +00:00
|
|
|
|