Issue with rosetta-cli and NetworkOptions

Hi!

I’m runnign rosetta-cli version v0.3.2 and I’m getting the following error:

$ rosetta-cli view:network
{
 "blockchain": "redacted",
 "network": "mainnet"
}
2020/07/23 18:10:51 error code used multiple times: unable to get network option

But when I ping my local running instance, I properly get the data (And the response is supposed to be ok as the web serer validates the schema):

$ echo '{ "network_identifier": { "blockchain": "redacted", "network": "mainnet" } }' | http post http://localhost:8080/network/options
HTTP/1.1 200 OK
Connection: keep-alive
Date: Thu, 23 Jul 2020 21:10:44 GMT
content-length: 689
content-type: application/json; charset=utf-8

{
    "allow": {
        "errors": [
            {
                "code": 400,
                "message": "Block not found",
                "retriable": false
            },
            {
                "code": 400,
                "message": "Network not found",
                "retriable": false
            },
            {
                "code": 400,
                "message": "Invalid blockchain",
                "retriable": false
            },
            {
                "code": 400,
                "message": "Networks not found",
                "retriable": false
            },
            {
                "code": 501,
                "message": "Not implemented",
                "retriable": false
            },
            {
                "code": 500,
                "message": "Topology file not found",
                "retriable": false
            },
            {
                "code": 400,
                "message": "Genesis block not found",
                "retriable": false
            }
        ],
        "historical_balance_lookup": true,
        "operation_statuses": [
            {
                "status": "success",
                "successful": true
            }
        ],
        "operation_types": [
            "transfer"
        ]
    },
    "version": {
        "metadata": {},
        "middleware_version": "0.0.1",
        "node_version": "1.0.2",
        "rosetta_version": "1.4.0"
    }
}

Thansk!

The error was that we were sending the same code for all the different errors :man_facepalming: … once we changed them to be different the problem has desapeared.

In Rosetta, Errors returned in the Allow object must have unique codes and messages. When returning an Error in your implementation, you should populate the details field with any request-specific context.

I read through the docs to find a section discussing this, however, could not find anything :cry: !! @matheusd made a PR to the spec to make sure this was abundantly clear (he had a similar question around the time you posted this):

1 Like