Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Golem Base
# GolemDB

This is part of the [Golem Base](https://github.com/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).
This is part of the [GolemDB](https://github.com/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](https://golem-base.io/wp-content/uploads/2025/03/GolemBase-Litepaper.pdf).**
> **For an overview of GolemDB, check out our [Litepaper](https://golem-base.io/wp-content/uploads/2025/03/GolemDB-Litepaper.pdf).**

# GolemBase SDK for Python
# GolemDB SDK for Python

This SDK allows you to use [GolemBase](https://github.com/Golem-Base) from Python. It is available [on PyPI](https://pypi.org/project/golem-base-sdk/).
This SDK allows you to use [GolemDB](https://github.com/Golem-Base) from Python. It is available [on PyPI](https://pypi.org/project/golem-base-sdk/).

We also publish [generated documentation](https://golem-base.github.io/python-sdk/).

Expand Down Expand Up @@ -50,7 +50,7 @@ python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

Next, install the GolemBase SDK from PyPI:
Next, install the GolemDB SDK from PyPI:

```bash
pip install golem-base-sdk
Expand All @@ -62,9 +62,9 @@ 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
* `GolemDBClient`: A class that creates a client to interact with GolemDB
* `GolemDBCreate`: A class representing a create transaction in GolemDB
* `GolemDBExtend`: A class for extending entity lifetime
* `Annotation`: A class for key-value annotations

- Reads the private key, which it locates using the `xdg` module.
Expand All @@ -75,7 +75,7 @@ This is a basic Python application that:

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.
- Creates a client object that connects to the GolemDB 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).

Expand Down
30 changes: 14 additions & 16 deletions example/golem_base_sdk_example/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""GolemBase Python SDK."""
"""GolemDB Python SDK."""

import argparse
import asyncio
Expand All @@ -7,11 +7,11 @@

from golem_base_sdk import (
Annotation,
GolemBaseClient,
GolemBaseCreate,
GolemBaseDelete,
GolemBaseExtend,
GolemBaseUpdate,
GolemDBClient,
GolemDBCreate,
GolemDBDelete,
GolemDBExtend,
GolemDBUpdate,
WalletError,
decrypt_wallet,
)
Expand Down Expand Up @@ -66,7 +66,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
except KeyboardInterrupt:
print("\nOperation cancelled by user.")

client = await GolemBaseClient.create(
client = await GolemDBClient.create(
rpc_url=INSTANCE_URLS[instance]["rpc"],
ws_url=INSTANCE_URLS[instance]["ws"],
private_key=key_bytes,
Expand Down Expand Up @@ -123,7 +123,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
""")

create_receipt = await client.create_entities(
[GolemBaseCreate(b"hello", 60, [Annotation("app", "demo")], [])]
[GolemDBCreate(b"hello", 60, [Annotation("app", "demo")], [])]
)
entity_key = create_receipt[0].entity_key
logger.info("receipt: %s", create_receipt)
Expand All @@ -146,9 +146,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
await client.get_entities_to_expire_at_block(metadata.expires_at_block),
)

[extend_receipt] = await client.extend_entities(
[GolemBaseExtend(entity_key, 60)]
)
[extend_receipt] = await client.extend_entities([GolemDBExtend(entity_key, 60)])
logger.info("receipt: %s", extend_receipt)

logger.info(
Expand All @@ -175,7 +173,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
"block number: %s", await client.http_client().eth.get_block_number()
)
[update_receipt] = await client.update_entities(
[GolemBaseUpdate(entity_key, b"hello", 60, [Annotation("app", "demo")], [])]
[GolemDBUpdate(entity_key, b"hello", 60, [Annotation("app", "demo")], [])]
)
logger.info("receipt: %s", update_receipt)
entity_key = update_receipt.entity_key
Expand All @@ -202,7 +200,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
"block number: %s", await client.http_client().eth.get_block_number()
)

receipt = await client.delete_entities([GolemBaseDelete(entity_key)])
receipt = await client.delete_entities([GolemDBDelete(entity_key)])
logger.info("receipt: %s", receipt)

logger.info(
Expand All @@ -224,7 +222,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
""")

create_receipt = await client.create_entities(
[GolemBaseCreate(b"hello", 60, [Annotation("app", "demo")], [])]
[GolemDBCreate(b"hello", 60, [Annotation("app", "demo")], [])]
)
entity_key = create_receipt[0].entity_key
logger.info("receipt: %s", create_receipt)
Expand All @@ -235,7 +233,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915
metadata = await client.get_entity_metadata(entity_key)
logger.info("entity metadata: %s", metadata)

await client.delete_entities([GolemBaseDelete(entity_key)])
await client.delete_entities([GolemDBDelete(entity_key)])
else:
logger.warning("Could not connect to the API...")

Expand All @@ -244,7 +242,7 @@ async def run_example(instance: str) -> None: # noqa: PLR0915

def main() -> None:
"""Run the example."""
parser = argparse.ArgumentParser(description="GolemBase Python SDK Example")
parser = argparse.ArgumentParser(description="GolemDB Python SDK Example")
parser.add_argument(
"--instance",
choices=INSTANCE_URLS.keys(),
Expand Down
2 changes: 1 addition & 1 deletion example/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading