|
|
@@ -1,40 +1,34 @@
|
|
|
# darkfi-sdk-py
|
|
|
|
|
|
-## Bootstrap
|
|
|
+Python bindings for some parts of the `darkfi-sdk` and the `zkvm`.
|
|
|
|
|
|
-This python sdk requires a virtual environment, along with a build tool.
|
|
|
-To create the environment, execute:
|
|
|
-```
|
|
|
-$ make bootstrap
|
|
|
-```
|
|
|
-You may find more information in [pyo3](https://pyo3.rs/v0.15.1/#using-rust-from-python)
|
|
|
-setup guide.
|
|
|
+## Build and install
|
|
|
|
|
|
-## Development
|
|
|
+1. Install `maturin` via your package manager or from whatever source.
|
|
|
+2. Run `make` to build the wheel
|
|
|
+3. (Optional) Run pip install --user <path_to_wheel>
|
|
|
|
|
|
-### Build
|
|
|
+## Development
|
|
|
|
|
|
-After successfully bootstrapping the virtual environment,
|
|
|
-you can build the sdk by simply executing:
|
|
|
-```
|
|
|
-$ make
|
|
|
-```
|
|
|
+For a development version you can use a venv:
|
|
|
|
|
|
-After all development is finished, you need to remove
|
|
|
-the virtual envirnment folder, as it breaks rest make
|
|
|
-operations in the repo, so just execute:
|
|
|
```
|
|
|
-$ make clean
|
|
|
+$ python3 -m venv venv
|
|
|
+$ source venv/bin/activate
|
|
|
+(venv) $ maturin develop --release
|
|
|
```
|
|
|
|
|
|
-### Usage example
|
|
|
+## Usage
|
|
|
|
|
|
```
|
|
|
$ python3
|
|
|
-from darkfi_sdk_py.base import Base
|
|
|
-a = Base.from_u64(42)
|
|
|
-b = Base.from_u64(69)
|
|
|
-a + b == Base.from_u64(111)
|
|
|
+>>> import darkfi_sdk_py
|
|
|
+>>> darkfi_sdk_py.__dir__()
|
|
|
+>>>
|
|
|
+>>> from darkfi_sdk_py.base import Base
|
|
|
+>>> a = Base.from_u64(42)
|
|
|
+>>> b = Base.from_u64(69)
|
|
|
+>>> a + b == Base.from_u64(111)
|
|
|
```
|
|
|
|
|
|
### Randomness
|