Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update LevelDB implementation #102

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ build
prism-db
*.tgz
docs-html
db/
crash.log
.DS_Store
94 changes: 14 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,20 @@
# Pluto Encrypted
Is a community maintained project which aims to bring a scalable and future proof storage solution for Wallet SDK on typescript. By using this package you can ensure that this dependency will fit the AtalaPrism wallet SDK contract and provide the SDK with storage finally.

## Interface
Edge SDK Pluto interface [v4.0.0](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/interfaces/Domain.Pluto.html)
```typescript

export interface Pluto {

storeCredentialMetadata(metadata: Anoncreds.CredentialRequestMeta, linkSecret: Anoncreds.LinkSecret): Promise<void>;

fetchCredentialMetadata(linkSecretName: string): Promise<Anoncreds.CredentialRequestMeta | null>;

start(): Promise<void>;

storePrismDID(did: DID, keyPathIndex: number, privateKey: PrivateKey, privateKeyMetaId: string | null, alias?: string): Promise<void>;

storePeerDID(did: DID, privateKeys: Array<PrivateKey>): Promise<void>;

storeDIDPair(host: DID, receiver: DID, name: string): Promise<void>;

storeMessage(message: Message): Promise<void>;

storeMessages(messages: Array<Message>): Promise<void>;

storePrivateKeys(privateKey: PrivateKey, did: DID, keyPathIndex: number, metaId: string | null): Promise<void>;

storeMediator(mediator: DID, host: DID, routing: DID): Promise<void>;

storeCredential(credential: Credential): Promise<void>;

getAllPrismDIDs(): Promise<PrismDIDInfo[]>;

getDIDInfoByDID(did: DID): Promise<PrismDIDInfo | null>;

getDIDInfoByAlias(alias: string): Promise<PrismDIDInfo[]>;

getPrismDIDKeyPathIndex(did: DID): Promise<number | null>;

getPrismLastKeyPathIndex(): Promise<number>;

getAllPeerDIDs(): Promise<Array<PeerDID>>;

getDIDPrivateKeysByDID(did: DID): Promise<Array<PrivateKey>>;

getDIDPrivateKeyByID(id: string): Promise<PrivateKey | null>;

getAllDidPairs(): Promise<Array<DIDPair>>;

getPairByDID(did: DID): Promise<DIDPair | null>;

getPairByName(name: string): Promise<DIDPair | null>;

getAllMessages(): Promise<Array<Message>>;

getAllMessagesByDID(did: DID): Promise<Array<Message>>;

getAllMessagesSent(): Promise<Array<Message>>;

getAllMessagesReceived(): Promise<Array<Message>>;

getAllMessagesSentTo(did: DID): Promise<Array<Message>>;

getAllMessagesReceivedFrom(did: DID): Promise<Array<Message>>;

getAllMessagesOfType(type: string, relatedWithDID?: DID): Promise<Array<Message>>;

getAllMessagesByFromToDID(from: DID, to: DID): Promise<Array<Message>>;

getMessage(id: string): Promise<Message | null>;

getAllMediators(): Promise<Array<Mediator>>;

getAllCredentials(): Promise<Array<Credential>>;

getLinkSecret(linkSecretName?: string): Promise<Anoncreds.LinkSecret | null>;

storeLinkSecret(linkSecret: Anoncreds.LinkSecret, linkSecretName: string): Promise<void>;
}
```
Is a community maintained project which aims to bring a scalable and future proof storage solution for Wallet SDK on typescript. By using this package you can ensure that this dependency will fit the AtalaPrism wallet SDK contract and provide the SDK with storage finally.

We currently support database wrappers for IndexDB, InMemory, LevelDB.
We are not going to stop here but ensure that our SDK can be used in any platform and language.

### Documentation & Contribution Guidelines
## Documentation & Contribution Guidelines

The pluto encrypted documentation is always available on all branches [HERE](https://github.com/elribonazo/pluto-encrypted/blob/master/docs/README.md) but we have also deployed an online version of documentation.

Go to documentation portal [here](https://atala-community-projects.github.io/pluto-encrypted)

Pull requests are WELCOME!! please check the [Contribution guidelines](https://github.com/elribonazo/pluto-encrypted/blob/master/CONTRIBUTION-GUIDELINES.md) first


### How to use
## How to use

We currently provide 3 database storages - InMemory, IndexDB, and LevelDB.
These modules are designed to be used with [`@atala/prism-wallet-sdk`](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts)
Expand Down Expand Up @@ -156,3 +80,13 @@ const pluto = new Pluto(store, apollo)

const agent = Agent.initialize({ mediatorDID, pluto, apollo })
```

## Development

### Tests

```bash
npm install
npm run build
npm run test
```
Loading
Loading