Skip to content

Commit 710789a

Browse files
Merge pull request #2208 from filecoin-project/add/api-docs-automation
Adds automation for JSON-RPC docs content creation.
2 parents 56234cc + 1e20254 commit 710789a

26 files changed

+2250
-1858
lines changed

.gitbook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ redirects:
168168
reference/general: reference/general/README.md
169169
reference/general/overview: reference/general/README.md
170170
reference/glossary: reference/general/glossary.md
171+
reference/json-rpc/beacon: reference/general/README.md
171172
reference/json-rpc/introduction: reference/json-rpc/README.md
172173
reference/reference/glossary: reference/general/glossary.md
173174
reference/reference/overview: reference/general/README.md

SUMMARY.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
* [Filecoin.sol](reference/built-in-actors/filecoin.sol.md)
154154
* [JSON-RPC](reference/json-rpc/README.md)
155155
* [Auth](reference/json-rpc/auth.md)
156-
* [Beacon](reference/json-rpc/beacon.md)
157156
* [Chain](reference/json-rpc/chain.md)
158157
* [Client](reference/json-rpc/client.md)
159158
* [Create](reference/json-rpc/create.md)
@@ -166,7 +165,11 @@
166165
* [Mpool](reference/json-rpc/mpool.md)
167166
* [Msig](reference/json-rpc/msig.md)
168167
* [Net](reference/json-rpc/net.md)
168+
* [Node](reference/json-rpc/node.md)
169169
* [Paych](reference/json-rpc/paych.md)
170+
* [Raft](reference/json-rpc/raft.md)
171+
* [Start](reference/json-rpc/start.md)
170172
* [State](reference/json-rpc/state.md)
171173
* [Sync](reference/json-rpc/sync.md)
172174
* [Wallet](reference/json-rpc/wallet.md)
175+
* [Web3](reference/json-rpc/web3.md)

reference/json-rpc/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,23 @@ curl --location --request POST '<NODE_ADDRESS>' \
2525

