Returns information about the service instance, in JSON format:
- service version
- the supported algorithm (always
rx/0
) - the maximum number of parallel requests the service can support
- the current RandomX seed (in hex format)
- the total number of hashes the service has calculated
curl http://localhost:39093/info
{
"randomx_service": "v1.0.1",
"algorithm": "rx/0",
"threads": 2,
"seed": "74657374206b657920303030",
"hashes": 1
}
Reinitializes the RandomX cache and dataset with the provided seed value. The seed is extracted from the request body based on the Content-Type
header.
This request is exclusive - it will block until all preceding requests have completed and all subsequent requests to the service will be paused until the reseeding process is complete. This ensures that all hashes are always calculated with a well-defined seed value.
- the POST body is interpreted as a binary literal
- the POST body is interpreted as a base16 (hex) encoded value
- the request was successful; all subsequent hashes will be calculated with the new seed
- the request body is malformed
- the provided seed value is larger than 60 bytes
- the
Content-Type
header is missing or has an unsupported value
curl -X POST http://localhost:39093/seed -H "Content-Type: application/x.randomx+bin" -d "test key 000"
Calculates a RandomX hash value of the provided input. The input is extracted from the request body based on the Content-Type
header.
- the POST body is interpreted as a binary literal
- the POST body is interpreted as a base16 (hex) encoded value
- the hash will be provided in binary format
- this header is optional
- sets the RandomX seed required for this hash to be valid
- the seed value must be in base16 (hex) format
- this header is optional
- it is recommended to provide this header to avoid invalid hashes caused by reseeding
- the request was successful; the response body contains the hash value, encoded as a base16 (hex) string (64 characters)
- if the
Accept
header was set toapplication/x.randomx+bin
, the hash is provided as a binary value (32 bytes)
- the request body is malformed
- the RandomX cache and dataset have not been initialized (the
/seed
method must be called first)
- the POST body is larger than 20000 bytes
- the
Content-Type
header is missing or has an unsupported value
- the
RandomX-Seed
header was provided and it doesn't match the current seed value
curl -X POST http://localhost:39093/hash -H "Content-Type: application/x.randomx+bin" -d "This is a test"
639183aae1bf4c9a35884cb46b09cad9175f04efd7684e7262a0ac1c2f0b4e3f
Calculates up to 256 RandomX hashes at once. The list of input values is provided in the request body and interpreted based on the Content-Type
header.
- the POST body is interpreted as a binary sequence of length-prefixed inputs; the length of each input may not exceed 127 bytes (the length prefix is a single byte)
- the POST body is interpreted as a list of base16 (hex) encoded inputs separated by a single space character
- the hashes will be provided in binary format
- this header is optional
- sets the RandomX seed required for this batch of hashes to be valid
- the seed value must be in base16 (hex) format
- this header is optional
- it is recommended to provide this header to avoid invalid hashes caused by reseeding
- the request was successful; the response body contains the hashes of the requested inputs
- by default, the hashes are provided in hex format (64 characters) separated by a single space character
- if the
Accept
header was set toapplication/x.randomx.batch+bin
, the hashes are provided in binary length-prefixed format (each hash is 32 bytes, so the prefix is0x20
, which is conincidentally also a space character)
- the request body is empty or malformed
- the RandomX cache and dataset have not been initialized (the
/seed
method must be called first)
- the POST body is larger than 20000 bytes or the batch contains more than 256 inputs
- the
Content-Type
header is missing or has an unsupported value
- the
RandomX-Seed
header was provided and it doesn't match the current seed value
curl -X POST http://localhost:39093/batch -H "Content-Type: application/x.randomx.batch+hex" -d "74657374203031 74657374203032 74657374203033 74657374203034"
59fd4ca6eec3c2e60f67cd7605568c2da650b5e2beea5c563a7d0383b42e26b1 3a630fc27de8badc347aac4400fcfb261b1b0e0e75b393f50b1d5dc2603d5bef 600062e17f1b5aa6a907a94b9f787f465ab8ad142fb08261fc6ea12befa1bb97 aacdfc478af56ce1574db920ff48b88c0ab531b6090ffb44ac03bccb4f0d0fa8