Skip to content
Snippets Groups Projects
Select Git revision
  • f397108ee93d2f2272a04a4fe2eb84aa44c2af80
  • release default
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • master protected
  • XX-4688/DbEncoding
  • hotfix/update
  • @XX-4682/Files
  • hotfix/XX-4655
  • dev protected
  • project/HavenNotifications
  • XX-4602/SilentMessageType
  • jono/npmTest
  • wasmTest2
  • XX-4461/FileUpload
  • XX-4505/blockuser
  • XX-4441
  • Jakub/Emoji-CI-Test
  • testing/websockets
  • fastReg
  • fast-registration
  • NewHostPool
  • v0.3.22
  • v0.3.21
  • v0.3.20
  • v0.3.18
  • v0.3.17
  • v0.3.16
  • v0.3.15
  • v0.3.14
  • v0.3.13
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • 812b395df518ce096d01d5292596ca26f8fe92d9c4487ddfa515e190a51aa1a1
  • 76ba08e2dfa1798412a265404fa271840b52c035869111fce8e8cdb23a036a5a
41 results

wasm

CLI Client Repository

The cli-client repository provides a commandline interface for interacting with the client api on the xx network. Currently, it only supports the broadcast functionality.

Building

$ git clone https://gitlab.com/elixxir/cli-client.git cli-client
$ cd cli-client
$ go mod vendor
$ go mod tidy

# Linux 64-bit binary
$ GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o cli-client.linux64 main.go

# Windows 64-bit binary
GOOS=windows GOARCH=amd64 go build -ldflags '-w -s' -o cli-client.win64 main.go

# Mac OSX 64-bit binary (Intel)
$ GOOS=darwin GOARCH=amd64 go build -ldflags '-w -s' -o cli-client.darwin64 main.go

Commandline Usage

Broadcast Channels

Using the broadcast subcommand, you can create or join a broadcast channel. It demonstrates the use of broadcast channels to create a simple TUI chat client.

Creating a Channel

To create a broadcast channel, use the following command. -o sets the name of the channel file that will be shared with others to join your channel. It should end with the .xxchan prefix.

$ ./cli-client broadcast --new -o test.xxchan -n "<Channel Name>" -d "<Channel description>"

When creating a new channel a private RSA .pem file will be saved. This can be used to send an admin message as described in the next section.

Joining a Channel

To join a channel, use the following command. -o specified the channel file to open and -u specifies your chosen username.

$ ./cli-client broadcast --load -o test.xxchan -u <username> 

Sending an Admin Message

If you are the creator/admin of the channel or have the channels RSA private key, then you can send an admin message using the following command. -a specifies an admin message that will be sent and -k the private key location. If no key is specified, then it searches for the default private key file <Channel Name>-privateKey.pem.

$ ./cli-client broadcast --load -o test.xxchan -a "<Admin message>" -k privateKey.pem

More Help

For more help on broadcast flags, use the -h flag.

$ ./cli-client broadcast -h
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:
  -c, --config string          Path to YAML file with custom configuration..
  -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)