Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.84 KB

README.md

File metadata and controls

61 lines (46 loc) · 1.84 KB

toad_sp_command

Smart Plug controller component for the IoToad paltform

Development requirements

The development dependencies are listed in requirements_dev.txt and should be installed alongside requirements.txt.

There are two services that need to be started before running tests: MQTT and ETCD.

MQTT

The following shell command creates and runs a mosquitto container.

docker run \
--name=mosquittoc \
--publish 1883:1883 \
--network=host \
toke/mosquitto\
"

ETCD

Note: The ETCD database might need to be populated

Create a permanent storage folder:

mkdir -p $HOME/.var/lib

And run the ETCD docker container:

VOL_DIR="$HOME/.var/lib"
ETCD_ADDR="127.0.0.1"
ETCD_DIR="${VOL_DIR}/etcd"

docker run \
--name=etcdc \
--network=host \
--mount type=bind,src=${ETCD_DIR},dst=/etcd-data \
quay.io/coreos/etcd \
/usr/local/bin/etcd \
--data-dir=/etcd-data --name etcd_node \
--initial-advertise-peer-urls http://${ETCD_ADDR}:2380 --listen-peer-urls http://0.0.0.0:2380 \
--advertise-client-urls http://${ETCD_ADDR}:2379 --listen-client-urls http://0.0.0.0:2379 \
--initial-cluster etcd_node=http://${ETCD_ADDR}:2380 \
"