Skip to main content

Golem Base

This is part of the Golem Base 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 Golem Base, check out our Litepaper.

GolemBase SDK for Python

This SDK allows you to use GolemBase 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:

(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 golem-sdk-practice
cd golem-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 GolemBase SDK from PyPI:

pip install golem-base-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 (golem_base_sdk), including:

    • GolemBaseClient: A class that creates a client to interact with GolemBase
    • GolemBaseCreate: A class representing a create transaction in GolemBase
    • GolemBaseExtend: A class for extending entity lifetime
    • Annotation: A class for key-value annotations
  • Reads the private key, which it locates using the xdg module.

  • Sets up logging with the standard Python logging module.

  • 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 GolemBase network (e.g., Kaolin testnet) using rpc and ws URLs, and your private key.

  • Subscribes to log events from the network (create, update, delete, extend).

  • Creates an entity with data "hello", BTL of 60, 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 .#golem-base-sdk-example
./result/bin/main

Release files for golem-base-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for golem-base-sdk 0.1.0
File Size Uploaded
golem_base_sdk-0.1.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for golem-base-sdk 0.1.0
File Interpreter ABI Platform
golem_base_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.8 kB

Release files / golem_base_sdk-0.1.0.tar.gz

Download URL golem_base_sdk-0.1.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fa8dae61272168a29f497f00a2fcfdad78ccbab30cde8a8663e40834f3b90b02
BLAKE2b-256 checksum
How to use checksums
7d018da84dbe5d0665d52f90eced01dd98251f86a31d552f37bcb579e1cd815c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.6

Release files / golem_base_sdk-0.1.0-py3-none-any.whl

Download URL golem_base_sdk-0.1.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5425c7e77775337e3f4c92d1adb8d53490c6761f74f296d96975b75069d42833
BLAKE2b-256 checksum
How to use checksums
6a4850fcbfa5f07bf93b932167e64ef989780917b3d272b7eb6a95d709b22bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page