Skip to content

Commit d9cf039

Browse files
authored
feat: add API documentation following OpenAPI standard (#13)
* fix: update drand cli to v2 * chore: upgrade Docusaurus packages to 3.7 - Upgraded @docusaurus/core to the 3.7 - Upgraded @docusaurus/preset-classic to the 3.7 - Upgraded @docusaurus/module-type-aliases to 3.7 - Upgraded @docusaurus/tsconfig to 3.7 - Upgraded @docusaurus/types to 3.7 * feat: add API documentation following OpenAPI standard * docs: update OpenAPI documentation and configuration - Added missing API endpoints to the OpenAPI specification - Updated summaries to reflect the paths in the OpenAPI documentation - Ensured all API endpoints are documented in the drand-api.yaml file - Updated Docusaurus configuration to include the OpenAPI documentation * feat: added v2 api based on http-relay repo
1 parent 2d8c19b commit d9cf039

32 files changed

+4947
-476
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ $ yarn start
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

19+
#### Updating the api yaml file
20+
21+
After updating the `drand-api.yaml` file, you need to run the following command to update the api docs:
22+
23+
```
24+
yarn docusaurus gen-api-docs all
25+
```
26+
1927
### Build
2028

2129
```

docs/03_dev-guide/03-04-HTTP_API.md

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -56,81 +56,4 @@ As you can see, they are currently running various chains as explained below. We
5656

5757
Other testnet chains, such as our first "unchained" testnet (`7672797f548f3f4748ac4bf3352fc6c6b6468c9ad40ad456a397545c6e2df5bf`) or our first G1 based non-RFC compliant chain (`f3827d772c155f95a9fda8901ddd59591a082df5ac6efe3a479ddb1f5eeb202c`) may be deprecated in the future.
5858

59-
## **`/chains`**
60-
61-
Retrieves the *chain hash* of every running network a user can interact with. It returns a JSON object with the following structure:
62-
63-
```jsx
64-
[
65-
"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce",
66-
"859504eade86790ad09b2b3474d5e09d1718b549ef7107d7bbd18f5e221765ce",
67-
"8252d7db02664c1f6b20f40c6e8e138704d2acfeb6c5abcc14c77e3a842b2f84",
68-
"515e7366248ca37b1460d23b4f98493c246fbb02851f2a43a710c968a349f8d6"
69-
]
70-
```
71-
72-
## **`/{chain-hash}/info`**
73-
74-
Retrieves the randomness chain information. It returns a JSON object with the following structure:
75-
76-
```jsx
77-
{
78-
"public_key": "868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31",
79-
"period": 30,
80-
"genesis_time": 1595431050,
81-
"hash": "8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce",
82-
"groupHash": "176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a",
83-
"schemeID": "pedersen-bls-chained",
84-
"metadata": {
85-
"beaconID": "default"
86-
}
87-
}
88-
```
89-
90-
- `public_key` is the distributed public key of the drand group
91-
- `period` is the time in seconds between randomness beacon rounds
92-
- `genesis_time` is the time in seconds since the Unix Epoch that the group began generating randomness
93-
- `hash` is the *chain hash*, which uniquely identifies the drand chain. It is used as a root of trust for validation of the first round of randomness.
94-
- `groupHash` is the hash of a file containing the current set of nodes participating in the network. The group file is updated on every resharing.
95-
- `schemeID` is the name of the scheme this network uses. The scheme specifies the type of cryptography being used to generate the randomness beacons.
96-
- `metadata` contains some miscellaneous metadata about the network that is added to most packets during operation.
97-
98-
## **`/{chain-hash}/public/latest`**
99-
100-
Retrieves the latest round of randomness. It returns a JSON object with the following structure:
101-
102-
```jsx
103-
{
104-
"round": 367,
105-
"randomness": "3439d92d58e47d342131d446a3abe264396dd264717897af30525c98408c834f",
106-
"signature": "90957ebc0719f8bfb67640aff8ca219bf9f2c5240e60a8711c968d93370d38f87b38ed234a8c63863eb81f234efce55b047478848c0de025527b3d3476dfe860632c1b799550de50a6b9540463e9fb66c8016b89c04a9f52dabdc988e69463c1",
107-
"previous_signature": "859504eade86790ad09b2b3474d5e09d1718b549ef7107d7bbd18f5e221765ce8252d7db02664c1f6b20f40c6e8e138704d2acfeb6c5abcc14c77e3a842b2f84515e7366248ca37b1460d23b4f98493c246fbb02851f2a43a710c968a349f8d6"
108-
}
109-
```
110-
111-
- `round` is a monotonically increasing integer - the randomness round index
112-
- `randomness` is a SHA-256 hash of the signature
113-
- `signature` is the *Boneh-Lynn-Shacham* (BLS) signature for this round of randomness
114-
- `previous_signature` is the signature of the previous round of randomness
115-
116-
## **`/{chain-hash}/public/{round}`**
117-
118-
Retrieves a previous round of randomness identified by the positive integer `round`. Note that specifying `0` will retrieve the latest round. It returns a JSON object with the following structure:
119-
120-
```jsx
121-
{
122-
"round": 367,
123-
"randomness": "3439d92d58e47d342131d446a3abe264396dd264717897af30525c98408c834f",
124-
"signature": "90957ebc0719f8bfb67640aff8ca219bf9f2c5240e60a8711c968d93370d38f87b38ed234a8c63863eb81f234efce55b047478848c0de025527b3d3476dfe860632c1b799550de50a6b9540463e9fb66c8016b89c04a9f52dabdc988e69463c1",
125-
"previous_signature": "859504eade86790ad09b2b3474d5e09d1718b549ef7107d7bbd18f5e221765ce8252d7db02664c1f6b20f40c6e8e138704d2acfeb6c5abcc14c77e3a842b2f84515e7366248ca37b1460d23b4f98493c246fbb02851f2a43a710c968a349f8d6"
126-
}
127-
```
128-
129-
- `round` is a sequentially increasing integer - the randomness round index
130-
- `randomness` is a SHA-256 hash of the signature
131-
- `signature` is the *Boneh-Lynn-Shacham* (BLS) signature for this round of randomness
132-
- `previous_signature` is the signature of the previous round of randomness (note: this will is omitted for [**unchained networks**](../concepts/2-1-concepts-cryptography#%EF%B8%8F-chained-and-unchained-modes)
133-
134-
**Note**: For backwards-compatibility reasons, paths without `chain-hash` will resort to the the default network in operation.
135-
136-
---
59+
For details of the API Documentation, please refer to the [API Documentation](/docs/dev-guide/3.7%20API%20Documentation/drand-http-api).
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
id: chain-hash-info
3+
title: "/:chain-hash/info"
4+
description: "Retrieves metadata about a specific randomness chain, identified by its chain hash."
5+
sidebar_label: "/:chain-hash/info"
6+
hide_title: true
7+
hide_table_of_contents: true
8+
api: eJy1WWlz20YS/StT3K2KVcUD96FvLsVJtJXDFcuVD6I3HswMSMQggAwGklkq/fd9PQBIUFQcZ+N8kERijr5ev+6GHmZStUIXjSnqanY5+1kZXag71bKdMlxywxnP6s4wztpGiSIvBNO8kvWuUm3LxJYX1ZwVUlUGa0qybM8KMyywLW+3y9l81nDNcZ/S7ezy9mFW4Qtk2T0L2oMtBUlvuKHPWv3eFVrJ2aXRnZrPWrFVOz67fJiZfUMnWyhZbezFBrfS0f/eOouUL/KXi2/ePUTB479nj/OZ+sh3TUknkjR1VMxTzpX08lzJ2JeZjJ3Ucz1fRrmHDb4TBo6Mo9D1/cjzQinc2FOhm3lCQdapo262im1xv4RTdry0po5+2EM5ZrCh98ILtdws50yqnHel6R/CU5Uy97X+cLGcPb4jm9umrlrVkpme49CfU4lX9rKiymu94/RsXUErUVcGQmk7b5qyEHZp9VtLZx7OXVdnvylhyHW6bpQ2RS+x6TKc/fWD2j/n5nPTZUGLWWdgSH+W4Syrc2u3JIiwja67ZnYShSjJHSdUWaIiFQju8CAWCY9joTgPfSfF9zTGAxG7mQiFUGnkR1EWypiHESIUi9BLlZI8ikTs4XsS8DRwvMRxee67FHMYVdRyYkUBB22UftYMU+wUXMpaBT/KlmWIiVLVFOKZ4lhjsAUbptb4DqRtFDYV7a900f8psy0qoazb3lbFR/aqqcUWX7mxz6wTocSGV4yEacQX6DoqOFXJDdMw8F0nJNVsYn1WMI/JOmf32wLiu6r4vVPl/pjZ7SSwdv+SXRtWtKxrAQHegiB0XRuLAN21hgGm7I6XhbSAHJGRFxpr1pn06GjGcvZF05VCQ5777rOdYBMYKnHoWMInyCtYecjkTmt4AkGzJlY1LmCgNVOIoulDAhfSziGtl+zmED17IbmqgTPgLbgDFKv3DEm/5YNGR+PdOMpTP0gTIC8V3PdjN3SyIJKeK2WYRLGveKD8MHHdJMyTKI3I7jT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lhN3W5k9DlHEJy5dNwLWUGulUqAwGKi7GtPHLmWEXyjro7ghz65aGLogl36SydYW7kws6Nw1v5vnm9UZw69ueGM8u99HIAPZgC007OvmzQGSrmLR1ywQ/XN2dXbMBnXWbbMXvb8BtUnq0onqvvr69e/fjmlX3b0dSt2fFqImB1eayU4zB5MgQ8HCfhf+h/GcNkTMV8ZdOaXGGNfBhm3tvZ5ZN/bUBPjDNbmEOrDw+Eh7e6fHykxyi/eo/n+EjUQc2DHYxl0dJnTNQ5Wgv1CUNf/Dx03hfsS/5b4g9sHR7yit47IRU7+oaP/ZuhieWP7+gttIIu2hrUb3gphGrM5OjZ+woa/Q4vE759dQMs/A8P/BqZ
9+
sidebar_class_name: "get api-method"
10+
info_path: docs/03_dev-guide/3.7 API Documentation v1/drand-http-api
11+
custom_edit_url: null
12+
---
13+
14+
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
15+
import ParamsDetails from "@theme/ParamsDetails";
16+
import RequestSchema from "@theme/RequestSchema";
17+
import StatusCodes from "@theme/StatusCodes";
18+
import OperationTabs from "@theme/OperationTabs";
19+
import TabItem from "@theme/TabItem";
20+
import Heading from "@theme/Heading";
21+
22+
<Heading
23+
as={"h1"}
24+
className={"openapi__heading"}
25+
children={"/:chain-hash/info"}
26+
>
27+
</Heading>
28+
29+
<MethodEndpoint
30+
method={"get"}
31+
path={"/{chain-hash}/info"}
32+
context={"endpoint"}
33+
>
34+
35+
</MethodEndpoint>
36+
37+
38+
39+
Retrieves metadata about a specific randomness chain, identified by its chain hash.
40+
41+
<Heading
42+
id={"request"}
43+
as={"h2"}
44+
className={"openapi-tabs__heading"}
45+
children={"Request"}
46+
>
47+
</Heading>
48+
49+
<ParamsDetails
50+
parameters={[{"name":"chain-hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"example":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","description":"The hexadecimal hash identifying the chain (e.g., default chained network)."}]}
51+
>
52+
53+
</ParamsDetails>
54+
55+
<RequestSchema
56+
title={"Body"}
57+
body={undefined}
58+
>
59+
60+
</RequestSchema>
61+
62+
<StatusCodes
63+
id={undefined}
64+
label={undefined}
65+
responses={{"200":{"description":"Chain information\n","content":{"application/json":{"schema":{"type":"object","properties":{"public_key":{"type":"string","description":"The distributed public key of the drand group","example":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31"},"period":{"type":"integer","description":"The time in seconds between randomness beacon rounds","example":30},"genesis_time":{"type":"integer","description":"The time in seconds since the Unix Epoch that the group began generating randomness","example":1595431050},"hash":{"type":"string","description":"The chain hash, which uniquely identifies the drand chain. It is used as a root of trust for validation of the first round of randomness.","example":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce"},"groupHash":{"type":"string","description":"The hash of a file containing the current set of nodes participating in the network. The group file is updated on every resharing","example":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"},"schemeID":{"type":"string","description":"The name of the scheme this network uses. The scheme specifies the type of cryptography being used to generate the randomness beacons","example":"pedersen-bls-chained"},"metadata":{"type":"object","properties":{"beaconID":{"type":"string","description":"The identifier for the beacon.","example":"default"}},"description":"Contains some miscellaneous metadata about the network that is added to most packets during operation"}},"required":["public_key","period","genesis_time","hash","groupHash","schemeID","metadata"],"title":"ChainInfo"},"example":{"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31","period":30,"genesis_time":1595431050,"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a","schemeID":"pedersen-bls-chained","metadata":{"beaconID":"default"}}}}},"404":{"description":"Chain not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"chain not found"}}}}}}}}
66+
>
67+
68+
</StatusCodes>
69+
70+
71+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
id: chain-hash-public-latest
3+
title: "/:chain-hash/public/latest"
4+
description: "Retrieves the most recent randomness value from the default chain. Note this might not be available on all chained networks; prefer using chain-specific endpoints or relays for consistency."
5+
sidebar_label: "/:chain-hash/public/latest"
6+
hide_title: true
7+
hide_table_of_contents: true
8+
api: eJzVWNty20YS/ZUp7lbFqhJJXAY37ZPjOIm3HMcVKbUPknc9lx4SMQhwAVAyS6V/39MD8CJRcda1edlUElLETF9Od5/uxv3EUmfact2XTT25mPxCfVvSLXWiX5JYNV0vWjJU40PVtlnV1HXiVlUbEq5tVv6UJac2VS/MUpX1TLxresLvZSdW5WLZi7rphSahblVZKV2RaGqhqmo4TlbU1N817afub2LdkqNWbLqyXgyPp92aTOlKI6i266as+040LUyq1LYTDl9NU3dl11NttrPJ+WStWrWintpucnF9P6nxB7waZC1Vt8SRkv1cq56/t/TvTdmSnVz07YbOJ51Z0kpNLu4n/XbNNzvAUS+84B5S+eo/r4Npoabu5fT7D/epfPjr5OF8Qp/Val3xjSSyutAqCygwJnApKZflQWxtkEmZqdAlMsuyOHE2dmkaZkWkVSHTIDC5pCILJw8f2K5uDceoY1OiIOCPJ4E6hMOqXnksOBiV6omD1mxqe1PDcAAEdHqWoNbrqjSKJcx/61jM/anHjf6NTM8et82a2r4cjPACj44hFLSgFuce2/USSYOINzUUVdVWlLVpSfmIjlfE1Bt6lE9eNh5b+jw5gjJOMyB7OPdcWJ4qv/zx5TRKUsGxFo3zmrpyUat+09Kx8Eks48IWkU1ykpmNZRTGoZUyVbHSFKV4mlqLzyzM8iJTLg6SKDFFLoPc5LF0HPWD5D807QqGfNvUtJy+3db19HKpkJQr8eLbt5dnBwvHMJY7TODBkf/H5hdBkWSkTZCFhcu102mWykA5lxsVhYV2hYtMEsmA0kDlWRiaIs1tEcdZYOPc5ZmOc7JRLFVu0jhPY9J56PA3OUNJ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LRDD+NiPf3l+1cDn5SqHs2DThfnEdbdLDJhkrgiwYJvVV4EobUWK3MRqiBn4QpKHPZZmRXWatAtETbgyJztxsoDZ+66iNvwdMcph3l5nKIwK4ezYBaMC6UyfqEcX+0Nw+sVKZ7Yn1vOPPfy2wbMYASmPbr7co3JkEQ0CxiCn95cnYhYgM822o9jXtr4f1C5nnM852/fvHr97vK137TXTdevVH2kYH5x6JQnW+WjbeD+sCv/37+DHbd0nh/mnkkYfY/r/bhvX08uHr2SHaDBlxEcLFNLuM0H7+85G39tq4cH/hnNv93id3xl4vK7Pa/ltuz4OxZ7h8GGvoDui1/Guf9M/J6t44+q3nISMtD4C18/0fbxy+SHDzi95BdErbdiOPDSGFr3R1dP3n3wtrh/EfHD6yukz38AAlwKjA==
9+
sidebar_class_name: "get api-method"
10+
info_path: docs/03_dev-guide/3.7 API Documentation v1/drand-http-api
11+
custom_edit_url: null
12+
---
13+
14+
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
15+
import ParamsDetails from "@theme/ParamsDetails";
16+
import RequestSchema from "@theme/RequestSchema";
17+
import StatusCodes from "@theme/StatusCodes";
18+
import OperationTabs from "@theme/OperationTabs";
19+
import TabItem from "@theme/TabItem";
20+
import Heading from "@theme/Heading";
21+
22+
<Heading
23+
as={"h1"}
24+
className={"openapi__heading"}
25+
children={"/:chain-hash/public/latest"}
26+
>
27+
</Heading>
28+
29+
<MethodEndpoint
30+
method={"get"}
31+
path={"/{chain-hash}/public/latest"}
32+
context={"endpoint"}
33+
>
34+
35+
</MethodEndpoint>
36+
37+
38+
39+
Retrieves the most recent randomness value from the default chain. Note this might not be available on all chained networks; prefer using chain-specific endpoints or relays for consistency.
40+
41+
<Heading
42+
id={"request"}
43+
as={"h2"}
44+
className={"openapi-tabs__heading"}
45+
children={"Request"}
46+
>
47+
</Heading>
48+
49+
<ParamsDetails
50+
parameters={[{"name":"chain-hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"example":"52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"}]}
51+
>
52+
53+
</ParamsDetails>
54+
55+
<RequestSchema
56+
title={"Body"}
57+
body={undefined}
58+
>
59+
60+
</RequestSchema>
61+
62+
<StatusCodes
63+
id={undefined}
64+
label={undefined}
65+
responses={{"200":{"description":"Randomness data for the latest round\n","content":{"application/json":{"schema":{"type":"object","properties":{"round":{"type":"integer","description":"A monotonically increasing integer - the randomness round index","example":367},"randomness":{"type":"string","description":"A SHA-256 hash of the signature","example":"3439d92d58e47d342131d446a3abe264396dd264717897af30525c98408c834f"},"signature":{"type":"string","description":"The Boneh-Lynn-Shacham (BLS) signature for this round of randomness","example":"90957ebc0719f8bfb67640aff8ca219bf9f2c5240e60a8711c968d93370d38f87b38ed234a8c63863eb81f234efce55b047478848c0de025527b3d3476dfe860632c1b799550de50a6b9540463e9fb66c8016b89c04a9f52dabdc988e69463c1"},"previous_signature":{"type":"string","description":"The signature of the previous round of randomness (this will is omitted for unchained networks)","example":"859504eade86790ad09b2b3474d5e09d1718b549ef7107d7bbd18f5e221765ce8252d7db02664c1f6b20f40c6e8e138704d2acfeb6c5abcc14c77e3a842b2f84515e7366248ca37b1460d23b4f98493c246fbb02851f2a43a710c968a349f8d6"}},"required":["round","randomness","signature"],"title":"Randomness"}}}},"503":{"description":"Latest randomness unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"latest randomness not available"}}}}}}}}
66+
>
67+
68+
</StatusCodes>
69+
70+
71+

0 commit comments

Comments
 (0)