Skip to main content

The Autonomi node binary

Project description

Autonomi Node

Overview

The ant-node directory provides the antnode binary and Python bindings for the Safe Network node implementation. This directory contains the core logic for node operations, including API definitions, error handling, event management, and data validation.

Table of Contents

Installation

Binary Installation

Follow the main project's installation guide to set up the antnode binary.

Python Installation

To install the Python bindings, you'll need:

  • Python 3.8 or newer
  • Rust toolchain
  • maturin (pip install maturin)

Install the package using:

maturin develop

Usage

Binary Usage

To run the antnode binary, follow the instructions in the main project's usage guide.

Python Usage

The Python module provides a comprehensive interface to run and manage Safe Network nodes. Here's a complete overview:

Basic Node Operations

from antnode import AntNode

# Create and start a node
node = AntNode()
node.run(
    rewards_address="0x1234567890123456789012345678901234567890",  # Your EVM wallet address
    evm_network="arbitrum_sepolia",  # or "arbitrum_one" for mainnet
    ip="0.0.0.0",
    port=12000,
    initial_peers=[
        "/ip4/142.93.37.4/udp/40184/quic-v1/p2p/12D3KooWPC8q7QGZsmuTtCYxZ2s3FPXPZcS8LVKkayXkVFkqDEQB",
    ],
    local=False,
    root_dir=None,  # Uses default directory
    home_network=False
)

Available Methods

Node Information:

  • peer_id(): Get the node's peer ID
  • get_rewards_address(): Get current rewards/wallet address
  • set_rewards_address(address: str): Set new rewards address (requires restart)
  • get_kbuckets(): Get routing table information
  • get_all_record_addresses(): Get all stored record addresses

Storage Operations:

  • store_record(key: str, value: bytes, record_type: str): Store data
    • key: Hex string
    • value: Bytes to store
    • record_type: "chunk" or "scratchpad"
  • get_record(key: str) -> Optional[bytes]: Retrieve stored data
  • delete_record(key: str) -> bool: Delete stored data
  • get_stored_records_size() -> int: Get total size of stored data

Directory Management:

  • get_root_dir() -> str: Get current root directory path
  • get_default_root_dir(peer_id: Optional[str]) -> str: Get default root directory
  • get_logs_dir() -> str: Get logs directory path
  • get_data_dir() -> str: Get data storage directory path

Directory Management Example

# Get various directory paths
root_dir = node.get_root_dir()
logs_dir = node.get_logs_dir()
data_dir = node.get_data_dir()

# Get default directory for a specific peer
default_dir = AntNode.get_default_root_dir(peer_id)

Important Notes

  • Initial peers list should contain currently active network peers
  • Rewards address must be a valid EVM address
  • Changing rewards address requires node restart
  • Storage keys must be valid hex strings
  • Record types are limited to 'chunk' and 'scratchpad'
  • Directory paths are platform-specific
  • Custom root directories can be set at node startup

Directory Structure

  • src/: Source code files
    • api.rs: API definitions
    • error.rs: Error types and handling
    • event.rs: Event-related logic
    • get_validation.rs: Validation for GET requests
    • put_validation.rs: Validation for PUT requests
    • replication.rs: Data replication logic
  • tests/: Test files
    • common/mod.rs: Common utilities for tests
    • data_with_churn.rs: Tests related to data with churn
    • sequential_transfers.rs: Tests for sequential data transfers
    • storage_payments.rs: Tests related to storage payments
    • verify_data_location.rs: Tests for verifying data locations

Testing

To run tests, navigate to the ant-node directory and execute:

cargo test

Contributing

Please feel free to clone and modify this project. Pull requests are welcome.

Conventional Commits

We follow the Conventional Commits specification for all commits. Make sure your commit messages adhere to this standard.

License

This Safe Network repository is licensed under the General Public License (GPL), version 3 (LICENSE http://www.gnu.org/licenses/gpl-3.0.en.html).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antnode-0.3.8.tar.gz (421.4 kB view details)

Uploaded Source

Built Distributions

antnode-0.3.8-cp38-abi3-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.8+ Windows x86-64

antnode-0.3.8-cp38-abi3-musllinux_1_2_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ x86-64

antnode-0.3.8-cp38-abi3-musllinux_1_2_armv7l.whl (8.8 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

antnode-0.3.8-cp38-abi3-musllinux_1_2_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

antnode-0.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

antnode-0.3.8-cp38-abi3-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

antnode-0.3.8-cp38-abi3-macosx_10_12_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file antnode-0.3.8.tar.gz.

File metadata

  • Download URL: antnode-0.3.8.tar.gz
  • Upload date:
  • Size: 421.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for antnode-0.3.8.tar.gz
Algorithm Hash digest
SHA256 ac5e3efadf6734e417eaf9fe9f3171a6dca4e6c02934da3a3198f6c1f8c7992b
MD5 5d3957afb5f21d81f4f09a53b2ab16a0
BLAKE2b-256 12c8f942f428bc42d27df1c2853170c45bc49d9ee9d557c7b54c66832053d632

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8.tar.gz:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: antnode-0.3.8-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for antnode-0.3.8-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 80f090d2262e03b07576f3042d7a4ce8fc07f0c3741de4a7c48aa14e5e948dc5
MD5 4867e4feca5a0c4bdb503bfa966d9e52
BLAKE2b-256 115e51f8492e19fd17ba1a99521954d0791a26817ae8ee0a7b2365a14030bdb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-win_amd64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fe5df545cb9fb2964b16306c9738008552e5dc63e666ec956928a14498645829
MD5 e5c29e5a5d130653e5c801c326ca498c
BLAKE2b-256 e5639e7d21c712969669604eea988f88588b24312f1f337f2ff218e7cda25e05

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 de4134159cac8772e456a2ed349c352ce5a624d9ccb166718f034ed09c611ea5
MD5 2ef911715d353aa77ddde7fe9bf8d95c
BLAKE2b-256 a768fa73a1f872b2e61387e6fdf4e830ce8bd752603ba50d917bba8c92eb88e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-musllinux_1_2_armv7l.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8ff2937f33c6e2e5b4f87f7e9ee6b6606957dcee97ef4463e7665582a502c36b
MD5 2106578ba49775aecf3d07de5ab4a226
BLAKE2b-256 b72d396fe3f0e6f2fc31958b688401415572868be2dd0662c82f4449aabac5be

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d0b2d321f550b0cd3a3b4bd0c33d2d93cf9f605c76fd2b4b9a8b549f6aadd07
MD5 1502b62d2d2597fdde99460358d691cd
BLAKE2b-256 b4d3c4cef9d34cc1d3499586f68516be130e633e65a89bd6c6b2b5a21accb743

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd5cb03b4d3961452703dd3561aa47b55234e5805f00779ee9a5e27f8e798d91
MD5 4c43f317a56eba6276e52fbb126ca459
BLAKE2b-256 ce670173b1a943d6ca67e38228335c8b546e4a8493da79e0d5407d6194a1966e

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antnode-0.3.8-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.8-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4b9c24c2535a098473c154f90eb3b56063d4552d3528f96baea846793bc60894
MD5 96b027423d2fc8b50819dfb1f42169d5
BLAKE2b-256 6d40d64c0eab890d71ae41a0f0ed79b2169941b834af5eb38db49ca83b74441b

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.8-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: python-publish-node.yml on dirvine/autonomi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page