Skip to content

Commit

Permalink
Adding testnet doc and misc changes (#191)
Browse files Browse the repository at this point in the history
* Adding grpc check to avoid having specific rules for each endpoint and chain

Signed-off-by: Yolan Romailler <[email protected]>

* Adding testnet documentation

Signed-off-by: Yolan Romailler <[email protected]>

* Apply suggestions from code review

Co-authored-by: PM <[email protected]>

---------

Signed-off-by: Yolan Romailler <[email protected]>
Co-authored-by: PM <[email protected]>
  • Loading branch information
AnomalRoil and CluEleSsUK authored Jan 16, 2024
1 parent 950b874 commit d857545
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
9 changes: 6 additions & 3 deletions docs/developer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ There are two networks on mainnet:
- `default` which is running the chained scheme with public keys on G1
- `quicknet` which is running the unchained scheme with public keys on G2

`default` network chain hash:
`default` network chain hash:
```8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce```

`quicknet` network chain hash:
`quicknet` network chain hash:
```52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971```

Note that [the `fastnet` network has been deprecated.](/blog/2023/07/03/fastnet-sunset-quicknet-new/).
Note that [the `fastnet` network has been deprecated](/blog/2023/07/03/fastnet-sunset-quicknet-new/).

In order to retrieve randomness from a drand network you should **preferentially use the [drand client libraries](/developer/clients/) or the [drand-client CLI](/developer/drand-client/)**, which support the different mechanisms and perform verification for every value obtained.

Expand All @@ -36,3 +36,6 @@ Alternatively, you can interact directly with the endpoints. Make sure to manual
- [HTTP API reference](/developer/http-api/)
- [Pubsub-based randomness distribution](/developer/gossipsub/)
- gRPC API: usually not publicly accessible. A gRPC API is supported by the drand client libraries, the `drand-client` CLI application and the [drand application](/operator/drand-cli/) itself (using `drand get public`).

Finally, for development purposes, we recommend also testing your code against our Testnet endpoints.
See [our dedicated documentation entry about testnet endpoints](/developer/http-api/#testnet-endpoints).
17 changes: 17 additions & 0 deletions docs/developer/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ The chain hash for the League of Entropy `quicknet` network running at a 3s freq

Note that [the `fastnet` network has been deprecated.](/blog/2023/07/03/fastnet-sunset-quicknet-new/).

### Testnet endpoints

Furthermore, we have "testnet endpoints" which are a completely separate environment for testing our latest changes, potentially helping you detect breaking changes or issues with our latest release before they hit mainnet.
We recommend running your CI/CD against our testnet endpoints as well as our mainnet ones, in order to detect issues early.

We currently have 3 testnet HTTP(S) endpoints being run by:
- Protocol Labs
- [https://pl-us.testnet.drand.sh/chains](https://pl-us.testnet.drand.sh/chains)
- [https://pl-eu.testnet.drand.sh/chains](https://pl-eu.testnet.drand.sh/chains)
- Cloudflare
- [https://testnet-api.drand.cloudflare.com/chains](https://testnet-api.drand.cloudflare.com/chains)

As you can see, they are currently running various chains as explained below.
We are committed to maintaining the `default`, G2 based, chained testnet chain (`84b2234fb34e835dccd048255d7ad3194b81af7d978c3bf157e3469592ae4e02`) as well as the faster, G1 based, unchained `quicknet-t` testnet chain (`cc9c398442737cbd141526600919edd69f1d6f9b4adb67e4d912fbc64341a9a5`) as long as we run the equivalent mainnet networks.

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.

## `/chains`

Retrieves the _chain hash_ of every running network a user can interact with. It returns a JSON object with the following structure:
Expand Down
33 changes: 16 additions & 17 deletions docs/operator/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,22 @@ Running drand behind a reverse proxy is the **default** method of deploying dran
```nginx
# /etc/nginx/sites-available/default
server {
server_name drand.example.xyz;
listen 443 ssl http2;
location / {
grpc_pass grpc://localhost:4444;
grpc_set_header X-Real-IP $remote_addr;
}
location /public/ {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
location /info {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
# Add ssl certificates by running certbot --nginx
server_name drand.example.xyz;
listen 443 ssl http2;
location / {
# Check for gRPC header
if ($http_content_type = "application/grpc") {
grpc_pass grpc://localhost:4444;
grpc_set_header X-Real-IP $remote_addr;
}
# If not gRPC, treat as regular HTTP
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
# Add ssl certificates by running certbot --nginx
}
```

Expand Down

0 comments on commit d857545

Please sign in to comment.