This API allows users to directly use kv-service of the ResilientDB in Python
- Make sure you have installed bazel5.0 and pybind11
- cd to
incubator-resilientdb/api
folder - Run command
bazel build :pybind_kv_so
- From
kv_operation.py
importget_value
andset_value
function into your Python file to use it (Make sure to use same python version when runbazel build
command and call the functions)
key
: The key user want to store in key-value pair. Acceptable types arestr
,int
,float
value
: Thekey
's corresponding value in key-value pair. Acceptable types arestr
,int
,float
config_path
(optional): The absolute path to user's blockchain config file(ip addresses). If user does not specify this parameter, system will use main chain as default. Acceptable type isstr
return
:True
ifvalue
has been set successfully, otherwisevalue
has not been set successfully.
key
: The key user want to get in key-value pair. Acceptable types arestr
,int
,float
return
:\n
if the corresponding value ofkey
is empty, otherwise is corresponding value ofkey
import sys
# Your path to ResilientDB api folder
sys.path.append("/home/ubuntu/Desktop/incubator-resilientdb/api")
from kv_operation import set_value, get_value
set_value("test", "111222")
get_value("test")