I want to do a post request sending a minimal block with data payload as explained in the Rest api.

But when i try

curl -X 'POST'   'https://api.testnet.shimmer.network/api/core/v2/blocks'   -H 'accept: application/json'   -H 'Content-Type: application/json'   -d '{
  "protocolVersion": 2,
  "payload": {
    "type": 5,                                                           
    "tag": "0x68656c6c6f20776f726c64",
    "data": "0x5370616d6d696e6720646174612e0a436f756e743a203037323935320a54696d657374616d703a20323032312d30322d31315431303a32333a34392b30313a30300a54697073656c656374696f6e3a203934c2b573"

I get the error

{"error":{"code":"400","message":"invalid parameter, error: failed to attach block: no parents given and node PoW is disabled: invalid block: code=400, message=invalid parameter"}}

My understanding of the error is that i need to send a full block with the parents and a proper nonce for the node to accept it. But then the Api explained here is not the same that the one used by the node.

If someone knows what i am doing wrong please let me know.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy