Latest revision as of 19:54, 31 October 2022
These instructions describe how to create and join broadcast channels and send and receive messages over them using the cli-client binary. The source can be found in the cli-client repository.
First, download the correct binary for your system and open up your terminal to the downloaded directory.
Mac
Open or quit Terminal on Mac.
Change to your downloads directory using the command:
Terminal
$ cd ~/Downloads/
Run these commands: to launch the binary.
Terminal
$ xattr -c cli-client.darwin64
$ chmod +x cli-client.darwin64
Windows
How to Open the Command Prompt in Windows.
Change to your downloads directory using the command:
Terminal
> cd C:\Users\%USERNAME%\Downloads
Joining a Channel
Get an .xxchan file. Make sure to download it to the same directory where you downloaded the binary.
Run the following command to join the channel with your chosen username.
Terminal
$ ./cli-client broadcast --load -o yourChannel.xxchan -u <your username>
Creating a Channel
To create a channel, choose a name and description, and run the following command.
Terminal
$ ./cli-client broadcast --new -o myChan.xxchan -n "Channel Name" -d "Channel Description"
This will output your new channel info file that you can send to users to join your channel. It will also output an RSA private key PEM file that you can use to send admin messages on the channel
Sending Admin Messages
To send an admin message, you need the RSA private key PEM file, which was generated when the channel was created. Once you have this file, run the following command:
Terminal
$ ./cli-client broadcast --load -o myChan.xxchan -a "This is an admin message."
If you are running the cli-client UI in a separate window, you must run the command with a different session file defined with the -s
flag.
General Usage
Terminal
Create or join broadcast channels.
Usage:
cli-client broadcast {--new | --load} -o file [-n name -d description | -u username] [flags]
Flags:
-a, --admin string Sends the given message as an admin. Either an RSA private key PEM file exists in the default location or one must be specified with the "key" flag.
-d, --description string Description of the channel.
-h, --help help for broadcast
-k, --key string Location to save/load the RSA private key PEM file. Uses the name of the channel if no path is supplied.
--load Joins an existing broadcast channel.
-n, --name string The name of the channel.
--new Creates a new broadcast channel with the specified name and description.
-o, --open string Location to output/open channel information file. Prints to stdout if no path is supplied.
-u, --username string Join the channel with this username.
Global Flags:
-v, --logLevel int Verbosity level for log printing (2+ = Trace, 1 = Debug, 0 = Info).
-l, --logPath string File path to save log file to. (default "cli-client.log")
--ndf string Path to the network definition JSON file. By default, the prepacked NDF is used.
-p, --password string Password to the session file.
-s, --session string Sets the initial storage directory for client session data. (default "session")
--waitTimeout duration Duration to wait for messages to arrive. (default 15s)