kosmos-industrie40 / kosmos-local-blockchain-connector

Lokale KOSMoS Komponente "Blockchain Connector"
2 stars 2 forks source link

Reduce BCC_Config.json ... #1

Open ondics opened 3 years ago

ondics commented 3 years ago

to values:

{
   "customerId": "ondics-8925-f7bfacb618a4",
   "prodData":{[
      {
        "machineId": ...
        "mqtt-topic":"kosmos/machine-data/<machineId>/Sensor/tbd/Update",
        "blockchain-endpoint":"http://kosmos-2017317103.eu-central-1.elb.amazonaws.com/api/machine/<machineId>/prodData",
        "mapping": "none"
     },{
       ...
     }
    ]}
}
ondics commented 3 years ago

customerId is passed in separate env variable. so BCC_config.json reduces to:

[
    {
        "machineId": "xxx",
        "mqtt-topic": "kosmos/machine-data/<machineId>/Sensor/tbd/Update",
        "blockchain-endpoint": "http://blockchain-api/api/machine/<machineId>/prodData",
        "mapping": "none"
    },{
        ...
    }
]
ondics commented 3 years ago

ok, even better if we extract the sensor-id also:

[
    {
        "machineId": "...",
        "sensorId": "...",
        "mqtt-topic": "kosmos/machine-data/<machineId>/Sensor/<sensorId>/Update",
        "blockchain-endpoint": "http://blockchain-api/api/machine/<machineId>/prodData",
        "mapping": "none"
    },{
        ...
    }
]