From 9625c874913c17f7d8122599207e80221b9da1b6 Mon Sep 17 00:00:00 2001 From: Thomas Niederberger <781000+Niederb@users.noreply.github.com> Date: Tue, 2 May 2023 09:42:51 +0200 Subject: [PATCH] Document feature flags (#558) * Document feature flags * Fix taplo issue * Mention examples in the feature flag documentation. --- Cargo.toml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 254819fba..e3b10f0f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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. +# 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", @@ -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"]