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.7rc3.tar.gz (423.0 kB view details)

Uploaded Source

Built Distributions

antnode-0.3.7rc3-cp38-abi3-win_amd64.whl (7.2 MB view details)

Uploaded CPython 3.8+ Windows x86-64

antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_x86_64.whl (9.3 MB view details)

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

antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_armv7l.whl (9.0 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_aarch64.whl (9.1 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

antnode-0.3.7rc3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

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

antnode-0.3.7rc3-cp38-abi3-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

antnode-0.3.7rc3-cp38-abi3-macosx_10_12_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file antnode-0.3.7rc3.tar.gz.

File metadata

  • Download URL: antnode-0.3.7rc3.tar.gz
  • Upload date:
  • Size: 423.0 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.7rc3.tar.gz
Algorithm Hash digest
SHA256 f101c7bc49674f44aed00197739a114400028460318aec4ad88d1dcdc493bdd8
MD5 9210cbcc0257cb26a64e934509c75595
BLAKE2b-256 a9e82570bb3a203cb618c1310c136cc0aa03addf9cde44073babd87ce2692f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3.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.7rc3-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4100eb7bb7e060cfc2c8b0f478879e50f0db2aa6cd78915de58ceb99efd08313
MD5 375f567b7a2848e2d48aa3f060d05db2
BLAKE2b-256 bc8d151d23dea295c8dc61d16f50f2924d925277990e08992708cf22f6c9efd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 29d1c98b162bc4d37b05331b2a889c9a24026f9ef5632cc6368fe4d5b77f312c
MD5 cd92515819641ff1fc1c4cb122665491
BLAKE2b-256 4f9ffbfdd7c9ee8ac007367aced98efa95a425d03f25b8632fb22be3ff8a91a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 229537f348b972b2a190363a105cdd9d1ba8b8e83291ffde90f29b33f44f5ce0
MD5 698ff5b7abae9b44bf5114dfaa1370f5
BLAKE2b-256 84953f5f3c38589690ce804cf50d341a0bb1df4faaf8d92335be2ce4e5c7bc32

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7759a0265ffad8fae07b752b9144fac63312d9e0160675ad71c8cc9847e65da6
MD5 6d073240e265dbc7ec8429ddad5fc0aa
BLAKE2b-256 8746b186e7a5cfbc5758b6c302306e09366e10458dffe2c4e5c098ca9351c42d

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac5af8eefec84604b2ea823aaf78137b35bd3494af1cbc885cedc60f3d52ed01
MD5 966cbe4e20e70c4cfa2ce9c538da34d6
BLAKE2b-256 85415e90f839a874ab0c8e0ebff185f7fcc7dcf247012bb7000902fb020b7f86

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bff5ffcc98708b8c9efd0016eeaa9eafaa2f8437ac8b43458a39ed3c4060bae5
MD5 7392bdb9ce3d255b9336a384ffd92b92
BLAKE2b-256 85b08c64a3becabc1b5f509f067bf8c3392a4a1041bf51b7ebac0713d37cc4db

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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.7rc3-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for antnode-0.3.7rc3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f82c058a12bd78e6cbf21c7c677676b31ea3474a35d94dcbb851400c01a9ea0c
MD5 a298b8df164f6b2ccea8d8e7949c3a71
BLAKE2b-256 e346b9d1b998e2b8ca220bb4869fdd5a8ec092a750955d7885026339a144f779

See more details on using hashes here.

Provenance

The following attestation bundles were made for antnode-0.3.7rc3-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