This simple demo application echos back the same message sent from the client to the worker.
The command line client, echo_client.py
sends a message to the worker,
which echos back the same message back to the client.
For command line options, type ./echo_client.py -h
from the
client
directory.
To use:
-
If needed, update the Ethereum account and direct registry contract information in
docker/Dockerfile.tcf-dev
andexamples/common/python/connectors/tcf_connector.toml
-
Follow instructions in the "Docker-based Build and Execution" section of the build document through step 5 (activating a virtual environment)
-
Terminal 1 is running the Avalon Enclave Manager and Listener with
docker-compose
. Terminal 2 is running the Docker container shell -
In Terminal 2 run
cd $TCF_HOME/examples/apps/echo/client
-
In Terminal 2, run
./echo_client.py -m "Hello world"
. Use the-h
option to see other available options -
You will see output showing the following:
- The client searches the registry for an "echo" worker
- The client sends a request to the worker
- The client waits for and receives a response in JSON format
- The decrypted response from the worker:
[13:27:37 INFO utility.utility] Decryption result at client - RESULT: Hello World
- The worker receipt in JSON format
- Messages sent and received are encrypted with the key specified in the JSON packet, then encoded in Base64.
-
In Terminal 1, press Ctrl-c to stop the Avalon Enclave Manager and Listener