###Install & Run
cd wallet
yarn install
bower install
ember s
Contracts source code is located in contracts/
The Consents contract is the one currently used. It can be used as a 'singleton' contract that contains state on all consents. The following function can be called on the contract:
function requestConsent(address customer, address data_owner, uint id)
Called by the data requester. Assumes the consent id parameter is globally unique.function updateConsent(address data_owner, address data_requester, uint id, State state) returns (bool)
Called by customer. State should be 1 or 3 for for given/rejected (currently not enforced).function requestData(address customer, address data_owner, uint id)
Called by data requester.function provideData(address customer, address data_requester, uint id, bytes payload)
Called by data owner.
All function calls generates an event (which can be used to check the return value of the function call).
Parties that call a contract function, must have enough ether to pay for the transaction.
Due to the global nature of the contract and to Solidity/Ethereum VM limitations, reading data from the contract is somewhat convoluted currently. A customer's contracts can be retrieved by:
function customerConsents(address customer)
returns the number of consents for the customer- Look up in the public accessible
customer_mapping
with customer address and index (0 - number of consents) returns the indices (one for each lookup) in the public accessibleconsents
array - A consent can be retrieved from the
consents
array using an index
An example can be seen in wallet/app/routes/consents.js.
The contract can be removed by calling the kill()
function, which can only be called by the account that deployed the contract.
https://ethereum.github.io/browser-solidity can be used to experiment with, develop and debug the contract.
##Create consent
- Create two accounts: for data owner and data requestor (both should have some money on them).
cd dataowner
make
node index.js datao@example.com password 0x9a804CF13E3defb1043D2B81BE95D14C787c94Dc
cd datarequestor
make
node index.js datar@example.com password 0xA04A6A76F1E23D80E075f490a2E23daACB65d0A9 person@gmail.com datao@example.com
- Approve/Disaprove from wallet app