1 # XDS - X(cross) Development System Agent
3 XDS-agent is an agent that should run on your local host when you use XDS.
5 This agent takes care, among others, of starting [Syncthing](https://syncthing.net/)
6 tool to synchronize your project files from your local host to XDS build server
7 machine or container (where `xds-server` is running).
9 > **SEE ALSO**: [xds-server](https://github.com/iotbzh/xds-server), a web server
10 used to remotely cross build applications.
14 First you need to download `xds-agent` tarballs from xds dashboard by clicking
15 on download icon ![download icon](./resources/images/download_icon.jpg) of
18 > **NOTE** : you can also download released tarballs from github [releases page](https://github.com/iotbzh/xds-agent/releases).
20 Then unzip this tarball any where into your local disk.
24 xds-agent configuration is driven by a JSON config file (named `agent-config.json`).
25 The tarball mentioned in previous section includes this file with default settings.
27 Here is the logic to determine which `agent-config.json` file will be used:
28 1. from command line option: `--config myConfig.json`
29 2. `$HOME/.xds/agent-config.json` file
30 3. `<current dir>/agent-config.json` file
31 4. `<xds-agent executable dir>/agent-config.json` file
33 Supported fields in configuration file are (all fields are optional and listed
34 values are the default values):
37 "httpPort": "8010", # http port of agent REST interface
38 "logsDir": "/tmp/logs", # directory to store logs (eg. syncthing output)
40 "binDir": ".", # syncthing binaries directory (default: executable directory)
41 "home": "${HOME}/.xds/syncthing-config", # syncthing home directory (usually .../syncthing-config)
42 "gui-address": "http://localhost:8384", # syncthing gui url (default http://localhost:8384)
43 "gui-apikey": "123456789", # syncthing api-key to use (default auto-generated)
48 >**NOTE:** environment variables are supported by using `${MY_VAR}` syntax.
52 Simply to start `xds-agent` executable
57 >**NOTE** if need be, you can increase log level by setting option
58 `--log <level>`, supported *level* are: panic, fatal, error, warn, info, debug.
60 You can now use XDS dashboard and check that connection with `xds-agent` is up.
61 (see also [xds-server README](https://github.com/iotbzh/xds-server/blob/master/README.md#xds-dashboard))
64 ## Build xds-agent from scratch
68 - Install and setup [Go](https://golang.org/doc/install) version 1.8 or
69 higher to compile this tool.
73 Clone this repo into your `$GOPATH/src/github.com/iotbzh` and use delivered Makefile:
75 mkdir -p $GOPATH/src/github.com/iotbzh
76 cd $GOPATH/src/github.com/iotbzh
77 git clone https://github.com/iotbzh/xds-agent.git
82 And to install xds-agent (by default in `/usr/local/bin`):
87 >**NOTE:** Used `DESTDIR` to specify another install directory
89 >make install DESTDIR=$HOME/opt/xds-agent
93 For example on a Linux machine to cross-build for Windows, just execute: