Python SDK for ResilientDB

Clone this repo:
  1. 025980e Merge pull request #23 from ResilientEcosystem/getalltxn-timeout by Glenn Chen · 4 months ago main
  2. 9cd5fe0 scan db endpoint timeout by Glenn Chen · 4 months ago getalltxn-timeout
  3. d6fbaa6 Merge pull request #22 from ResilientEcosystem/bugfix by Glenn Chen · 5 months ago
  4. e75f0a3 fix num transactions on refresh by Glenn Chen · 5 months ago
  5. d7f7971 Merge pull request #21 from resilientdb/fix-populatetable by Glenn Chen · 5 months ago

ResilientDB SDK

Check Python is up-to-date (3.9+)

$ python3 --version

If your Python version number is too low you may encounter type hinting issues when attempting to run the code. You can use a Python virtual environment, as shown below.

First-time set up

$ sh INSTALL.sh

$ python3.10 -m venv venv

$ source venv/bin/activate

$ pip install -r requirements.txt

The correct Python configuration is needed for transaction validation.

Running KV service

If your virtual environment is not already active:

$ source venv/bin/activate

Run the script to start 4 local nodes

$ sh service/tools/start_kv_service_sdk.sh

Running Crow service (HTTP endpoints)

$ bazel build service/http_server/crow_service_main

$ bazel-bin/service/http_server/crow_service_main service/tools/config/interface/client.config service/http_server/server_config.config

For a list of endpoints visit here

Testing

$ bazel-bin/service/kv_service/kv_service_tools service/tools/config/interface/service.config set test 1234

Running the driver

Examples of using the driver can be seen in test_driver

Replace the db_root_url with the address of the ResilientDB HTTP endpoints e.g. 127.0.0.1:18000

TODO

  • Setting up linting (using black) through github hooks
  • convert the sdk into a package (for pip install)
  • Potentially have a docker setup which fetched the Resdb image and runs it locally