Skip to content

L2pNodeLauncher Commands

Thomas Cujé edited this page Jun 9, 2015 · 33 revisions

This is a list containing the most used commands in the L2pNodeLauncher class.

At Start-up

These arguments are all optional (except --port or -p) but have to be the first after the call of the class name:

java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher [--help] [--windows-shell] --port 9010 [--bootstrap vermeer.informatik.rwth-aachen.de:9085,steen.informatik.rwth-aachen.de:9085] [interactive commands] [interactive]
  • --help (-h): Prints a help message of the L2pNodeLauncher
  • --windows-shell (-ws): Disables coloured output, since this feature only works on Unix-like terminals and leads to cryptic output in Windows command shells.
  • --port 9010 (-p): Sets the port the LAS2peer node should listen to.
  • --bootstrap vermeer.informatik.rwth-aachen.de:9085,steen.informatik.rwth-aachen.de:9085 (-b): Accepts a comma separated list of bootstrap nodes used to connect multiple nodes to networks.
  • interactive commands: Accepts a list of space separated commands executed automatically after startup in the interactive shell (see below) of the L2pNodeLauncher.
  • interactive: Leaves the L2pNodeLauncher in the interactive shell state after executing all given interactive commands.
Interactive commands

These commands can be either executed when starting the node (in the start script) or after the node has been started by hand:

uploadStartupDirectory(['path/to/startup/directory'])

uploads the contents of the startup directory (default: 'etc/startup') to the network storage of a LAS2peer network (note, that for agents you have to provide the passphrases in the file 'passphrases.txt' stored in the same directory)

registerUserAgent('anonymous','anonymous')

registers a user at this node (for details on how to generate additional user agents, consult the Agents-Users page in this wiki)

startWebConnector / startHttpConnector

starts one of the two predefined connectors

startConnector('connector.package.class')

starts an arbitrary connector given by its class name

startService('i5.las2peer.services.servicePackage.ServiceClass','SampleServicePass')

starts a service with a known agent

startService('i5.las2peer.services.servicePackage.ServiceClass')

starts a service and generates a new service agent for this service

invoke('i5.las2peer.services.servicePackage.ServiceClass','aMethod','parameter1-parameter2')

first argument is the service class, second the service method and third are parameters (use '-' as separator to pass multiple parameters in the last argument of this call)

unregisterCurrentAgent

unregisters the currently active agent (registered by the registerUserAgent method) to register another one to be used with this launcher

findService('i5.las2peer.services.servicePackage.ServiceClass')

looks for the service 'i5.las2peer.services.servicePackage.ServiceClass' in the LAS2peer network and determines whether it exists

findAgent('agent ID')

looks for the given agent with the given agent id in the LAS2peer network

exit / shutdown

closes the current node

getServiceMethods('i5.las2peer.services.servicePackage.ServiceClass')

returns all services methods' signatures of the specified service

interactive

should be executed as a login argument when starting the L2PNodeLauncher and enables the interactive console
(see additional tutorial L2pNodeLauncher - Interactive Command Line)

getLocalNodeInfo

returns some node information specified in the 'nodeInfo.xml' (located in the 'etc' folder)

getInfoOfKnownNodes

returns the node information about all known nodes

Clone this wiki locally