Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,467 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Radroots libraries — foundations for local food networks

Build local food networks that help farms and communities organize and communicate.

What it does: Radroots specifies the event and networking foundations for building interoperable local food networks, where governance and data ownership remain in the hands of the communities that run them.

Install | Docs | Examples | Releases | License

Use cases

  • Farmers post what they are growing and receive orders for upcoming harvests
  • Food hubs organize group buying across farms, households and local businesses
  • Farms and food hubs schedule drops and market days where buyers pick up orders
  • Restaurants and local businesses arrange regular orders directly with nearby farms
  • Local couriers carry orders from farms to homes, businesses and pickup points

How to use

use radroots::prelude::*;

let client = Client::builder()
    .signer(signer)
    .transport(Nostr::relays(["wss://radroots.org"])?)
    .build()
    .await?;

let farm = client
    .seller(seller_account)?
    .farm(farm_id)?;

// Farmer creates a listing for freshly picked tomatoes
let receipt = farm
    .listings()
    .publish("Heirloom tomatoes")
    .id("fresh-tomatoes")
    .description("Locally grown and picked this morning.")
    .price(Price::cad_per_kg(4)?)
    .available(Quantity::kg(20)?)
    .pickup_in(Locality::city("Victoria", "BC", "CA")?)
    .send() // Validates, signs, saves locally, and attempts publication
    .await?;

// Log the published event address
println!("Published: {}", receipt.address());

Getting started

Status: Alpha (0.1.0-alpha) Still a draft. Not recommended for use before 0.1.0 is published.

The Radroots libraries are a Rust workspace with a small set of native build dependencies. Nix is recommended; the manual setup below covers the minimum requirements on macOS and Linux. See BUILD.md for the complete build guide.

Nix (recommended)

The Nix development shell provides a configured environment on macOS and Linux:

git clone https://radroots.dev/git/lib.git && cd lib

nix develop
cargo check --workspace --locked

macOS and Linux

To setup manually, install Rust, Git, LLVM/Clang with libclang, pkg-config, and libsodium.

On macOS with Homebrew:

brew install llvm pkgconf libsodium
export LIBCLANG_PATH="$(brew --prefix llvm)/lib"

On Debian or Ubuntu:

sudo apt install build-essential clang libclang-dev pkg-config libsodium-dev

Then clone and check the workspace:

git clone https://radroots.dev/git/lib.git && cd lib

export SODIUM_USE_PKG_CONFIG=1
cargo check --workspace --locked

On macOS, if bindgen cannot locate the system headers:

export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${SDKROOT}"

SP1 (optional)

SP1 is required to compile programs and generate proofs. Install Protocol Buffers and the SP1 toolchain:

# macOS
brew install protobuf

# Debian or Ubuntu
sudo apt install protobuf-compiler

curl -L https://sp1up.succinct.xyz | bash
sp1up

Run proof generation in release mode. CUDA proving is supported on compatible Linux systems, not on macOS. See BUILD.md for the complete setup.

Status

Radroots is under active development. The API is not yet stable and will change quite often.

License

This repository is licensed under either:

at your option.

Vendored or third-party material retains its own notices and license.

About

Coordinate networks for local food communities

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages