Send your consents securely to other FDS users
Consent manager with pure awesomenes of FDS.js
## Installation
- clone the FDS.js repo
- change directory to the FDS repo (MULTIBOX branch)
- run
npm link
in this directory, you should have output similar to...
/Users/user/.nvm/versions/node/v8.11.2/lib/node_modules/fds -> /Users/user/Code/df/FDS
- clone this repo and cd into it
- run
npm install
- run
npm link fds
, you should have output similar to.../Users/user/Code/df/fds-consent-manager/node_modules/fds -> /Users/user/.nvm/versions/node/v8.11.2/lib/node_modules/fds -> /Users/user/Code/df/FDS
- run
npm start
- you should be able to access the project using Chrome at http://localhost:3000
DataReceipt.js library uses fds.js library to send consent receipt files over Swarm to another account
to run it uncomment line 35 in App.js
- create account
- unlock account
- load project file
- load private key
- generate cr.jwt token
- send cr.jwt token to accountname/yourself and wait for delivery
- get all received files
- for each received file check if its cr.jwt token
- decode token and verify
- log out all messages that are cr.jwt tokens
Library provides functionality to create new consents on noordung blockchain.
let CM = await fd.getConsentManager();
let tx = await CM.createConsent(userAddress, subjectAddress, "0x" + swarmHash);
let uc = await CM.getUserConsents();
let sc = await CM.getSubjectConsents();
let cf = await CM.getConsentsFor("0x" + swarmHash);
let consent = await fd.getConsent(address);
let us = await consent.isUserSigned();
await consent.signUser();
let ss = await consent.isSubjectSigned();
await consent.signSubject();
let tx = await CM.updateConsent(consent, "0x" + newSwarmHash);
Updating consent will revoke updated one, and create new one. Old one will have property
updatedConsent
changed from 0x0000000000000000000000000000000000000000
If updated anything else than address(0x0) then consent was updated with another consent
updated = await consent.isUpdatedWith();
updated will contain address of updated consent
us = await consent.isUserSigned();
ss = await consent.isSubjectSigned();
s = await consent.isSigned();
v = await consent.isValid();
status = await consent.status();
Status values:
0 - waiting for signatures
1 - active
2 - expired
3 - revoked