Skip to content

Commit

Permalink
Api documentation fixes (mimblewimble#2646)
Browse files Browse the repository at this point in the history
* Fix the API documentation for Chain Validate (v1/chain/validate).  It was documented as a POST, but it is actually a GET request, which can be seen in its handler ChainValidationHandler
* Update the API V1 route list response to include the headers and merkleproof routes.  Also clarify that for the chain/outputs route you must specify either byids or byheight to select outputs.
  • Loading branch information
Agreene authored and i1skn committed Apr 2, 2019
1 parent 63b00f4 commit 680e434
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions api/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,19 @@ pub fn build_router(
) -> Result<Router, RouterError> {
let route_list = vec![
"get blocks".to_string(),
"get headers".to_string(),
"get chain".to_string(),
"post chain/compact".to_string(),
"post chain/validate".to_string(),
"get chain/outputs".to_string(),
"get chain/validate".to_string(),
"get chain/outputs/byids?id=xxx,yyy,zzz".to_string(),
"get chain/outputs/byheight?start_height=101&end_height=200".to_string(),
"get status".to_string(),
"get txhashset/roots".to_string(),
"get txhashset/lastoutputs?n=10".to_string(),
"get txhashset/lastrangeproofs".to_string(),
"get txhashset/lastkernels".to_string(),
"get txhashset/outputs?start_index=1&max=100".to_string(),
"get txhashset/merkleproof?n=1".to_string(),
"get pool".to_string(),
"post pool/push".to_string(),
"post peers/a.b.c.d:p/ban".to_string(),
Expand Down
8 changes: 4 additions & 4 deletions doc/api/node_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
1. [Chain Endpoint](#chain-endpoint)
1. [GET Chain](#get-chain)
1. [POST Chain Compact](#post-chain-compact)
1. [POST Chain Validate](#post-chain-validate)
1. [GET Chain Validate](#get-chain-validate)
1. [GET Chain Outputs by IDs](#get-chain-outputs-by-ids)
1. [GET Chain Outputs by Height](#get-chain-outputs-by-height)
1. [Status Endpoint](#status-endpoint)
Expand Down Expand Up @@ -282,7 +282,7 @@ Trigger a compaction of the chain state to regain storage space.
});
```

### POST Chain Validate
### GET Chain Validate

Trigger a validation of the chain state.

Expand All @@ -292,7 +292,7 @@ Trigger a validation of the chain state.

* **Method:**

`POST`
`GET`

* **URL Params**

Expand All @@ -316,7 +316,7 @@ Trigger a validation of the chain state.
$.ajax({
url: "/v1/chain/validate",
dataType: "json",
type : "POST",
type : "GET",
success : function(r) {
console.log(r);
}
Expand Down

0 comments on commit 680e434

Please sign in to comment.