There are two types of shell interactive command applications to use for user choices, but they are similar in terms of the functions they provide to each other:
A Java-based shell command application
A native shell command implemented in C/C++
A Java based Shell Command
Here is a serial of commands to build the shell command application for the Boson Java repository. This process is the same as building a boson super node service:
$ git clone git@github.com:bosonnetwork/Boson.Java boson
$ cd boson
$ ./mvnw -Dmaven.test.skip=true
$ cd shell/target
Under the directory shell/target, a binary named boson-shell is generated, and the user can run this executable with the command to enter the interactive console:
IIf the program is running with the shell without the config file, then the current shell acts as an isolated node detached from the main boson network. We recommend using the bootstrap command to connect to the boson network next.
help
This is the main command for users to request help with all the commands supported in this shell command application. Users need to learn the commands from the PicocliCommands section to delve into the details of the current running node.
Boson $ help
System:
exit exit from app/script
help command help
Builtins:
colors view 256-color table and ANSI-styles
history list history of commands
keymap manipulate keymaps
less file pager
nano edit files
setopt set options
setvar set lineReader variable value
ttop display and update sorted information about threads
unsetopt unset options
widget manipulate widgets
PicocliCommands:
announcepeer Announce a service peer.
bootstrap Bootstrap from the node.
displaycache Display the cached routing table.
findnode Find node and show the node info if exists.
findpeer Find peer and show the candidate peers if exists.
findvalue Find value and show the value if exists.
id Display the ID of current node.
keygen Create keypair.
routingtable Display the routing tables.
stop Display the ID of current node.
storage Show the local data storage.
storevalue Store a value to the DHT.
id
The id command is used to display a node Id of current shell application running as a boson node.
Boson $ id
Boson id: BCmAbJXmp4ehiShXqQfghEXdq3H1wQVX6syTxT1N7Z56
Boson $
bootstrap
The bootstrap command is used to bootstrap this shell application to connect to the boson network. It would be possibly used on the first that have run it:
The keygen command is used to generate private/public key pairs for encryption or signature purposes. The private key for signing can be used to announce a service peer when deploying an Active Proxy service on a super node or a personal service to utilize the Active Proxy service on a native client application.
The findnode command is used to retrieve other or neighboring nodes with a given node ID over the boson network. This command internally utilizes the protocol find-node to look up the specific node across the entire network.
The storevalue is used to store a specific value over the boson network. The value can be retrieved later by using the command findvalue. This command internally utilizes the protocol store-value to propagate the value to be stored across the entire network.
Boson $ storevalue -m "hello-world"
Value 8mL3KYWP3xaqJpo7ECeB7C2kv1KCij4sdRfWRPbvRzaq stored.
findvalue
The findvalue command is used to retrieve the specific value information by a give value ID. This command internally utilizes the protocol find-value to lookup the value item across the entire network.
The announcepeer command is used to announce a peer information, such as a personal web service of your own. This command internally utilizes the protocol announce-peer to propagate the peer information across the entire network.
Boson $ announcepeer -k 58bb783307742a0e3158642a88f133332cac5a3ac440a87bcaa5382d4e3245ec3b28dd37661fe4f631f7602fd4d6644402c9da3585841e2746054eff33a296cf 12345
Peer 4ywCHfUYDevE78jcTSDD6yo1CnJzSeKsxR1nvY25g5gr announced with private key 58bb783307742a0e3158642a88f133332cac5a3ac440a87bcaa5382d4e3245ec3b28dd37661fe4f631f7602fd4d6644402c9da3585841e2746054eff33a296cf
findpeer
The findpeer command is used to retrieve a list of peer information with a given peer ID. This command internally utilizes the protocol find-peer to lookup all peers across the entire network as much as possible. Here is an example to retrieve all boson nodes that provides the Active Proxy service with a given peer ID.
There are more commands not mentioned above that would be helpful for retrieving additional internal state or information of the current shell as a boson node.
stop
The stop command is used to exit from this shell command application.
Boson $ stop
Boson node stopped
A native shell command implemented in C/C++
Below is a serial of commands to build the shell command application for the Boson Native repository. This process is the same as building a native launcher running as the Active Proxy client:
$ git clone git@github.com:bosonnetwork/Boson.Native photon
$ cd photon/build && mkdir prod
$ cmake -DCMAKE_INSTALL_PREFIX=dist ../..
$ make -jN
$ make install
$ ./dist/bin/boson-shell -c YOUR-CONFIG-PATH/default.conf
Under the directory dist/bin of your building environment, a binary named boson-shell is generated, and the user can run this executable with the command to enter the interactive console:
The commands supported on the native shell are very similar to the shell of the Java implementation. We encourage users to also experience this shell application to get more internal state or information for the native node.