Skip to content

tangle-network/eigensdk-rs

Repository files navigation

EigenSDK-RS

Rust Version License


eigensdk-rs is a Rust SDK for interacting with Eigenlayer and building AVS tooling. Additionally, it incorporates features for interacting with Tangle and utilizing our gadget, an augmented SDK for building task based AVS. Together, these two offer a comprehensive solution for building applications with both Eigenlayer and Tangle. This SDK is a high-performance, reliable, and efficient library that integrates seamlessly with Eigenlayer's ecosystem while leveraging the many advantages of Rust.

It should be noted that this SDK is still being actively developed and has not undergone a professional audit. Please use at your own risk in production.


Table of Contents


Features

  • Full Eigenlayer Integration: Provides all the robust functionalities of eigensdk-go, now with the performance benefits of Rust.
  • Unlimited Customization: Equipped with all the tools needed to build custom AVSs, including those that leverage our advanced Gadget capabilities.
  • High Performance: Developed with Rust to deliver superior efficiency and speed, ensuring your applications run optimally.
  • Enhanced Type Safety: Takes advantage of Rust's strong type system to create more reliable and maintainable code.
  • Advanced Concurrency: Utilizes Rust's concurrency model to enable safe and efficient multi-threaded operations.
  • Go Implementation Compatibility: Achieves full feature parity with the Go version, facilitating straightforward porting of applications from Go to Rust.
  • Comprehensive API Access: Provides complete access to all Eigen network functionalities, empowering developers to fully exploit the platform's potential.

Getting Started

Installation

Clone the repository:

git clone https://github.com/webb-tools/eigensdk-rs/
cd eigensdk-rs

Usage

Building

cargo build --release

or to use EigenSDK-RS in your own Rust project, just add the following dependency to your Cargo.toml:

[dependencies]
eigensdk-rs = { git = "https://github.com/webb-tools/eigensdk-rs" }

Running an AVS

To programmatically start an AVS operator:

  1. Create a new operator, supplying the necessary inputs (dependent upon the AVS you are running). The following is a general example that a real implementation would closely follow. The config is dependent upon the AVS you are running.
let operator = Operator::new_from_config(
	config,
	http_provider,
	ws_provider,
	operator_info_service,
	signer,
)
.await?;
  1. With the operator, simply run the start function:
operator.start().await?;

Testing

This repository both contains tests for the included AVSs and provides the tools necessary to test custom AVSs you build with this SDK.

Running the included tests

To run the tests from the command line, you can run the following commands in the root directory:

  1. You can manually build all smart contracts, though there are build scripts to automatically build them.
./test-utils/scripts/build.sh
  1. Set the environment variables for running the tests.
. ./test-utils/scripts/env_setup.sh
  1. Run the test for the AVS you would like to test.

Incredible Squaring AVS

cargo test -p test-utils test_incredible_squaring_full

The full test starts a local Anvil testnet, deploys all the required contracts to it, and then starts an operator.

Running the Testnets as binaries

  1. Build
cargo build --release -p test-utils
  1. Run

Incredible Squaring AVS's Testnet

./target/release/incredible-squaring

Contributing

To contribute:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes and ensure tests pass.
  4. Submit a pull request with a detailed description of your changes.

License

Gadget is licensed under either of the following: