Skip to content

Commit

Permalink
correct SmartDataAccessResponse, which is missing txnType and respons…
Browse files Browse the repository at this point in the history
…eType
  • Loading branch information
Dave Potter committed Feb 6, 2020
1 parent 48cbbaa commit 54bc673
Show file tree
Hide file tree
Showing 24 changed files with 198 additions and 158 deletions.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/howto.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/types.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d31657610195c5c43ddbc78a88d6e4cd
config: 8e973fc2ec7adae513c97196f0b46cbc
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 2 additions & 2 deletions docs/_build/html/_sources/howto.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ All S-DACs must comply with the :ref:`Smart Data Access Contract Interface <Sdac

Here is an example of a simple contract that automatically terminates after a given number of days. It permits access for a single Requester and permits the Owner or Requester to terminate at any time.

.. code-block::
.. code-block:: solidity
pragma solidity ^0.5.1;
Expand Down Expand Up @@ -77,7 +77,7 @@ Here is an example :ref:`Smart Data Access Request Packet<SmartDataAccessRequest

In this case the Requester has added a *customerId* field to the accept and reject transaction templates. This number will be added to the response that the Owner returns to the Requester.

.. code-block::
.. code-block:: json
{
"txnType": "SmartDataAccessRequest",
Expand Down
43 changes: 29 additions & 14 deletions docs/_build/html/_sources/types.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SignedTransaction

All Datona transactions are sent as a SignedTransaction, which contains the raw Transaction_ and a digital signature.

.. code-block::
.. code-block:: json
{
"txn": Transaction,
Expand All @@ -96,7 +96,7 @@ Transaction

All transactions in the Datona Protocol have the following JSON structure:

.. code-block::
.. code-block:: json
{
"txnType": String,
Expand Down Expand Up @@ -146,7 +146,7 @@ Error

Error responses contain the fields of a DatonaError.

.. code-block::
.. code-block:: json
{
"txnType": "GeneralResponse",
Expand All @@ -162,6 +162,8 @@ Error responses contain the fields of a DatonaError.
:widths: 20 80
:header-rows: 1

* - Field
- Description
* - name
- *(String)* Name of error
* - message
Expand Down Expand Up @@ -192,7 +194,7 @@ SmartDataAccessRequestPacket

The following JSON gives the minimal template spec for a Smart Data Access request from Requester to Owner.

.. code-block::
.. code-block:: json
{
"txnType": "SmartDataAccessRequest",
Expand Down Expand Up @@ -250,13 +252,13 @@ SmartDataAccessResponse

An accept response consists of copying the acceptTransaction object from the SmartDataAccessRequestPacket and adding the following elements:

.. code-block::
.. code-block:: json
{
"txnType": "SmartDataAccessResponse",
"responseType": "accept",
"contract": Address,
"vault": Address,
"vaultAddress": Address,
"vaultUrl": {
"scheme": String,
"host": String,
Expand All @@ -274,11 +276,24 @@ An accept response consists of copying the acceptTransaction object from the Sma
- Description
* - contract
- *(Address)* Blockchain address of the deployed S-DAC
* - contract.hash
- *(Hash)* keccak256 hash of the requested S-DAC’s runtime bytecode
* - vaultAddress
- *(Address)* Public address of the vault server (used to authenticate all comms with the server)
* - vaultUrl
- *(URL)* URL of the Requester’s server that will handle the response.


A reject response consists of copying the rejectTransaction object from the SmartDataAccessRequestPacket and adding the following elements:

.. code-block:: json
{
"txnType": "SmartDataAccessResponse",
"responseType": "reject",
"reason": String
}
... elements copied from the rejectTransaction object (if any)
------------------------------------------------------------------------------

.. _VaultRequestProtocol:
Expand All @@ -298,7 +313,7 @@ One of the following JSON requests:
create
~~~~~~

.. code-block::
.. code-block:: json
{
"txnType": "VaultRequest",
Expand All @@ -310,7 +325,7 @@ create
update
~~~~~~

.. code-block::
.. code-block:: json
{
"txnType": "VaultRequest",
Expand All @@ -322,7 +337,7 @@ update
access
~~~~~~

.. code-block::
.. code-block:: json
{
"txnType": "VaultRequest",
Expand All @@ -333,7 +348,7 @@ access
delete
~~~~~~

.. code-block::
.. code-block:: json
{
"txnType": "VaultRequest",
Expand Down Expand Up @@ -369,7 +384,7 @@ success

A success response conforms with the GeneralServerResponse_ Acknowledgement format. If responding to an access request, the response will additionally contain a ``data`` field with returned vault contents.

.. code-block::
.. code-block:: json
{
"txnType": "VaultResponse",
Expand All @@ -382,7 +397,7 @@ error

An error response conforms with the GeneralServerResponse_ Error format.

.. code-block::
.. code-block:: json
{
"txnType": "VaultResponse",
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/datona-blockchain.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="datona-vault" href="datona-vault.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/datona-comms.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Core Types" href="types.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/datona-crypto.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="datona-comms" href="datona-comms.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/datona-errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Core Types" href="types.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/datona-vault.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="datona-crypto" href="datona-crypto.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="#" />
<link rel="search" title="Search" href="search.html" />
</head>
Expand Down
31 changes: 15 additions & 16 deletions docs/_build/html/howto.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="datona-blockchain" href="datona-blockchain.html" />
Expand Down Expand Up @@ -218,7 +217,7 @@ <h2><a class="toc-backref" href="#id1">Requesters</a><a class="headerlink" href=
<span id="buildsdac"></span><h3><a class="toc-backref" href="#id2">Building a Smart Data Access Contract</a><a class="headerlink" href="#building-a-smart-data-access-contract" title="Permalink to this headline"></a></h3>
<p>All S-DACs must comply with the <a class="reference internal" href="types.html#sdacinterface"><span class="std std-ref">Smart Data Access Contract Interface</span></a> but the implementation will depend on the use case. S-DACs can be simple, for example to give indefinite access until terminated; or they can be highly complex giving access to different Requesters depending on a complex workflow supported by external blockchain oracles.</p>
<p>Here is an example of a simple contract that automatically terminates after a given number of days. It permits access for a single Requester and permits the Owner or Requester to terminate at any time.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>pragma solidity ^0.5.1;
<div class="highlight-solidity notranslate"><div class="highlight"><pre><span></span>pragma solidity ^0.5.1;

contract Duration_SDAC is SDAC {

Expand Down Expand Up @@ -265,23 +264,23 @@ <h2><a class="toc-backref" href="#id1">Requesters</a><a class="headerlink" href=
<h3><a class="toc-backref" href="#id3">Building a Smart Data Access Request</a><a class="headerlink" href="#building-a-smart-data-access-request" title="Permalink to this headline"></a></h3>
<p>Here is an example <a class="reference internal" href="types.html#smartdataaccessrequestpacket"><span class="std std-ref">Smart Data Access Request Packet</span></a> for passing to a data owner. The <em>hash</em> in this request is a hash of the runtime bytecode of the Duration_SDAC above. The <em>url</em> in this request is the URL of the Requester’s server that will handle a <a class="reference internal" href="types.html#smartdataaccessresponse"><span class="std std-ref">Smart Data Access Response Packet</span></a> from the Owner.</p>
<p>In this case the Requester has added a <em>customerId</em> field to the accept and reject transaction templates. This number will be added to the response that the Owner returns to the Requester.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;txnType&quot;</span><span class="p">:</span> <span class="s2">&quot;SmartDataAccessRequest&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.1&quot;</span><span class="p">,</span>
<span class="s2">&quot;contract&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;hash&quot;</span><span class="p">:</span> <span class="s2">&quot;5573012304cc4d87a7a07253c728e08250db6821a3dfdbbbcac9a24f8cd89ad4&quot;</span><span class="p">,</span>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;txnType&quot;</span><span class="p">:</span> <span class="s2">&quot;SmartDataAccessRequest&quot;</span><span class="p">,</span>
<span class="nt">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.1&quot;</span><span class="p">,</span>
<span class="nt">&quot;contract&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;hash&quot;</span><span class="p">:</span> <span class="s2">&quot;5573012304cc4d87a7a07253c728e08250db6821a3dfdbbbcac9a24f8cd89ad4&quot;</span><span class="p">,</span>
<span class="p">},</span>
<span class="s2">&quot;api&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;file&quot;</span><span class="p">,</span>
<span class="s2">&quot;host&quot;</span><span class="p">:</span> <span class="s2">&quot;my.server.io&quot;</span><span class="p">,</span>
<span class="s2">&quot;port&quot;</span><span class="p">:</span> <span class="s2">&quot;8601&quot;</span>
<span class="nt">&quot;api&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;url&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;file&quot;</span><span class="p">,</span>
<span class="nt">&quot;host&quot;</span><span class="p">:</span> <span class="s2">&quot;my.server.io&quot;</span><span class="p">,</span>
<span class="nt">&quot;port&quot;</span><span class="p">:</span> <span class="s2">&quot;8601&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;acceptTransaction&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;customerId&quot;</span><span class="p">:</span> <span class="s2">&quot;10001&quot;</span>
<span class="nt">&quot;acceptTransaction&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;customerId&quot;</span><span class="p">:</span> <span class="s2">&quot;10001&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;rejectTransaction&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;customerId&quot;</span><span class="p">:</span> <span class="s2">&quot;10001&quot;</span>
<span class="nt">&quot;rejectTransaction&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;customerId&quot;</span><span class="p">:</span> <span class="s2">&quot;10001&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="What Is Smart Data Access?" href="what.html" />
Expand Down
1 change: 0 additions & 1 deletion docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="#" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 54bc673

Please sign in to comment.