SymboleoAC API is a secure and event-driven application layer that connects \SymboleoAC/ smart contracts with external cyber-physical components, including IoT sensors, a message broker, a CEP engine, and Hyperledger Fabric.
It supports secure communication, event publication and subscription, smart contract transaction invocation, and role-based notifications.
# Node version: v16.16.0
npm installBefore proceeding, ensure the generated smart contract is successfully deployed on Hyperledger Fabric.
For deployment instructions, refer to:
SymboleoAC-HyperledgerFabric-Test-Network
To enroll \SymboleoAC/ users and retrieve IoT rules for a specific case study (e.g., Meat Sale or Vaccine Procurement), use the EnrollRolesRetrieveIoTRules.js script.
- Open
EnrollRolesRetrieveIoTRules.jsand uncomment the parameters for the intended case study. - Run the script:
node EnrollRolesRetrieveIoTRules.jsTo enroll sensors for a specific case study:
- Open
EnrollSensors.js. - Update the JSON file name to match the file generated by the
retrieveIoTRules()function
(e.g.,rulesMeatSale0000.json,rulesVaccine0000.json). - Run the script:
node EnrollSensors.jsThe message broker (RabbitMQ) enrollment is performed once (not per instance).
node runEnrollRabbitMQ.jsThe Complex Event Processing (CEP) server enrollment is performed once (not per instance).
node enrollCEPServer.jsAfter completing all enrollment steps, you can run the full cycle execution from IoT sensors to smart contract execution through the CEP engine and message broker.
-
Open three different terminals.
-
Terminal 1 — Start Sensor Publisher
node secureSensorPublisher.js- Terminal 2 — Start CEP Engine
# Compile
javac -cp "esper-9.0.0/*:esper-9.0.0/dependencies/*" *.java
# Run
java -cp ".:esper-9.0.0/*:esper-9.0.0/dependencies/*" EsperBridge- Terminal 3 — Start Alert Subscriber
node alertSubscriber.js-
Ensure the message broker (RabbitMQ) is running and properly connected.
-
Monitor smart contract execution and notifications.
This setup enables real-time data flow from IoT devices through event processing and messaging layers to blockchain-based smart contract execution.
To run multi-instance execution, follow the same steps used for single-instance setup, but use the scripts that end with MultiInstaExperiment For Example:
Use:
node EnrollRolesRetrieveIoTRulesMultiInstaExperiment.js