This repository contains simple echo provider and consumer as an example for using Arrowhead Framework.
It is designed to use testcloud2 configuration from the core-java-spring repository. Therefore, it should be much easier to test this locally, as all required certificates are already created.
The reason for using testcloud2 instead of testcloud1 is, that the latter one had some naming issues inside the certificates.
In addition, because of #202 underscores are not supported in Arrowhead Framework 4.4.0+ (not supported in DNS/CN). To avoid issues we won't use even dashes, because who knows.
This version requires Python 3 with only one additional package:
python3 -m pip install requests-pkcs12TODO: Use already generated certificates to make this even easier.
At first, you have to download the CertificateGeneration submodule. Note: If you are familiar with different way for generating the certificates, feel free to use it instead.
git submodule update --init ./CertificateGenerationwget -O ./CertificateGeneration/master.crt https://raw.githubusercontent.com/eclipse-arrowhead/core-java-spring/master/certificates/master.crt
wget -O ./CertificateGeneration/master.p12 https://raw.githubusercontent.com/eclipse-arrowhead/core-java-spring/master/certificates/master.p12mkdir ./certificates
wget -O ./certificates/testcloud2.crt https://raw.githubusercontent.com/eclipse-arrowhead/core-java-spring/master/certificates/testcloud2/testcloud2.crt
wget -O ./certificates/testcloud2.p12 https://raw.githubusercontent.com/eclipse-arrowhead/core-java-spring/master/certificates/testcloud2/testcloud2.p12PASSWORD=123456 FOLDER="../certificates/" DOMAIN="aitia" CLOUD="testcloud2" bash ./CertificateGeneration/generate.sh echoserver echoclientTo set up all required data in the Arrowhead database, at first run:
python3 echo-setup.pyAlternatively, you can launch both parts of the service and receive:
Interface ID: %d
Provider ID: %d
Service ID: %d
Consumer ID: %dAnd use echo-auth.py to add an intracloud authorization rule to the Arrowhead database:
python3 echo-auth.py -i %d -p %d -s %d -c %dThis has to be run only one (on subsequent runs it does nothing). Then, proceed with relaunching the echo-client.
In two separate terminals run both:
python3 echo-server.pypython3 echo-client.py