replace 'queen' with 'introducer' in a lot of places, but not all

This commit is contained in:
Brian Warner 2007-04-19 17:30:21 -07:00
parent 4acce66b0b
commit a3c9ead74f
4 changed files with 40 additions and 38 deletions

38
README
View File

@ -90,30 +90,32 @@ RUNNING:
If you installed one of the debian packages constructed by "make deb-*" then
it creates an 'allmydata-tahoe' executable, usually in /usr/bin . If you
didn't install a package you can find allmydata-tahoe in instdir/scripts.
This tool is used to create, start, and stop nodes. Each node lives in a
separate base directory, inside of which you can add files to configure and
control the node. Nodes also read and write files within that directory.
didn't install a package you can find allmydata-tahoe in bin/ . This tool is
used to create, start, and stop nodes. Each node lives in a separate base
directory, inside of which you can add files to configure and control the
node. Nodes also read and write files within that directory.
A mesh consists of a single central 'queen' node and a large number of
'client' nodes. If you are joining an existing mesh, the queen node will
already be running, and you'll just need to create a client node. If you're
creating a brand new mesh, you'll need to create both a queen and a client
(and then invite other people to create their own client nodes and join your
mesh).
A mesh consists of a single central 'introducer' node and a large number of
'client' nodes. If you are joining an existing mesh, the introducer node
will already be running, and you'll just need to create a client node. If
you're creating a brand new mesh, you'll need to create both an introducer
and a client (and then invite other people to create their own client nodes
and join your mesh).
The queen node is constructed by running 'allmydata-tahoe create-queen
--basedir WHERE'. Once constructed, you can start the queen by running
'allmydata-tahoe start --basedir WHERE'. Inside that base directory, there
will be a pair of files 'introducer.furl' and 'vdrive.furl'. Make a copy of
these, as they'll be needed on the client nodes.
The introducer node is constructed by running 'allmydata-tahoe
create-introducer --basedir $HERE'. Once constructed, you can start the
introducer by running 'allmydata-tahoe start --basedir $HERE' (or, if you
are already in the introducer's base directory, just type 'allmydata-tahoe
start'). Inside that base directory, there will be a pair of files
'introducer.furl' and 'vdrive.furl'. Make a copy of these, as they'll be
needed on the client nodes.
To construct a client node, pick a new working directory for it, then run
'allmydata-tahoe create-client --basedir $HERE'. Copy the two .furl files
from the queen into this new directory, then run 'allmydata-tahoe start
from the introducer into this new directory, then run 'allmydata-tahoe start
--basedir $HERE'. After that, the client node should be off and running. The
first thing it will do is connect to the queen and introduce itself to all
other nodes on the mesh. You can follow its progress by looking at the
first thing it will do is connect to the introducer and introduce itself to
all other nodes on the mesh. You can follow its progress by looking at the
$HERE/twistd.log file.
To actually use the client, enable the web interface by writing a port

View File

@ -34,9 +34,9 @@ class CreateClientOptions(usage.Options):
raise usage.UsageError("<basedir> parameter is required")
self['basedir'] = os.path.abspath(self['basedir'])
class CreateQueenOptions(usage.Options):
class CreateIntroducerOptions(usage.Options):
optParameters = [
["basedir", "C", None, "which directory to create the queen in"],
["basedir", "C", None, "which directory to create the introducer in"],
]
def parseArgs(self, *args):
@ -62,7 +62,7 @@ application = service.Application("allmydata_client")
c.setServiceParent(application)
"""
queen_tac = """
introducer_tac = """
# -*- python -*-
from allmydata import queen
@ -70,7 +70,7 @@ from twisted.application import service
c = queen.Queen()
application = service.Application("allmydata_queen")
application = service.Application("allmydata_introducer")
c.setServiceParent(application)
"""
@ -79,7 +79,7 @@ class Options(usage.Options):
subCommands = [
["create-client", None, CreateClientOptions, "Create a client node."],
["create-queen", None, CreateQueenOptions, "Create a queen node."],
["create-introducer", None, CreateIntroducerOptions, "Create a introducer node."],
["start", None, StartOptions, "Start a node (of any type)."],
["stop", None, StopOptions, "Stop a node."],
["restart", None, RestartOptions, "Restart a node."],
@ -105,8 +105,8 @@ def run():
if command == "create-client":
rc = create_client(so)
elif command == "create-queen":
rc = create_queen(so)
elif command == "create-introducer":
rc = create_introducer(so)
elif command == "start":
rc = start(so)
elif command == "stop":
@ -133,7 +133,7 @@ def create_client(config):
print "client created in %s" % basedir
print " please copy introducer.furl and vdrive.furl into the directory"
def create_queen(config):
def create_introducer(config):
basedir = config['basedir']
if os.path.exists(basedir):
if os.listdir(basedir):
@ -144,29 +144,29 @@ def create_queen(config):
# we're willing to use an empty directory
else:
os.mkdir(basedir)
f = open(os.path.join(basedir, "queen.tac"), "w")
f.write(queen_tac)
f = open(os.path.join(basedir, "introducer.tac"), "w")
f.write(introducer_tac)
f.close()
print "queen created in %s" % basedir
print "introducer created in %s" % basedir
def start(config):
basedir = config['basedir']
if os.path.exists(os.path.join(basedir, "client.tac")):
tac = "client.tac"
type = "client"
elif os.path.exists(os.path.join(basedir, "queen.tac")):
tac = "queen.tac"
type = "queen"
elif os.path.exists(os.path.join(basedir, "introducer.tac")):
tac = "introducer.tac"
type = "introducer"
else:
print "%s does not look like a node directory" % basedir
sys.exit(1)
os.chdir(basedir)
rc = os.system("twistd -y %s" % tac)
if rc == 0:
print "node probably started"
print "%s node probably started" % type
return 0
else:
print "node probably not started"
print "%s node probably not started" % type
return 1
def stop(config):

View File

@ -15,8 +15,8 @@
<h2>Mesh Status</h2>
<div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div>
<div>Queen: <span n:render="string" n:data="queen_pburl" /></div>
<div>Connected to queen?: <span n:render="string" n:data="connected_to_queen" /></div>
<div>Introducer: <span n:render="string" n:data="introducer_pburl" /></div>
<div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div>
<div>Known+Connected Peers: <span n:render="string" n:data="num_peers" /></div>
<div>

View File

@ -29,9 +29,9 @@ class Welcome(rend.Page):
def data_my_nodeid(self, ctx, data):
return idlib.b2a(IClient(ctx).nodeid)
def data_queen_pburl(self, ctx, data):
def data_introducer_pburl(self, ctx, data):
return IClient(ctx).introducer_furl
def data_connected_to_queen(self, ctx, data):
def data_connected_to_introducer(self, ctx, data):
if IClient(ctx).connected_to_vdrive:
return "yes"
return "no"