[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2491: synchronous node startup
Tahoe-LAFS
trac at tahoe-lafs.org
Mon Mar 28 23:52:37 UTC 2016
#2491: synchronous node startup
-------------------------+------------------------------------------------
Reporter: dawuud | Owner: daira
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: unknown | Version: 1.10.1
Resolution: | Keywords: tor i2p static synchronous startup
Launchpad Bug: |
-------------------------+------------------------------------------------
Comment (by warner):
More details copied from #517:
At node-creation time (e.g. `tahoe create-node`):
* `tahoe create-node` should allocate (or be told) a port to listen on,
and write it into tahoe.cfg `tub.port` as a server endpoint descriptor
string (so `tcp:12345`, or `tcp:12345:interface=127.0.0.1`).
* it should also detect (or be told) an IP address to use in the FURL, and
write it as `tub.location` (as a Foolscap connection hint, so
`tcp:HOST:PORT`)
At runtime (e.g. `tahoe start`):
* Try to get the port number from `BASEDIR/client.port` (which must not be
"0"). If that's empty, read tahoe.cfg `tub.port` (which might be missing,
which means "AUTO"; we can probably reject "0" here too).
* if our port is "AUTO" (which only happens if we have a node created
before the above `tahoe create-node` was deployed, but which has never
been started with `tahoe start`), then we use the utility function to
allocate a port, and we write it into `BASEDIR/client.port`.
* Now we know what port to listen on. Build a server endpoint descriptor
string and pass it to `tub.listenOn()`.
*
* Try to get the tub location from tahoe.cfg `tub.location`.
* If that's empty, use the synchronous non-Twisted IP-address detection
function to get a list of IP addresses. Combine that with the port we're
listening on (from above) to build a list of hints. Join them with commas.
* Pass the hints into `tub.setLocation()`.
*
* Now call the rest of the `Node`/`Client` startup functions.
Other code changes/accomplishments:
* `node.Node._tub_ready_observer` and `when_tub_ready` go away
* several `client.Client` methods stop using `when_tub_ready` (and stop
using Deferreds): `init_introducer_client`, `init_storage`, `init_control,
`init_helper`, `init_key_gen`.
* in particular, we call `tub.setLocation()` *before* calling any of those
init methods, so they can safely use `tub.registerReference`
Other tasks necessary to make this work:
* move the controlport and logport to separate Tubs, with a separate
(ephemeral) key, listening on a runtime-allocated port, and 127.0.0.1
* consider adding a config knob to override this: to set a stable port and
key, so you can copy the `logport.furl` to a separate machine and use
`flogtool tail` after a reboot.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2491#comment:3>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list