-
Notifications
You must be signed in to change notification settings - Fork 58
External Device IDs
Piotr Kosiński edited this page Apr 14, 2020
·
1 revision
Origin platform allows to store arbitrary amount of external IDs in the Origin device entity. Those IDs often refers to the external system IDs like real-time production data, external issuer id...
Exchange module requires the .env
variable ISSUER_ID set to the type of the external device id that is expected in the token data field. In the current implementation data field is created calling issuer contract function:
function encodeData(uint _from, uint _to, string memory _deviceId) public pure returns (bytes memory) {
return abi.encode(_from, _to, _deviceId);
}
Upon deposit transaction retrieval, exchange can identify the asset
based on those data fields and grant the transferred value to the sender.
-
.env
ISSUER_ID set toIssuer ID
-
demo-config.json
device section
"type": "CREATE_PRODUCING_DEVICE",
"data": {
"operationalSince": 1483228800,
"capacityInW": 70000,
"status": "Active",
"country": "Thailand",
"address": "Phuket",
"region": "South",
"province": "Phuket",
"zip": "01234",
"city": "Anytown",
"street": "Main Street",
"houseNumber": "9",
"gpsLatitude": "15.1739",
"gpsLongitude": "101.4928",
"timezone": "Asia/Bangkok",
"deviceType": "Solar;Photovoltaic;Roof mounted",
"otherGreenAttributes": "N.A.",
"typeOfPublicSupport": "N.A",
"facilityName": "Solar Facility A",
"user": {
"email": "[email protected]",
"password": "test"
},
"externalDeviceIds": [
{
"id": "ABQ123-2",
"type": "Issuer ID"
}
]
}
}