torch-agent/example/README.md

53 lines
1.1 KiB
Markdown
Raw Normal View History

2020-10-06 13:14:57 +00:00
# TORch Agent Example
The example creates a Vagrant machine configured with TORch Agent
2020-10-06 13:16:27 +00:00
## Running the Example
2020-10-06 13:14:57 +00:00
2020-10-06 13:16:27 +00:00
#### Install dependencies
2020-10-06 13:14:57 +00:00
2020-10-06 13:32:02 +00:00
* [Install Docker](https://docs.docker.com/engine/install/ubuntu/)
* Install `mosquitto_sub`
2020-10-06 13:14:57 +00:00
* `apt install mosquitto-clients`
2020-10-06 13:16:27 +00:00
#### Run the Broker
2020-10-06 13:14:57 +00:00
Add the following line to your `/etc/hosts` file:
```
127.0.0.1 mqtt.example.com
```
Run the broker in a terminal window:
```bash
./run-broker.sh
```
2020-10-06 13:16:27 +00:00
#### Run the Subscriber
2020-10-06 13:14:57 +00:00
In a separate terminal window, run the subscriber:
```bash
./run-subscriber.sh
```
2020-10-06 13:16:27 +00:00
#### Run TORch Agent in Vagrant
2020-10-06 13:14:57 +00:00
2020-10-07 11:17:08 +00:00
[Build](..) the latest source into a Debian package and copy it to `example/`
```bash
cd ..
./make-pkg.sh john@doe.com
2020-10-08 17:48:16 +00:00
cp -f build/torch-agent_0.0.2-1_all.deb example/
2020-10-07 11:17:08 +00:00
cd example
```
2020-10-06 13:14:57 +00:00
Run the Vagrant box in a third terminal window:
```bash
vagrant up
```
You should see that the broker received a connection from the Vagrant box at boot up and the subscriber received the onion hostname. You can use a local `tor` proxy to connect to the vagrant box using SSH and the onion hostname.