#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

#5 in #tari

Download history 19/week @ 2024-06-28 7/week @ 2024-07-05 40/week @ 2024-07-12 54/week @ 2024-07-19 114/week @ 2024-07-26 43/week @ 2024-08-02 22/week @ 2024-08-09 16/week @ 2024-08-16 27/week @ 2024-08-23 24/week @ 2024-08-30 11/week @ 2024-09-06 17/week @ 2024-09-13 37/week @ 2024-09-20 23/week @ 2024-09-27 7/week @ 2024-10-04 9/week @ 2024-10-11

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

BSD-3-Clause

425KB
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

~16–29MB
~459K SLoC