The API is kind of temporary. The FPGA core is only one step of the project and the API was defined in such way that the ICCFPGA-Core can be used after the 2nd milestone of the project.
Currently RS232 with JSON format is used and a fork of the iota.go library is provided. Propapbly a lot will change during the further progress of this project. It could (very well) be that UART is dropped and replaced by a faster SPI interface and instead of JSON a binary protocol will be used.
It always will return an json-dict with code 200 or 400 (similar to IOTA API) and duration.
Currently read-back of seeds is not implemented. Possibly it could be a good idea to implement encrypted read/writes similar to the communication with the Secure-Element in order to savely read back seeds. TODO 😇
Currently, a flag can be set to cache the seed read from the secure element for requests. This saves about 1-2s of time per request. The seeds are storded in the internal RAM.
*new:: debugRS232Output and debugRS232Output enables debugging-Output (not in json format!) on SWD or RS232
Tests the hardware acceleration. Type conversions (Bytes <-> Trytes and Bytes <-> Trits) and hashing (PoW, Curl, Keccak384, Troika) are tested and compared with unaccelerated functions or verified correct results.
Performas attachToTangle with Proof-of-Work. This function is quite restricted because of internal RAM. Only 8 TXs can be attached. Mostly it is better to use the doPow command and chain the transactions externally.