#tari #layer #domain #base #shared #across #config-file

tari_common

Utilities and features for the Tari domain layer, shared across both Base and Digital Asset layers

12 releases

1.0.0-rc.5 Feb 9, 2024
0.8.1 Jan 29, 2021
0.2.7 Oct 12, 2020
0.2.0 Jul 15, 2020
0.0.5 Sep 2, 2019

#1553 in Magic Beans

Download history 3/week @ 2023-12-22 1/week @ 2023-12-29 2/week @ 2024-01-05 9/week @ 2024-01-12 2/week @ 2024-01-19 1/week @ 2024-02-02 26/week @ 2024-02-09 31/week @ 2024-02-16 64/week @ 2024-02-23 27/week @ 2024-03-01 19/week @ 2024-03-08 31/week @ 2024-03-15 19/week @ 2024-03-22 42/week @ 2024-03-29 199/week @ 2024-04-05

292 downloads per month
Used in 9 crates (5 directly)

BSD-3-Clause

415KB
7.5K SLoC

Tari Common

This crate provides commonly-used features that are shared across multiple Tari domain layers. Since they may refer to domain-level concepts, it's inappropriate to place them inside the infrastructure folder, tari-utilities specifically.


lib.rs:

Common logging and configuration utilities

The global Tari configuration file

A single configuration file (usually ~/.tari/config.toml is used to manage settings for all Tari applications and nodes running on a single system, whether it's a base node, validator node, or wallet.

Setting of configuration parameters is applied using the following order of precedence:

  1. Command-line argument
  2. Environment variable
  3. config.toml file value (see details: [configuration])
  4. Configuration default

The utilities exposed in this crate are opinionated, but flexible. In general, all data is stored in a .tari folder under your home folder.

Custom application configuration

Tari configuration file allows adding custom application specific sections. Tari is using [config] crate to load configurations and gives access to config::Config struct so that apps might be flexible. Though as tari apps follow certain configurability assumptions, tari_common provides helper traits which automate those with minimal code.

CLI helpers

Bootstrapping tari configuration files might be customized via CLI or env settings. To help with building tari-enabled CLI from scratch as easy as possible this crate exposes [ConfigBootstrap] struct which implements structopt::StructOpt trait and can be easily reused in any CLI.

Dependencies

~14–30MB
~468K SLoC