QuickStart
In this QuickStart Guide we give a shortened overview on how to setup a Tributech Agent with a Simulated Source and connect it to a Tributech Node to display the random generated data. For a more detailed description on how to setup the Tributech Agent visit Agent Integration.
Requirements
In Order to link a Tributech Agent to a Tributech node we need the following:
- Access to an existing Tributech Node
- Access to an environment with Docker Compose, which meets the Tributech Agent Requirements
Docker-Compose Up
We start by setting up the docker-compose environment for the Tributech Agent and Tributech Simulated Source as follows:
Authenticate docker to retrieve the relevant docker images from the private Tributech Docker Registry.
terminalecho <Client Secret> | docker login --username <Client ID> --password-stdin <Endpoint>
Setup the docker environment by creating a
.env
file with the following content and replace the placeholder values with your values:.envAGENT_TAG=3.6.1
AGENT_ID=<Unique-Agent-GUID>
SOURCE_TAG=3.6.0We will use the
AGENT_ID
00000000-0000-0000-0000-000000000007
in our example.Download the file
docker-compose.yml
and save it in the same folder containing the.env
file.docker-compose.ymlversion: "3.6"
services:
source-simulated:
image: ${DOCKER_REGISTRY-tributech.azurecr.io/}tributech-source-simulated:${SOURCE_TAG:-latest}
depends_on:
- mosquitto-server-simulated
- tributech-agent-simulated
environment:
- MqttOptions__MQTTHost=mosquitto-server-simulated
- Logging__LogLevel__Default=Debug
networks:
- simulated-net
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"
tributech-agent-simulated:
image: ${DOCKER_REGISTRY-tributech.azurecr.io/}tributech-agent:${AGENT_TAG:-latest}
depends_on:
- mosquitto-server-simulated
environment:
- Logging__LogLevel__Default=Debug
- Logging__Console__FormatterName=simple
- MqttOptions__MQTTHost=mosquitto-server-simulated
- EdgeDeviceOptions__AgentID=${AGENT_ID:?"The variable AGENT_ID needs to be configured in the .env file."}
ports:
- "5000:80"
networks:
- simulated-net
volumes:
- ./volumes/simulated/agent/:/app/data # volume mapping for permanent storage of keys and datatwin file
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"
mosquitto-server-simulated:
image: eclipse-mosquitto:${MQTT_TAG:-1.6}
networks:
- simulated-net
# ports:
# - '1883:1883' # MQTT
# - "127.0.0.1:9001:9001" # web-socket
restart: unless-stopped
networks:
simulated-net:Startup the environment
terminaldocker-compose up -d
Validate that all containers are running. The output should return that every container is in the state
Up
terminaldocker-compose ps
Link Agent
After starting the Tributech Agent we need to link the Agent to a Tributech Node in order to receive data. In the agent overview we can click LINK NEW AGENT to initialize this process.
Our prepared docker-compose.yml from the previous step exposes the port 5000
of the Agent to interact with the Tributech Node.
After pressing connect we can see the AGENT_ID
00000000-0000-0000-0000-000000000007
we previously defined in the .env
file.
Now we can proceed in the linking process by clicking Link/Relink Agent.
After a successfully completed linking process we will add a Tributech Simulated Source. If you would prefer another type of source you can now visit the Tributech Agent Sources overview.
Source Configuration
The previous steps established the communication between an Tributech Agent and a Tributech Node. Next we will setup a Tributech Source to provide data for the Tributech Agent. The Tributech agent will then be used to send the data to the Tributech Node. In the following section we complete our Tributech Agent QuickStart Setup by configuring a simple double stream for the Tributech Simulated Source (the Agent Name depends on the .env
file AGENT_ID
value defined in the previous section).
Next we need to configure the Agent to receive data for the Tributech Simulated Source we defined in the docker-compose setup:
We have prepared a Simulated Source configuration containing a double data stream, save the following TwinConfiguration Template File locally and import it in the Agent Configuration:
After successfully importing the TwinConfiguration Template File
click the APPLY CONFIGURATION
Button in the top right corner to persist the changes.
We can now select the Simulated Stream of our newly configured QuickStart Simulated Source
Agent
The Stream generates a new data point between 1 and 10 every second.
Verify
In order to detect data tampering we provide the possibility to audit each stream proofs individually. We provide the two possibilities to view the audit results:
A Graph view, which displays pending validation in grey, successful validations in green and failed in red.
A Table view, which includes a list of all proofs. For each proof the validation can be retriggered with a button click or display the history of validations by selecting a table entry.
This completes the QuickStart, for a more detailed guide and information about the audito process visit Tributech Agent Integration. For more information on how to add other types of Tributech Sources visit Source Integration.