Skip to content
Snippets Groups Projects
README.md 21.06 KiB

xx network Client

Repository | Go Doc | Examples

The client is a library and related command-line tool that facilitates making full-featured xx clients for all platforms. It interfaces with the cMix system, enabling access to all xx network messaging features, including end-to-end encryption and metadata protection.

This repository contains everything necessary to implement the xx network messaging features. In addition, it also contains features to extend the base messaging protocols.

The command-line tool accompanying the client library can be built for any platform supported by Go. The libraries are built for iOS and Android using gomobile.

For library writers, the client requires a writable folder to store data, functions for receiving and approving requests for creating secure end-to-end messaging channels, discovering users, and receiving different types of messages.

The client is open-source software released under the simplified BSD License.

Command Line Usage

The command-line tool is intended for testing xx network functionality and not for regular user use.

These instructions assume that you have Go 1.17.X installed and GCC installed for cgo (such as build-essential on Debian or Ubuntu).

Compilation steps:

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

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

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

# Windows 32-bit binary
$ GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o client.win32 main.go

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

Fetching an NDF

All actions performed with the client require a current network definition file (NDF). The NDF is downloadable from the command line or via an access point in the Client API.

Use the getndf command to fetch the NDF via the command line. getndf enables command-line users to poll the NDF from a network gateway without any pre-established client connection.

First, you'll want to download an SSL certificate:

# Assumes you are running a gateway locally
$ openssl s_client -showcerts -connect localhost:8440 < /dev/null 2>&1 | openssl x509 -outform PEM > certfile.pem

Now you can fetch the NDF.

# Example usage for gateways, assumes you are running a gateway locally
$ ./client getndf --gwhost localhost:8440 --cert certfile.pem | jq . > ndf.json

You can also download an NDF directly for different environments by using the --env flag.