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

Uploaded Source

Built Distributions

antnode-0.3.6-cp38-abi3-win_amd64.whl (7.3 MB view details)

Uploaded CPython 3.8+ Windows x86-64

antnode-0.3.6-cp38-abi3-musllinux_1_2_x86_64.whl (9.4 MB view details)

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

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

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

antnode-0.3.6-cp38-abi3-musllinux_1_2_aarch64.whl (9.2 MB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

antnode-0.3.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

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

antnode-0.3.6-cp38-abi3-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

antnode-0.3.6-cp38-abi3-macosx_10_12_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for antnode-0.3.6.tar.gz
Algorithm Hash digest
SHA256 700ee20bb4f3f787eeec97e446aea539c633493b74314971ee525c189e3fd98c
MD5 f8188143f9610cd19743511329318898
BLAKE2b-256 49d1067400341888d37c537428dc72aad59423937c971e80eb3e1ae07970ad26

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for antnode-0.3.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8726ab99cfe2fd454a6a72e72f38f4ff92e4cbe4dda2911927a1b0bf44302233
MD5 112bea0c0ae1f19f268ba59c4675e767
BLAKE2b-256 09e5db9956c40c76c6ec036009354e119728f3779d98f3edda860549e8aa9dfd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5bdef33fb0255bace1fa2eea3fe88366c04c34196c31a8f7c802d436dd259edd
MD5 b45f789df7d315111eb8920ed870d3ad
BLAKE2b-256 ebaf87b21510ea315a9e5cad953a8650c1eec957a0835346fa4585418c9e4cda

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 e0f91143ea8101fb03c5d6bed7d2b1b1bce0b860816d62ed0d9ef2726503e9f8
MD5 e4e28a9a9f8fbd8d5bd8059d20afc36d
BLAKE2b-256 a1571f5c18e16f466fa09a94517e120dec9988a5ce2b2b0321e762e069edcd35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ef91f5c42220b5644bed615af74a3142606e350eb5f529f6300241f7f4ed2a4b
MD5 f10364a4eb519ab5edadff390cd048ed
BLAKE2b-256 700f2ea76d6ef524fbe0773aed7546463b50a1548b5d34b0f4a3f995bd56b92f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0819457b47f3824abdc6f96afc4835223870dbf5004fa046a3d9ffeef434ea34
MD5 c0ab3709a87af0db2415048f4db6de37
BLAKE2b-256 84a916bb72cd898098284f50135564a4002d668ff865afb853b163ee84bfafcd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae9e9fecd1a157a1c75c232ed91094ffe5c3e4c2f7c7d2396817b17a77a1c76d
MD5 4cb6c65312253fbeb75d10c7be620a82
BLAKE2b-256 37ff18f5e8708e4281f007b8d7fe813966e4bbac5329333246fc914709f64546

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for antnode-0.3.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 39725bcb583cb8f6aed76a3ff5a477d6432cfc04857103f3fdcdfbcfe92696b5
MD5 fb23ef34042b50b349e38f8d31650059
BLAKE2b-256 4153aeaab096e6b56e850d470998c7bcf030c96443a6a8c42bd8fe10fbba3369

See more details on using hashes here.

Provenance

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