Skip to content

L2pNodeLauncher Commands

Dominik Renzel edited this page Jul 8, 2014 · 33 revisions

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

At Startup

These arguments are all optional but have to be the first after the call of the class name and have to be in this order:

[--help] [windows_shell] [log-directory=path] [service-directory=path]

--help: Prints a help message of the L2pNodeLauncher
windows_shell: Disables all colored output, since this feature only works on Unix-like terminals and leads to cryptic output in windows shells
log-directory=path: Sets directory folder for logging files, default is 'log'
service-directory=path: Sets the service directory folder, default is 'service'

Interactive

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

uploadStartupDirectory

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

uploadStartupDirectory('C:\folder')

uploads the contents of the given directory to the global storage of the LAS2peer network

registerUserAgent('anonymous','anonymous')

registers a user at this node

startHttpConnector / startWebConnector

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

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