2626
1. In a terminal window, use Curl to request the current chain head from a public [Glif](https://glif.io) node.\
2727

28+
- ```shell
29+
curl -X POST 'https://api.node.glif.io' \
30+
-H 'Content-Type: application/json' \
31+
--data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainHead","params":[]}'
32+
```
2833

29-
* ```shell
30-
curl -X POST 'https://api.node.glif.io' \
31-
-H 'Content-Type: application/json' \
32-
--data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainHead","params":[]}'
33-
```
34+
```shell
35+
{"jsonrpc":"2.0","result":{"Cids":[{"/":"bafy2bzaceayoigaf3v5muqmknpjfkguse43jp4t2zxhpmykhqynqhkdgpgybc"},{"/":"bafy2bzacecnrtzlhn6h75gm7tozhzuw77plvdhniwzfj7wgmyuju6wn573h22"},{"/":"bafy2bzacecygiaxfsqv7ecb2gvodzh74eret3pchwe5e4j5a3mzlwasvndi6i"},{"/":"bafy2bzacebe477tdmijfse4je2g63gnnkdgzj3ftq6zbygd7toszkrsjts6uu"},{"/":"bafy2bzacedoe6hcxy2cgqzbg4p7qolbd5imbjpjnz2tj4n7o3kw2md4uv2ttq"},{"/":"bafy2bzacec7wbqvskwvolireljmufszdu5nk37yyg4qtxgnrwbyipgoenmhc6"},{"/":"bafy2bzaceahxdiauteywlbjnwj3ntr72qcbamtq3nbvjzyn5wruithpyqyxbm"}],"Blocks":[{"Miner":"f0693008","Ticket":{"VRFProof":"uLR0LHfNBAfQzyYUVBiIEXzyblPv3yPIEsJQGTpaAvO1ZriPZ7wC2IFpw7mrz1RvDQEfsgRXGxb6APTRvrPiFEAe35RFNLKC9SYb64PNcDYwGY4de5LdlHfyUv+Ovwg5"}...
36+
```
3437
35-
```shell
36-
{"jsonrpc":"2.0","result":{"Cids":[{"/":"bafy2bzaceayoigaf3v5muqmknpjfkguse43jp4t2zxhpmykhqynqhkdgpgybc"},{"/":"bafy2bzacecnrtzlhn6h75gm7tozhzuw77plvdhniwzfj7wgmyuju6wn573h22"},{"/":"bafy2bzacecygiaxfsqv7ecb2gvodzh74eret3pchwe5e4j5a3mzlwasvndi6i"},{"/":"bafy2bzacebe477tdmijfse4je2g63gnnkdgzj3ftq6zbygd7toszkrsjts6uu"},{"/":"bafy2bzacedoe6hcxy2cgqzbg4p7qolbd5imbjpjnz2tj4n7o3kw2md4uv2ttq"},{"/":"bafy2bzacec7wbqvskwvolireljmufszdu5nk37yyg4qtxgnrwbyipgoenmhc6"},{"/":"bafy2bzaceahxdiauteywlbjnwj3ntr72qcbamtq3nbvjzyn5wruithpyqyxbm"}],"Blocks":[{"Miner":"f0693008","Ticket":{"VRFProof":"uLR0LHfNBAfQzyYUVBiIEXzyblPv3yPIEsJQGTpaAvO1ZriPZ7wC2IFpw7mrz1RvDQEfsgRXGxb6APTRvrPiFEAe35RFNLKC9SYb64PNcDYwGY4de5LdlHfyUv+Ovwg5"}...
37-
```
38+
The ChainHead endpoint doesn’t require any input parameters, so we’ve left `params` an empty array `[]`.
3839
39-
The ChainHead endpoint doesn’t require any input parameters, so we’ve left `params` an empty array `[]`.
40-
* The above command will output a large chunk of JSON data. You can use [JSON processor JQ](https://stedolan.github.io/jq/) to _prettify_ the output:
40+
- The above command will output a large chunk of JSON data. You can use [JSON processor JQ](https://stedolan.github.io/jq/) to _prettify_ the output:
4141
42-
```
43-
```
42+
```
43+
44+
```
4445
4546
1. ```shell
4647
curl -X POST 'https://api.node.glif.io' \
@@ -72,16 +73,16 @@ curl --location --request POST '<NODE_ADDRESS>' \
7273
7374
Each method has specific permissions that must be met before you can receive a response from a Filecoin node. Methods with the `read` permission can be called by anyone at anytime, without the need for a token. All other permissions require you to send an authentication along with you request.
7475
75-
* `read`: Read node state, no private data.
76-
* `write`: Write to local store / chain, and read permissions.
77-
* `sign`: Use private keys stored in wallet for signing, read and write permissions.
78-
* `admin`: Manage permissions, read, write, and sign permissions.
76+
- `read`: Read node state, no private data.
77+
- `write`: Write to local store / chain, and read permissions.
78+
- `sign`: Use private keys stored in wallet for signing, read and write permissions.
79+
- `admin`: Manage permissions, read, write, and sign permissions.
7980
8081
## Authentication
8182
8283
Each node implementation has different ways to generate and manage authentication tokens. Take a look at your node’s specific documentation:
8384
84-
* [Lotus](https://lotus.filecoin.io)
85-
* [Venus](https://venus.filecoin.io)
85+
- [Lotus](https://lotus.filecoin.io)
86+
- [Venus](https://venus.filecoin.io)
8687
8788
If you are using a node provider service like [Glif](https://glif.io) or [Chain.love](https://chain.love), take a look at your providers documentation to find out how to manage authentication tokens.

reference/json-rpc/auth.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ Perms: admin
66

77
Inputs:
88

9-
109
```json
11-
[
12-
[
13-
"write"
14-
]
15-
]
10+
[["write"]]
1611
```
1712

1813
Response: `"Ynl0ZSBhcnJheQ=="`
@@ -23,18 +18,12 @@ Perms: read
2318

2419
Inputs:
2520

26-
2721
```json
28-
[
29-
"string value"
30-
]
22+
["string value"]
3123
```
3224

3325
Response:
3426

35-
3627
```json
37-
[
38-
"write"
39-
]
28+
["write"]
4029
```

reference/json-rpc/beacon.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)