Skip to content

Commit

Permalink
change(docs): Replace doc.zebra.zfnd.org API documentation with docs.…
Browse files Browse the repository at this point in the history
…rs (#7886)

* Simple replacements of doc.zebra.zfnd.org with docs.rs

* Manual fixes for specific main/internal/external docs

* Point developer docs to doc-internal.zebra.zfnd.org

* fastmod --glob '\!.git' -- doc.zebra.zfnd.org/zebrad docs.rs/zebrad/latest/zebrad

* Manually remove any remaining doc.zfnd.zebra.org links

* Remove the external docs job

* Add changelog entry and fix links

* Fix links that were broken before this PR
  • Loading branch information
teor2345 authored Nov 1, 2023
1 parent daabe8b commit afbe807
Show file tree
Hide file tree
Showing 45 changed files with 96 additions and 140 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/docs-deploy-firebase.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ jobs:
steps:
- run: 'echo "No build required"'

build-docs-external:
name: Build and Deploy Zebra External Docs
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

build-docs-internal:
name: Build and Deploy Zebra Internal Docs
timeout-minutes: 45
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/docs-deploy-firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,62 +114,6 @@ jobs:
projectId: ${{ vars.GCP_FIREBASE_PROJECT }}
target: docs-book

build-docs-external:
name: Build and Deploy Zebra External Docs
timeout-minutes: 45
runs-on: ubuntu-latest
permissions:
checks: write
contents: 'read'
id-token: 'write'
pull-requests: write
steps:
- name: Checkout the source code
uses: actions/[email protected]
with:
persist-credentials: false

- name: Install last version of Protoc
uses: arduino/[email protected]
with:
version: '23.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Setup Rust with beta toolchain and default profile (to include rust-docs)
- name: Setup Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=beta --profile=default
- uses: Swatinem/[email protected]

- name: Build external docs
run: |
# Exclude zebra-utils and zebra-test, they are not for library or app users
cargo doc --no-deps --workspace --all-features --exclude zebra-utils --exclude zebra-test --target-dir "$(pwd)"/target/external
# Setup gcloud CLI
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/[email protected]
with:
retries: '3'
workload_identity_provider: '${{ vars.GCP_WIF }}'
service_account: '${{ vars.GCP_FIREBASE_SA }}'

# TODO: remove this step after issue https://github.com/FirebaseExtended/action-hosting-deploy/issues/174 is fixed
- name: Add $GCP_FIREBASE_SA_PATH to env
run: |
# shellcheck disable=SC2002
echo "GCP_FIREBASE_SA_PATH=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
- name: Deploy external docs to firebase
uses: FirebaseExtended/[email protected]
with:
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA_PATH }}
channelId: ${{ env.FIREBASE_CHANNEL }}
target: docs-external
projectId: ${{ vars.GCP_FIREBASE_PROJECT }}

build-docs-internal:
name: Build and Deploy Zebra Internal Docs
timeout-minutes: 45
Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ so it can't be used to retry failed downloads in `zebrad` 1.3.0 and earlier.

We recommend upgrading to the latest Zebra release to avoid download issues in new installs.

### Documentation Website Change

