Extend API with functions required in Stratum #30

Merged
zxq9 merged 1 commits from extend_api into master 2019-04-12 17:31:09 +09:00
zxq9 commented 2019-04-11 23:54:15 +09:00 (Migrated from gitlab.com)

Created by: jur0

The aeminer_pow_cuckoo:generate/5 has the Data parameter, which is a serialized header binary of size 364 bytes, which is hashed to 64 bytes and then used as the input of the miner itself. This is ok if the miner and the ae node are on the same machine.

However, when Stratum notifies workers about a new job, it needs to send the Data part and its size should be limited. It's preferable to send 64 bytes, so there are 2 new functions in the API:

  • hash_data/1 - converts 364 bytes of data to 64 bytes
  • generate_from_hash/5 - just like generate/5, but doesn't convert its input Data to 64 bytes, it expects the 64 bytes input
*Created by: jur0* The `aeminer_pow_cuckoo:generate/5` has the `Data` parameter, which is a serialized header binary of size 364 bytes, which is hashed to 64 bytes and then used as the input of the miner itself. This is ok if the miner and the ae node are on the same machine. However, when Stratum notifies workers about a new job, it needs to send the `Data` part and its size should be limited. It's preferable to send 64 bytes, so there are 2 new functions in the API: * `hash_data/1` - converts 364 bytes of data to 64 bytes * `generate_from_hash/5` - just like `generate/5`, but doesn't convert its input `Data` to 64 bytes, it expects the 64 bytes input
zxq9 commented 2019-04-12 17:28:46 +09:00 (Migrated from gitlab.com)

Created by: skkw

Review: Approved

*Created by: skkw* **Review:** Approved
zxq9 commented 2019-04-12 17:30:06 +09:00 (Migrated from gitlab.com)

Created by: sennui

Review: Approved

*Created by: sennui* **Review:** Approved
zxq9 commented 2019-04-12 17:31:09 +09:00 (Migrated from gitlab.com)

Merged by: jur0 at 2019-04-12 08:31:09 UTC

*Merged by: jur0 at 2019-04-12 08:31:09 UTC*
Sign in to join this conversation.
No description provided.