Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document feature flags #558

Merged
merged 3 commits into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@ disable_target_static_assertions = [
]
# If this is active all the code compiles in synchronous mode. Otherwise `async` is supported.
sync-api = ["ac-compose-macros/sync-api", "maybe-async/is_sync"]
# Use the `jsonrpsee` crate for websocket communication. Does provide sync and async support but needs a tokio runtime.
# Provides convenience functions such as subscription callbacks.
# Most examples use the `jsonrpsee` feature and can be used for reference.
jsonrpsee-client = ["std", "jsonrpsee", "futures"]
# Use the `tungstenite` crate for websocket communication. No async support but has some reconnection capabilities.
# See the example `transfer_with_tungstenite_client` on how to use it.
tungstenite-client = ["std", "tungstenite"]
# Use the `ws` crate for websocket communication. No async support.
# Establishes a new connection for each request and therefore is limited in terms of performance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I like this documentation very much. Your example linking below just gave me the idea: Would it make sense to link to the ws_client example as well? (same for tungestenite)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I added the examples to the documentation.

# See the example `transfer_with_ws_client` on how to use it.
ws-client = ["std", "ws"]
# Enables functionality that helps to create extrinsics for `pallet-staking`.
# See the `StakingExtrinsics` trait and the `staking_batch_payout` example to get an understanding
# of the functionality this feature provides
staking-xt = ["std", "ac-primitives/staking-xt"]
# Enables functionality that helps to create extrinsics for `pallet-contracts`.
# See the `ContractsExtrinsics` trait and the `contract_instantiate_with_code` example to get an understanding
# of the functionality this feature provides.
contracts-xt = ["std", "ac-primitives/contracts-xt"]
std = [
# crates.io no_std
"codec/std",
Expand All @@ -91,11 +110,3 @@ std = [
"ac-node-api/std",
"ac-primitives/std",
]
# Use the `jsonrpsee` crate for websocket communication. Does provide sync and async support.
jsonrpsee-client = ["std", "jsonrpsee", "futures"]
# Use the `tungstenite` crate for websocket communication. No async support.
tungstenite-client = ["std", "tungstenite"]
# Use the `ws` crate for websocket communication. No async support.
ws-client = ["std", "ws"]
staking-xt = ["std", "ac-primitives/staking-xt"]
contracts-xt = ["std", "ac-primitives/contracts-xt"]