Previous: Using the CapTP API, Up: OCapN: The Object Capabilities Network [Contents][Index]
Assuming a Tor daemon is running, a Goblins Onion netlayer can be
created using the new-onion-netlayer
procedure from the
(goblins ocapn netlayer onion)
module:
> (define-values (onion-netlayer private-key service-id) (new-onion-netlayer))
That netlayer can then be used to spawn an OCapN router actor:
> (define mycapn (spawn-mycapn onion-netlayer))
Each time new-onion-netlayer
is called it generates a new
private-key
and service-id
. If you wish for these to
persist, they need to be stored (securely, as anyone with them has
the capability to host at them) and call restore-onion-netlayer
providing them. An example of this is:
> (define-values (onion-netlayer _private-key _service-id) (restore-onion-netlayer private-key service-id))