Skip to content

Commit 7d879d7

Browse files
Initial commit
Signed-off-by: George J Padayatti <[email protected]>
0 parents  commit 7d879d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+8688
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IDE
2+
.vscode/
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
.DS_Store
9+
build/
10+
*.egg-info/

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Aries Cloud Agent - Python Plugin for MyData DID DIDComm protcol
2+
3+
## ACA-Py Version Compatibility
4+
5+
To avoid a confusing pseudo-lock-step release, this plugin is
6+
versioned independent of ACA-Py. Plugin releases will follow standard
7+
[semver](semver.org) but each release will also be tagged with a mapping to an
8+
ACA-Py version with the format `acapy-X.Y.Z-J` where `X.Y.Z` corresponds to the
9+
ACA-Py version supported and `J` is an incrementing number for each new plugin
10+
release that targets the same version of ACA-Py.
11+
12+
You should look for the most recent release tagged with the version of ACA-Py
13+
you are using (with the highest value for `J`).
14+
15+
## Installation
16+
17+
Requirements:
18+
- Python 3.6 or higher
19+
- ACA-Py
20+
21+
### Setup Aries Cloud Agent - Python
22+
23+
If you already have an existing installation of ACA-Py, you can skip these steps
24+
and move on to [plugin installation](#plugin-installation). It is also worth
25+
noting that this is not the only way to setup an ACA-Py instance. For more setup
26+
configurations, see the [Aries Cloud Agent - Python
27+
repository](https://github.com/hyperledger/aries-cloudagent-python).
28+
29+
First, clone
30+
[ACA-Py](https://github.com/hyperledger/aries-cloudagent-python) and prepare a
31+
virtual environment:
32+
```sh
33+
$ git clone https://github.com/hyperledger/aries-cloudagent-python
34+
$ cd aries-cloudagent-python
35+
$ python3 -m venv env
36+
$ source env/bin/activate
37+
```
38+
39+
Install ACA-Py into the virtual environment:
40+
```sh
41+
$ pip install -e .
42+
```
43+
**Or** include the `indy` feature if you want to use Indy ledgers or wallets:
44+
```sh
45+
$ pip install -e .[indy]
46+
```
47+
48+
### Plugin Installation
49+
50+
Install this plugin into the virtual environment:
51+
52+
```sh
53+
$ pip install git+https://github.com/decentralised-dataexchange/acapy-mydata-did-protocol.git@master#egg=mydata_did
54+
```
55+
56+
**Note:** Depending on your version of `pip`, you may need to drop the
57+
`#egg=...` to install the plugin with the above command.
58+
59+
### Plugin Loading
60+
Start up ACA-Py with the plugin parameter:
61+
```sh
62+
$ aca-py start \
63+
-it http localhost 3000 -it ws localhost 3001 \
64+
-ot http \
65+
-e http://localhost:3000 ws://localhost:3001 \
66+
--plugin "mydata_did"
67+
```

manifest.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include requirements.txt
2+
recursive-include mydata_did *

mydata_did/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
import logging
3+
4+
from aries_cloudagent.config.injection_context import InjectionContext
5+
from aries_cloudagent.config.provider import ClassProvider
6+
from aries_cloudagent.core.protocol_registry import ProtocolRegistry
7+
8+
from .v1_0.message_types import MESSAGE_TYPES
9+
from .dispatcher import Dispatcher
10+
from .definition import versions
11+
12+
13+
async def setup(context: InjectionContext):
14+
protocol_registry: ProtocolRegistry = await context.inject(ProtocolRegistry)
15+
protocol_registry.register_message_types(MESSAGE_TYPES, version_definition=versions[0])
16+
17+
dispatcher = Dispatcher(context)
18+
context.injector.bind_instance(Dispatcher, dispatcher)
19+
20+
print(context)

mydata_did/definition.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Version definitions for this protocol."""
2+
3+
versions = [
4+
{
5+
"major_version": 1,
6+
"minimum_minor_version": 0,
7+
"current_minor_version": 0,
8+
"path": "v1_0",
9+
}
10+
]

0 commit comments

Comments
 (0)