#l2 #p2p #blockchain

valence_core

Core module used across plug-ins for A-Block Valence nodes

4 releases

new 0.1.3 May 23, 2024
0.1.2 Feb 7, 2024
0.1.1 Nov 23, 2023
0.1.0 Oct 25, 2023

#2571 in Magic Beans

Download history 8/week @ 2024-02-04 12/week @ 2024-02-18 46/week @ 2024-02-25 1/week @ 2024-03-03 10/week @ 2024-03-10 3/week @ 2024-03-17 51/week @ 2024-03-31 15/week @ 2024-04-14 3/week @ 2024-04-21 121/week @ 2024-05-19

121 downloads per month
Used in valence_market

MIT license

51KB
955 lines


Logo

valence_core

Pipeline Status

The core library used by all Valence nodes and their plug-ins

Official documentation »

🎉 Plug-ins Using valence_core

Here you can find awesome plug-ins already using valence_core to boost their Valence nodes:

If you'd like to have your plug-in added to the list, please open a PR and we'll be happy to take a look!

(back to top)

..

How to Use

valence_core is designed to be used as a core crate for Valence functionality that is common across all node types and plug-ins. It is not designed to be used as a standalone crate, and will not compile as such.

..

🔧 Installation

If you have cargo-add installed, you can simply run the following command:

cargo add valence_core

Otherwise, add the following to your Cargo.toml file:

[dependencies]
valence_core = "0.1.2"

(back to top)

..

🏎️ Use in Plug-ins

The valence_core library exposes a few common methods and functionalities that are useful if you're either using plug-ins or writing your own. This core functionality includes:

  • api: The module here contains most of the structs and enums that are used to communicate between nodes and plug-ins. This includes the JsonReply, ApiErrorResponse and APIResponseStatus structs, as well as functions for JSON serialisation and Warp API replies.

  • db: The module here contains all the common code associated with data storage. This includes the KvStoreConnection trait, which ensures consistent interfacing with data handlers across the Valence ecosystem

  • crypto: The module here ensures consistency in the handling of cryptography across the Valence ecosystem. If you want to do anything with cryptography in your plug-in, you should use the functions here.

(back to top)

..

Further Work

  • Add tests
  • Consider abstraction structure for API and DB handling
  • Add traces

(back to top)

..

Dependencies

~35–50MB
~1M SLoC