Skip to content

pragma-org/amaru

Repository files navigation

Amaru

Amaru is a Cardano node client written in Rust. It is an ambitious project which aims to bring more diversity to the infrastructure operating the Cardano network.

Getting Started

Warning

Amaru is still in an exploratory phase. Our development strategy favors early integration of components, so that progress is instantly visible, even though features might be limited or incomplete.

Installing

cargo build --release

Running (demo)

Important

These instructions assume one starts from scratch, and has access to a running cardano-node on the preprod network.

  1. Download at least three ledger snapshots:
mkdir -p snapshots;
curl -s -o - "https://raw.githubusercontent.com/pragma-org/amaru/refs/heads/main/data/snapshots.json" \
  | jq -r '.[] | "\(.point)  \(.url)"' \
  | while read p u ; do  \
      echo "Fetching $p.cbor"; \
      curl --progress-bar -o - $u \
        | gunzip > snapshots/$p.cbor ; \
    done
  1. Import the snapshots just downloaded:
cargo run --release -- import-ledger-state \
  --snapshot snapshots/69206375.6f99b5f3deaeae8dc43fce3db2f3cd36ad8ed174ca3400b5b1bed76fdf248912.cbor \
  --snapshot snapshots/69638382.5da6ba37a4a07df015c4ea92c880e3600d7f098b97e73816f8df04bbb5fad3b7.cbor \
  --snapshot snapshots/70070379.d6fe6439aed8bddc10eec22c1575bf0648e4a76125387d9e985e9a3f8342870d.cbor
  1. Import chain data from remote peer:

Tip

You only need two headers to bootstrap Amaru:

  • The last header of your imported snapshots
  • The last header of the epoch before your last imported epoch

Although, importing more headers won't hurt. So you can do a single synchronization of an entire epoch (~21600 blocks on good days, likely less on PreProd and Preview networks).

cargo run --release -- import-headers \
  --peer-address 127.0.0.1:3000 \
  --starting-point 69638365.4ec0f5a78431fdcc594eab7db91aff7dfd91c13cc93e9fbfe70cd15a86fadfb2 \
  --count 21600
  1. Import VRF nonces information

You need nonces states corresponding to the last header from the snapshots (i.e. the last block of PreProd's epoch 165 → 70070379.d6fe6439aed8bddc10eec22c1575bf0648e4a76125387d9e985e9a3f8342870d):

cargo run --release -- import-nonces \
  --at 70070379.d6fe6439aed8bddc10eec22c1575bf0648e4a76125387d9e985e9a3f8342870d \
  --active a7c4477e9fcfd519bf7dcba0d4ffe35a399125534bc8c60fa89ff6b50a060a7a \
  --candidate 74fe03b10c4f52dd41105a16b5f6a11015ec890a001a5253db78a779fe43f6b6 \
  --evolving 24bb737ee28652cd99ca41f1f7be568353b4103d769c6e1ddb531fc874dd6718 \
  --tail 5da6ba37a4a07df015c4ea92c880e3600d7f098b97e73816f8df04bbb5fad3b7
  1. (Optional) Setup observability backends:
docker-compose -f monitoring/jaeger/docker-compose.yml up
  1. Run the node:
cargo run --release -- daemon \
  --peer-address=127.0.0.1:3000 \
  --network=preprod

Tip

Replace --peer-address with your Cardano node peer address. It can be either a local or remote node (i.e. any existing node relay), and you can even add multiple peers.

Tip

To ensure logs are forwarded to telemetry backend, pass --with-open-telemetry as an option before the daemon sub-command, eg.

cargo run --release -- --with-open-telemetry daemon \
 --peer-address=127.0.0.1:3000 \
 --network=preprod

Monitoring

See monitoring/README.md.

Going further

Amaru is the integration point of several other projects / repositories. Amongst them, we find in particular:

Repository Purpose
txpipe/pallas Hosts many Rust primitives and building blocks for the node already powering tools like Dolos. In particular, the networking and serialization logic.
pragma-org/uplc A highly performant UPLC parser and CEK machine.

Roadmap | 📐 Contributing | Discord Discord

About

A node client for Cardano, written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages