Skip to content
Open
Show file tree
Hide file tree
Changes from 10 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
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
<a href="#🚀-getting-started">🚀 Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#library-installation">Library Installation</a></li>
<li><a href="#installation-for-developers">Installation for developers</a></li>
</ul>
</li>
<li><a href="#📄-license">📄 License</a></li>
Expand Down Expand Up @@ -172,21 +173,49 @@ In order to use in the local environment, make sure to [run the local DKG networ

<br/>

### Installation
### Library Installation

Create virtual environment (you can choose any existing folder this command will create configurations and virtual env for python):
Run the command to install dkg.py library using pip:

```bash
pip install dkg
```

pip x:

```bash
pipx install dkg
```

or poetry:

```bash
poetry add dkg
```

<br/>

More information about the library can be found in the [documentation](https://docs.origintrail.io/dkg-v8-current-version/v8-dkg-sdk/dkg-v8-py-client).

---

<br/>

### Installation for developers

Create a virtual environment (you can choose any existing folder). This command will create configurations and virtual env for python:

```bash
python3 -m venv /path/to/folder
```

Inside of previously generated folder you will find activate script in bin folder and run it:
Inside of previously generated folder you will find the 'activate' script in bin folder. Run it:

```bash
source /path/to/folder/bin/activate
```

Install dependencies and configure pre-commit hooks:
Install dependencies and configure pre-commit hooks for linting and formatting:

```bash
make install
Expand Down
5 changes: 5 additions & 0 deletions dkg/clients/async_dkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from dkg.providers.blockchain.async_blockchain import AsyncBlockchainProvider
from dkg.providers.node.async_node_http import AsyncNodeHTTPProvider
from dkg.services.node_services.async_node_service import AsyncNodeService
from dkg.modules.paranet.async_paranet import AsyncParanet
from dkg.services.blockchain_services.async_blockchain_service import (
AsyncBlockchainService,
)
Expand All @@ -38,6 +39,7 @@ class AsyncDKG(AsyncModule):
asset: AsyncKnowledgeAsset
node: AsyncNode
graph: AsyncGraph
paranet: AsyncParanet

def __init__(
self,
Expand All @@ -58,6 +60,9 @@ def __init__(
),
"node": AsyncNode(self.manager, self.node_service),
"graph": AsyncGraph(self.manager, self.input_service, self.node_service),
"paranet": AsyncParanet(
self.manager, self.input_service, self.blockchain_service
),
}
self._attach_modules(modules)

Expand Down
4 changes: 3 additions & 1 deletion dkg/clients/dkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def __init__(
self.node_service,
self.blockchain_service,
),
"paranet": Paranet(self.manager),
"paranet": Paranet(
self.manager, self.input_service, self.blockchain_service
),
"network": Network(self.manager),
"node": Node(self.manager),
"graph": Graph(self.manager, self.input_service, self.node_service),
Expand Down
39 changes: 39 additions & 0 deletions dkg/data/interfaces/KnowledgeCollection.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,45 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paranetKnowledgeCollectionsRegistry",
"outputs": [
{
"internalType": "contract ParanetKnowledgeCollectionsRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paranetKnowledgeMinersRegistry",
"outputs": [
{
"internalType": "contract ParanetKnowledgeMinersRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paranetsRegistry",
"outputs": [
{
"internalType": "contract ParanetsRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paymasterManager",
Expand Down
Loading