ava-labs/avalanche-network-runner

Fix README based on devrel people comments

Closed this issue · 0 comments

From @cgcardona

I think there’s a bug in the ANR’s docs for the createsubnets command.
curl -X POST -k http://localhost:8081/v1/control/createsubnets -d '[{}]'
The HTTP Gods don’t like that array being passed in.

Another thing is we have a mismatch of variable name style in the keys. So for example, nearly everywhere we use camelCase. Such as /v1/control/addnode
{
"name": "{{node_name}}",
"execPath": "{{avalanchego_exec_path}}",
"logLevel": "{{log_level}}"
}
However in /v1/control/removesnapshot it’s underscore_case
{
"snapshot_name":"node5"
}

mix of camelCase and underscore_case. Check out the body for /v1/control/start. It has both
{
"execPath": "{{avalanchego_exec_path}}",
"numNodes": 5,
"logLevel": "{{log_level}}",
"pluginDir": "{{avalanchego_plugin_path}}",
"blockchainSpecs": [
{
"vm_name": "{{vm_name}}",
"genesis": "{{vm_config_path}}"
}
]
}

I see another bug in the README
curl -X POST -k http://localhost:8081/v1/control/elasticsubnets
Should be
curl -X POST -k http://localhost:8081/v1/control/transformelasticsubnets

Also, the /v1/control/transformelasticsubnets README passes in an array which fails. Have to just pass in a single object AFAICT.

Same error in the README for /v1/control/addpermissionlessvalidator. Passing in an array as the POST body
curl --location 'http://localhost:8081/v1/control/addpermissionlessvalidator'
--header 'Content-Type: application/json'
--data '[
{
"subnet_id": "'''p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz",
"node_name": "node5",
"staked_token_amount": 2000,
"asset_id": "Avalanche",
"start_time": "2023-05-25 21:00:00",
"stake_duration": 336
}
]'
Throws this error
{
"code": 3,
"message": "proto: syntax error (line 1:1): unexpected token [",
"details": []
}