We have replaced the API documentation on the [doc.zebra.zfnd.org](https://doc.zebra.zfnd.org)
website with [docs.rs](https://docs.rs/releases/search?query=zebra). All links have been updated.

Zebra's API documentation can be found on:
- [`docs.rs`](https://docs.rs/releases/search?query=zebra), which renders documentation for the
public API of the latest crate releases;
- [`doc-internal.zebra.zfnd.org`](https://doc-internal.zebra.zfnd.org/), which renders
documentation for the internal API on the `main` branch.

### Security

TODO: rest of changelog
Expand Down Expand Up @@ -996,12 +1007,12 @@ When there are a lot of large user-generated transactions on the network, Zebra

### Configuration Changes

- Split the checkpoint and full verification [`sync` concurrency options](https://doc.zebra.zfnd.org/zebrad/config/struct.SyncSection.html) (#4726, #4758):
- Split the checkpoint and full verification [`sync` concurrency options](https://docs.rs/zebrad/latest/zebrad/components/sync/struct.Config.html) (#4726, #4758):
- Add a new `full_verify_concurrency_limit`
- Rename `max_concurrent_block_requests` to `download_concurrency_limit`
- Rename `lookahead_limit` to `checkpoint_verify_concurrency_limit`
For backwards compatibility, the old names are still accepted as aliases.
- Add a new `parallel_cpu_threads` [`sync` concurrency option](https://doc.zebra.zfnd.org/zebrad/config/struct.SyncSection.html) (#4776).
- Add a new `parallel_cpu_threads` [`sync` concurrency option](https://docs.rs/zebrad/latest/zebrad/components/sync/struct.Config.html) (#4776).
This option sets the number of threads to use for CPU-bound tasks, such as proof and signature verification.
By default, Zebra uses all available CPU cores.

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ consensus-compatible implementation of a Zcash node.
Zebra's network stack is interoperable with `zcashd`, and Zebra implements all
the features required to reach Zcash network consensus, including the validation
of all the consensus rules for the NU5 network upgrade.
[Here](https://doc.zebra.zfnd.org/zebrad/index.html#zebra-advantages) are some
[Here](https://docs.rs/zebrad/latest/zebrad/index.html#zebra-advantages) are some
benefits of Zebra.

Zebra validates blocks and transactions, but needs extra software to generate
Expand Down Expand Up @@ -148,8 +148,7 @@ You can combine multiple features by listing them as parameters of the `--featur
cargo install --features="<feature1> <feature2> ..." ...
```

Our full list of experimental and developer features is in [the API
documentation](https://doc.zebra.zfnd.org/zebrad/index.html#zebra-feature-flags).
Our full list of experimental and developer features is in [the API documentation](https://docs.rs/zebrad/latest/zebrad/index.html#zebra-feature-flags).

Some debugging and monitoring features are disabled in release builds to increase
performance.
Expand All @@ -176,10 +175,12 @@ We will continue to add new features as part of future network upgrades, and in

The [Zebra website](https://zebra.zfnd.org/) contains user documentation, such
as how to run or configure Zebra, set up metrics integrations, etc., as well as
developer documentation, such as design documents. We also render [API
documentation](https://doc.zebra.zfnd.org) for the external API of our crates,
as well as [internal documentation](https://doc-internal.zebra.zfnd.org) for
private APIs.
developer documentation, such as design documents. It also renders
[internal documentation](https://doc-internal.zebra.zfnd.org) for private APIs
on the `main` branch.

`docs.rs` renders [API documentation](https://docs.rs/releases/search?query=zebra)
for the external API of the latest releases of our crates.

## User support

Expand Down
6 changes: 4 additions & 2 deletions book/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

Zebra's API documentation is generated using Rustdoc:

- [`doc.zebra.zfnd.org`](https://doc.zebra.zfnd.org/) renders documentation for the public API;
- [`doc-internal.zebra.zfnd.org`](https://doc-internal.zebra.zfnd.org/) renders documentation for the internal API.
- [`docs.rs`](https://docs.rs/releases/search?query=zebra) renders documentation for the public API
of the latest crate releases;
- [`doc-internal.zebra.zfnd.org`](https://doc-internal.zebra.zfnd.org/) renders documentation for
the internal API on the `main` branch.
6 changes: 4 additions & 2 deletions book/src/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
This section contains the contribution guide and design documentation. It
does not contain API documentation, which is generated using Rustdoc:

- [`doc.zebra.zfnd.org`](https://doc.zebra.zfnd.org/) renders documentation for the public API;
- [`doc-internal.zebra.zfnd.org`](https://doc-internal.zebra.zfnd.org/) renders documentation for the internal API.
- [`docs.rs`](https://docs.rs/releases/search?query=zebra) renders documentation for the public API
of the latest crate releases;
- [`doc-internal.zebra.zfnd.org`](https://doc-internal.zebra.zfnd.org/) renders documentation for
the internal API on the `main` branch.
14 changes: 7 additions & 7 deletions book/src/dev/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ other functionality, without requiring a full node.
At a high level, the fullnode functionality required by `zebrad` is factored
into several components:

- [`zebra-chain`](https://doc.zebra.zfnd.org/zebra_chain/index.html), providing
- [`zebra-chain`](https://docs.rs/zebra_chain), providing
definitions of core data structures for Zcash, such as blocks, transactions,
addresses, etc., and related functionality. It also contains the
implementation of the consensus-critical serialization formats used in Zcash.
Expand All @@ -100,7 +100,7 @@ into several components:
towards verifying transactions, but will be extended to support creating them
in the future.

- [`zebra-network`](https://doc.zebra.zfnd.org/zebra_network/index.html),
- [`zebra-network`](https://docs.rs/zebra_network),
providing an asynchronous, multithreaded implementation of the Zcash network
protocol inherited from Bitcoin. In contrast to `zcashd`, each peer
connection has a separate state machine, and the crate translates the
Expand All @@ -113,29 +113,29 @@ into several components:
isolated from all other node state. This can be used, for instance, to
safely relay data over Tor, without revealing distinguishing information.

- [`zebra-script`](https://doc.zebra.zfnd.org/zebra_script/index.html) provides
- [`zebra-script`](https://docs.rs/zebra_script) provides
script validation. Currently, this is implemented by linking to the C++
script verification code from `zcashd`, but in the future we may implement a
pure-Rust script implementation.

- [`zebra-consensus`](https://doc.zebra.zfnd.org/zebra_consensus/index.html)
- [`zebra-consensus`](https://docs.rs/zebra_consensus)
performs [*semantic validation*](https://zebra.zfnd.org/dev/rfcs/0002-parallel-verification.html#verification-stages)
of blocks and transactions: all consensus
rules that can be checked independently of the chain state, such as
verification of signatures, proofs, and scripts. Internally, the library
uses [`tower-batch-control`](https://doc.zebra.zfnd.org/tower_batch_control/index.html) to
uses [`tower-batch-control`](https://docs.rs/tower_batch_control) to
perform automatic, transparent batch processing of contemporaneous
verification requests.

- [`zebra-state`](https://doc.zebra.zfnd.org/zebra_state/index.html) is
- [`zebra-state`](https://docs.rs/zebra_state) is
responsible for storing, updating, and querying the chain state. The state
service is responsible for [*contextual verification*](https://zebra.zfnd.org/dev/rfcs/0002-parallel-verification.html#verification-stages):
all consensus rules
that check whether a new block is a valid extension of an existing chain,
such as updating the nullifier set or checking that transaction inputs remain
unspent.

- [`zebrad`](https://doc.zebra.zfnd.org/zebrad/index.html) contains the full
- [`zebrad`](https://docs.rs/zebrad) contains the full
node, which connects these components together and implements logic to handle
inbound requests from peers and the chain sync process.

Expand Down
10 changes: 5 additions & 5 deletions book/src/dev/rfcs/0004-asynchronous-script-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ and in parallel on a thread pool.
- unlock script: a script satisfying the conditions of the lock script, allowing a UTXO to be spent.
Stored in the [`transparent::Input::PrevOut::lock_script`][lock_script] field.

[transout]: https://doc.zebra.zfnd.org/zebra_chain/transparent/struct.Output.html
[outpoint]: https://doc.zebra.zfnd.org/zebra_chain/transparent/struct.OutPoint.html
[lock_script]: https://doc.zebra.zfnd.org/zebra_chain/transparent/struct.Output.html#structfield.lock_script
[transin]: https://doc.zebra.zfnd.org/zebra_chain/transparent/enum.Input.html
[unlock_script]: https://doc.zebra.zfnd.org/zebra_chain/transparent/enum.Input.html#variant.PrevOut.field.unlock_script
[transout]: https://doc-internal.zebra.zfnd.org/zebra_chain/transparent/struct.Output.html
[outpoint]: https://doc-internal.zebra.zfnd.org/zebra_chain/transparent/struct.OutPoint.html
[lock_script]: https://doc-internal.zebra.zfnd.org/zebra_chain/transparent/struct.Output.html#structfield.lock_script
[transin]: https://doc-internal.zebra.zfnd.org/zebra_chain/transparent/enum.Input.html
[unlock_script]: https://doc-internal.zebra.zfnd.org/zebra_chain/transparent/enum.Input.html#variant.PrevOut.field.unlock_script


# Guide-level explanation
Expand Down
6 changes: 3 additions & 3 deletions book/src/dev/rfcs/0005-state-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,9 @@ validation and the anchor calculations.)
Hypothetically, if Sapling were activated from genesis, the specification requires
a Sapling anchor, but `zcashd` would ignore that anchor.

[`JoinSplit`]: https://doc.zebra.zfnd.org/zebra_chain/sprout/struct.JoinSplit.html
[`Spend`]: https://doc.zebra.zfnd.org/zebra_chain/sapling/spend/struct.Spend.html
[`Action`]: https://doc.zebra.zfnd.org/zebra_chain/orchard/struct.Action.html
[`JoinSplit`]: https://doc-internal.zebra.zfnd.org/zebra_chain/sprout/struct.JoinSplit.html
[`Spend`]: https://doc-internal.zebra.zfnd.org/zebra_chain/sapling/spend/struct.Spend.html
[`Action`]: https://doc-internal.zebra.zfnd.org/zebra_chain/orchard/struct.Action.html

These updates can be performed in a batch or without necessarily iterating
over all transactions, if the data is available by other means; they're
Expand Down
14 changes: 7 additions & 7 deletions book/src/user/lightwalletd.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ parallel_cpu_threads = 0
```

**WARNING:** This config allows multiple Zebra instances to share the same RPC port.
See the [RPC config documentation](https://doc.zebra.zfnd.org/zebra_rpc/config/struct.Config.html) for details.
See the [RPC config documentation](https://docs.rs/zebra_rpc/latest/zebra_rpc/config/struct.Config.html) for details.

## Sync Zebra

Expand All @@ -71,21 +71,21 @@ Zebra will display information about sync process:

```console
...
zebrad::commands::start: estimated progress to chain tip sync_percent=10.783 %
zebrad::commands::start: estimated progress to chain tip sync_percent=10.783 %
...
```

Until eventually it will get there:

```console
...
zebrad::commands::start: finished initial sync to chain tip, using gossiped blocks sync_percent=100.000 %
zebrad::commands::start: finished initial sync to chain tip, using gossiped blocks sync_percent=100.000 %
...
```

You can interrupt the process at any time with `ctrl-c` and Zebra will resume the next time at around the block you were downloading when stopping the process.

When deploying for production infrastructure, the above command can/should be implemented as a server service or similar configuration.
When deploying for production infrastructure, the above command can be run as a service or daemon.

For implementing zebra as a service please see [here](https://github.com/ZcashFoundation/zebra/blob/main/zebrad/systemd/zebrad.service).

Expand Down Expand Up @@ -144,7 +144,7 @@ Wait until lightwalletd is in sync before connecting any wallet into it. You wil
## Run tests
[#run-tests]: (#run-tests)

The Zebra team created tests for the interaction of `zebrad` and `lightwalletd`.
The Zebra team created tests for the interaction of `zebrad` and `lightwalletd`.

To run all the Zebra `lightwalletd` tests:
1. install `lightwalletd`
Expand All @@ -156,7 +156,7 @@ Please refer to [acceptance](https://github.com/ZcashFoundation/zebra/blob/main/
## Connect a wallet to lightwalletd
[#connect-wallet-to-lightwalletd]: (#connect-wallet-to-lightwalletd)

The final goal is to connect wallets to the lightwalletd service backed by Zebra.
The final goal is to connect wallets to the lightwalletd service backed by Zebra.

For demo purposes we used [zecwallet-cli](https://github.com/adityapk00/zecwallet-light-cli) with the [adityapk00/lightwalletd](https://github.com/adityapk00/lightwalletd) fork.
We didn't test [zecwallet-cli](https://github.com/adityapk00/zecwallet-light-cli) with [zcash/lightwalletd](https://github.com/zcash/lightwalletd) yet.
Expand Down Expand Up @@ -184,5 +184,5 @@ Lightclient connecting to http://127.0.0.1:9067/
"total_blocks_synced": 49476
}
Ready!
(main) Block:1683911 (type 'help') >>
(main) Block:1683911 (type 'help') >>
```
2 changes: 1 addition & 1 deletion book/src/user/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ front end that you can visualize:

![image info](grafana.png)

[metrics_section]: https://doc.zebra.zfnd.org/zebrad/config/struct.MetricsSection.html
[metrics_section]: https://docs.rs/zebrad/latest/zebrad/components/metrics/struct.Config.html
2 changes: 1 addition & 1 deletion book/src/user/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Zebra uses the following inbound and outbound TCP ports:
- 18233 on Testnet

If you configure Zebra with a specific
[`listen_addr`](https://doc.zebra.zfnd.org/zebra_network/struct.Config.html#structfield.listen_addr),
[`listen_addr`](https://docs.rs/zebra_network/latest/zebra_network/struct.Config.html#structfield.listen_addr),
it will advertise this address to other nodes for inbound connections. Outbound
connections are required to sync, inbound connections are optional. Zebra also
needs access to the Zcash DNS seeders, via the OS DNS resolver (usually port
Expand Down
2 changes: 1 addition & 1 deletion book/src/user/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ changing the config.

The configuration format is the TOML encoding of the internal config
structure, and documentation for all of the config options can be found
[here](https://doc.zebra.zfnd.org/zebrad/config/struct.ZebradConfig.html).
[here](https://docs.rs/zebrad/latest/zebrad/config/struct.ZebradConfig.html).

- `zebrad start` starts a full node.

Expand Down
2 changes: 1 addition & 1 deletion book/src/user/startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Some important parts of the config are:
- `state.cache_dir`: where the cached state is stored on disk
- `rpc.listen_addr`: optional JSON-RPC listener port

See [the full list of configuration options](https://doc.zebra.zfnd.org/zebrad/config/struct.ZebradConfig.html).
See [the full list of configuration options](https://docs.rs/zebrad/latest/zebrad/config/struct.ZebradConfig.html).

```
zebrad::commands::start: Starting zebrad
Expand Down
8 changes: 4 additions & 4 deletions book/src/user/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ and the [`flamegraph`][flamegraph] runtime config option.

Compile Zebra with `--features sentry` to monitor it using [Sentry][sentry] in production.

[tracing_section]: https://doc.zebra.zfnd.org/zebrad/components/tracing/struct.Config.html
[filter]: https://doc.zebra.zfnd.org/zebrad/components/tracing/struct.Config.html#structfield.filter
[flamegraph]: https://doc.zebra.zfnd.org/zebrad/components/tracing/struct.Config.html#structfield.flamegraph
[tracing_section]: https://docs.rs/zebrad/latest/zebrad/components/tracing/struct.Config.html
[filter]: https://docs.rs/zebrad/latest/zebrad/components/tracing/struct.Config.html#structfield.filter
[flamegraph]: https://docs.rs/zebrad/latest/zebrad/components/tracing/struct.Config.html#structfield.flamegraph
[flamegraphs]: http://www.brendangregg.com/flamegraphs.html
[systemd_journald]: https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
[use_journald]: https://doc.zebra.zfnd.org/zebrad/components/tracing/struct.Config.html#structfield.use_journald
[use_journald]: https://docs.rs/zebrad/latest/zebrad/components/tracing/struct.Config.html#structfield.use_journald
[sentry]: https://sentry.io/welcome/
4 changes: 2 additions & 2 deletions book/src/user/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Make sure you're using a release build on your native architecture.
### Syncer Lookahead Limit

If your connection is slow, try
[downloading fewer blocks at a time](https://doc.zebra.zfnd.org/zebrad/config/struct.SyncSection.html#structfield.lookahead_limit):
[downloading fewer blocks at a time](https://docs.rs/zebrad/latest/zebrad/components/sync/struct.Config.html#structfield.lookahead_limit):

```toml
[sync]
Expand All @@ -58,7 +58,7 @@ max_concurrent_block_requests = 25

### Peer Set Size

If your connection is slow, try [connecting to fewer peers](https://doc.zebra.zfnd.org/zebra_network/struct.Config.html#structfield.peerset_initial_target_size):
If your connection is slow, try [connecting to fewer peers](https://docs.rs/zebra-network/latest/zebra_network/struct.Config.html#structfield.peerset_initial_target_size):

```toml
[network]
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![doc(html_favicon_url = "https://zfnd.org/wp-content/uploads/2022/03/zebra-favicon-128.png")]
#![doc(html_logo_url = "https://zfnd.org/wp-content/uploads/2022/03/zebra-icon.png")]
#![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_chain")]
#![doc(html_root_url = "https://docs.rs/zebra_chain")]
// Required by bitvec! macro
#![recursion_limit = "256"]
//
Expand Down
Loading

0 comments on commit afbe807

Please sign in to comment.