Arkiv Python SDK.
Reason this release was yanked:
new users should not "see" pre 1.0.0x version"
Project description
Arkiv
This is part of the Arkiv project, which is designed as a Layer2 Network deployed on Ethereum, acting as a gateway to various Layer 3 Database Chains (DB-Chains).
For an overview of Arkiv, check out our Litepaper.
Arkiv SDK for Python
This SDK allows you to use Arkiv from Python. It is available on PyPI.
We also publish generated documentation.
The repo also contains an example application to showcase how you can use this SDK.
Tip: For getting up and running quickly, we recommend the following two steps:
-
Start golembase-op-geth through its docker-compose.
(Note: As an alternative to installing the demo CLI, you can build the actual CLI as it's included in the golembase-op-geth repo.)
When you create a user, it will generate a private key file called wallet.json and store it in:
~/.config/golembase/on Linux~/Library/Application Support/golembase/on macOS%LOCALAPPDATA%\golembase\on Windows
(This is a standard folder as per the XDG specification.)
You will also need to fund the account. You can do so by typing:
golembase-demo-cli account fund 10
Getting Started Example
Here's how you can get going with the SDK. First, create a new folder to hold your project:
mkdir arkiv-sdk-practice
cd arkiv-sdk-practice
Then create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Next, install the Arkiv SDK from PyPI:
pip install arkiv-sdk
You can find some base starter code here; copy the __init__.py into your project folder.
This is a basic Python application that:
-
Imports several items from the SDK (
arkiv_sdk), including:ArkivClient: A class that creates a client to interact with ArkivArkivCreate: A class representing a create transaction in ArkivArkivExtend: A class for extending entity lifetimeAnnotation: A class for key-value annotations
-
Reads the private key, which it locates using the
xdgmodule. -
Sets up logging with the standard Python
loggingmodule. -
The
main()function follows, which is where the bulk of the example code runs.
The main function demonstrates how to create, extend, and query entities:
-
Creates a client object that connects to the Arkiv network (e.g., Kaolin testnet) using
rpcandwsURLs, and your private key. -
Subscribes to log events from the network (create, update, delete, extend).
-
Creates an entity with data
"hello", BTL of60, and an annotation of("foo", "bar"). -
Prints various metadata and state:
- The latest block
- Entity count before and after creation
- Entity metadata
- Storage value
- Entity expiration info
- Query results by annotation
-
Extends the created entity’s lifetime using
client.extend_entities. -
Lists entities owned by your account, and all known entity keys.
Building and Running from sources
You can also, from this cloned repo, build the SDK and run the example using Nix:
nix build .#arkiv-sdk-example
./result/bin/main
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arkiv_sdk-0.2.2.tar.gz.
File metadata
- Download URL: arkiv_sdk-0.2.2.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bebe035696553f0426d827c2c0e5073d294fcfdb3ca4cb13df702cb95bb2869d
|
|
| MD5 |
849203ac40bfd7f6835933f995a2b22e
|
|
| BLAKE2b-256 |
57433bca690c70ce6e2ceb65c27d0e099fa4eda6fcc580778b488ef6ee0d7dc3
|
File details
Details for the file arkiv_sdk-0.2.2-py3-none-any.whl.
File metadata
- Download URL: arkiv_sdk-0.2.2-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b8dcfef5d188f3160816246aba9bc7380fc0cced9d911947ef266f5a5d6c493
|
|
| MD5 |
c5779e658aee00ecd767167e3da39ebc
|
|
| BLAKE2b-256 |
87f924db46aa3732dfafe46c17e3f021eccb0ca08f3c206b0f47d56df4daba1d
|