Cargo Features

[dependencies]
farcaster_node = { version = "0.8.4", default-features = false, features = ["all", "server", "cli", "embedded", "node", "client", "shell", "serde", "tor", "integration_test", "bech32"] }

Recommended set of features:

  1. Standalone node: server (=node+shell)
  2. Cli to remote node: cli (auto includes shell and integration)
  3. Mobile app talking to a server: client
  4. Mobile app with embedded node: embedded (auto includes client + node)
  5. Simple cli utility app: shell
default = cli, server

These default features are set whenever farcaster_node is added without default-features = false somewhere in the dependency tree.

all = cli, serde, server, tor
server default all? = nix, node, shell

Server is a standalone application that runs daemon

Enables server of microservices ^0.8.0

Required by farcasterd, grpcd, peerd, swapd, syncerd and walletd binaries

cli default all? = client, serde, shell

Command-line application feature

Enables cli of microservices ^0.8.0

Affects farcaster_node::cli

Required by the swap-cli binary

embedded = client, node

Embedded is an app that contains embedded node and that talks to it through integration layer

Enables embedded of microservices ^0.8.0

node embedded? server = _rpc, base64, serde, serde_yaml, toml

Server node can be run as a part of mobile app and other types of clients; thus server != node. This feature results in building with features not required for command-line

Enables rand of bitcoin ^0.28, keygen and zmq of internet2 ^0.8.3, node of microservices ^0.8.0

Affects farcaster_node::databased, farcaster_node::farcasterd, farcaster_node::grpcd, farcaster_node::peerd, farcaster_node::swapd, farcaster_node::syncerd, farcaster_node::walletd

client cli embedded? = _rpc, base64, clap

Feature is required for any applications that talks to daemon processes

Enables rand of bitcoin ^0.28, zmq of internet2 ^0.8.3, client and node of microservices ^0.8.0

shell cli server = clap, colored, dotenv, serde, settings, shellexpand

Required for all apps that can be launched from command-line shell as binaries (i.e. both servers and cli)

Enables parse_arg of amplify ^3.13.0, shell of microservices ^0.8.0

Affects farcaster_node::opts, syncerd::opts

serde all? cli node? shell? = serde_crate, serde_json, serde_with, serde_yaml, toml

Enables serde of amplify ^3.13.0, use-serde of bitcoin ^0.28 and serde of chrono, internet2 ^0.8.3, microservices ^0.8.0, and slip132 ^0.7.0

internet2:

Exposing core rust componens
----------------------------
These also include re-assembly of necessary features from dependencies

tor all?

Enables tor of internet2 ^0.8.3 and microservices ^0.8.0

internet2:

Networking
----------

integration_test = regex
_rpc client? node?

Affects farcaster_node::bus, farcaster_node::config

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

base64 client? node?

Enables base64 ^0.12

bech32 implicit feature

Enables bech32 ^0.7

bech32:

Encodes and decodes the Bech32 format and implements the bech32 and bech32m checksums

clap client? shell?

Enables clap ^3.0.0

colored shell?
dotenv shell?
nix server

Enables nix ^0.19

regex integration_test?
serde_crate serde?

Enables serde

we rename the crate below because there is already a feature called serde, so it would conflict with the implicit feature that would be added by adding the serde crate; this can be fixed once rust-version is updated to 1.60.0, which solves this by adding the dep: prefix for features defined by dependencies

serde_json serde?
serde_with serde?

Enables serde_with ^1.8

serde_yaml node? serde?

Enables serde_yaml ^0.8

settings shell?

Enables config ^0.10

shellexpand shell?

Enables shellexpand ^2

toml node? serde?

Enables toml ^0.5