Git Product home page Git Product logo

anoma's Introduction

Anoma

License: GPL v3 Drone CI build status

Overview

Anoma is a sovereign, proof-of-stake blockchain protocol that enables private, asset-agnostic cash and private bartering among any number of parties. To learn more about Anoma's vision, take a look at the Anoma Vision Paper or Anoma's Whitepaper.

This is an implementation of the Anoma protocol in Rust.

๐Ÿ““ Docs

Warning

Here lay dragons: this codebase is still experimental, try at your own risk!

๐Ÿ’พ Installing

There is a single command to build and install Anoma executables from source (the node, the client and the wallet). This command will also verify that a compatible version of Tendermint is available and if not, attempt to install it. Note that currently at least 16GB RAM is needed to build from source.

make install

After installation, the main anoma executable will be available on path.

To find how to use it, check out the User Guide section of the docs.

If you have Nix, you may opt to build and install Anoma using Nix. The Nix integration also takes care of making a compatible version of Tendermint available.

# Nix 2.4 and later
nix profile install

# All versions of Nix
nix-env -f . -iA anoma

For more detailed instructions and more install options, see the Install section of the User Guide.

โš™๏ธ Development

# Build the provided validity predicate, transaction and matchmaker wasm modules
make build-wasm-scripts-docker

# Development (debug) build Anoma, which includes a validator and some default 
# accounts, whose keys and addresses are available in the wallet
ANOMA_DEV=true make

Using Nix

You may opt to get all of the dependencies to develop Anoma by entering the development shell:

# Nix 2.4 and above
nix develop

# All versions of Nix
nix-shell

Inside the shell, all of the make targets work as usual:

# Build the WASM modules without docker
make build-wasm-scripts

# Development build (uses cargo)
ANOMA_DEV=true make

It is also possible to use the Nix Rust infrastructure instead of Cargo to build the project crates. This method uses crate2nix to derive Nix expressions from Cargo.toml and Cargo.lock files. The workspace members are exposed as packages in flake.nix with a rust_ prefix. Variants where the ABCI-plus-plus feature flag is enabled are exposed with a :ABCI-plus-plus suffix.

# List all packages
nix flake show

# Build the `anoma_apps` crate with `ABCI-plus-plus` feature
nix build .#rust_anoma_apps:ABCI-plus-plus

# Build the (default) anoma package. It consists of wrappers for the Anoma
# binaries (`rust_anoma_apps`) that ensure `tendermint` is in `PATH`.
nix build .#anoma

Advantages:

  • Excellent build reproducibility (all dependencies pinned).
  • Individual crates are stored as Nix derivations and therefore cached in the Nix store.
  • Makes it possible to build Nix derivations of the binaries. Cargo build doesn't work in the Nix build environment because network access is not allowed, meaning that Cargo can't fetch dependencies; cargo vendor could be used to prefetch everything for Cargo, but cargo vendor does not work on our project at the moment.

Disadvantages:

  • Only works for Linux and Darwin targets. WASM builds in particular are not possible with this method. Although, while crate2nix doesn't support targeting WASM, we should be able to build the WASM modules via Cargo - if only cargo vendor worked.

Note: If you have modified the Cargo dependencies (changed Cargo.lock), it is necessary to recreate the Cargo.nix expressions with crate2nix. Helpers are provided as flake apps (Nix 2.4 and later):

nix run .#generateCargoNix
nix run .#generateCargoNixABCI-plus-plus

Before submitting a PR, pls make sure to run the following

# Format the code
make fmt

# Lint the code
make clippy

๐Ÿงพ Logging

To change the log level, set ANOMA_LOG environment variable to one of:

  • error
  • warn
  • info
  • debug
  • trace

The default is set to info for all the modules, expect for Tendermint ABCI, which has a lot of debug logging.

For more fine-grained logging levels settings, please refer to the tracing subscriber docs for more information.

To switch on logging in tests that use #[test] macro from test_log::test, use RUST_LOG with e.g. RUST_LOG=info cargo test -- --nocapture.

How to contribute

Please see the contributing page.

Dependencies

The ledger currently requires that Tendermint version 0.34.x is installed and available on path. The pre-built binaries and the source for 0.34.8 are here, also directly available in some package managers.

This can be installed by make install command (which runs scripts/install/get_tendermint.sh script).

anoma's People

Contributors

tzemanovic avatar fraccaman avatar yito88 avatar sribst avatar batconjurer avatar juped avatar james-chf avatar murisi avatar simsaladin avatar gnosed avatar ggiecold avatar grarco avatar gabriella-fw avatar celsobonutti avatar atozxx avatar acentelles avatar awasunyin avatar pablohildo avatar junkicide avatar cwgoes avatar adrianbrink avatar idatucker avatar memasdeligeorgakis avatar simonmasson avatar atoz7 avatar mariari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.