cosmos / cosmos

Internet of Blockchains ⚛

Home Page:https://cosmos.network

Repository from Github https://github.comcosmos/cosmosRepository from Github https://github.comcosmos/cosmos

Cannot parse disfix JSON wrapper RPC server

RiccardoM opened this issue · comments

Hello everyone.

First of all thank you guys for everything you've done so far. You've created a frameworks that allows us to create blockchain applications without worrying of a lot of things.

Second of all, I've created a Cosmos application following the SDK Application tutorial. I've been able to set everything up, and after a few try also to implement some new features in order to create a new project with different features.

After performing some operations with the CLI, I now need to perform these operations using the REST APIs. In particular, I'm interested into broadcasting transactions using the RPC.

I've found the documentation of the APIs here: Cosmos RPC, but I run into a problem.

Request

Url

curl -k -d "@tx.json" -X POST "http://localhost:1317/tx/broadcast" --ouput response.json

Body

{
  "tx": {
    "msg": [
      "string"
    ],
    "fee": {
      "gas": "string",
      "amount": [
        {
          "denom": "steak",
          "amount": "50"
        }
      ]
    },
    "memo": "string",
    "signature": {
      "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=",
      "pub_key": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH"
      },
      "account_number": "0",
      "sequence": "0"
    }
  }
}

This body is taken from the documentation's examples.

Response

{
  "message": "cannot parse disfix JSON wrapper: json: cannot unmarshal string into Go value of type amino.disfixWrapper"
}

The GET APIs seem to work properly, but the POST one (regarding the transactions) seem to have this problem.

How can I fix this?

Thank you very much in advance for any help.