You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -79,15 +82,38 @@ This server has two functions:
79
82
- Uploading a tails file
80
83
- Downloading a tails file
81
84
82
-
### Uploading
85
+
For each of those operations, there are two endpoints, one based on the
86
+
Revocation Registry ID, and the other based on the hash of the tails file to be
87
+
load/retrieved.
83
88
84
-
To upload a tails file, make a `PUT` request to `/{revoc_reg_id}` as a multipart file upload with 2 fields. The **first** field _must_ be named `genesis` and the **second** field _must_ be named `tails`. `genesis` should be the genesis transactions file and `tails` should be the tails file. The server supports chunked encoding for streaming very large tails files.
89
+
### Uploading
85
90
86
-
The server will lookup the relevant revocation registry definition and check the integrity of the file against `fileHash` on the ledger. If it's good, it will store the file. Otherwise it will respond with response code `400`. If `revoc_reg_id` does not exist on the ledger, the server will respond with response code `404`. If the file already exists on the server, it will respond with response code `409`.
91
+
To upload a tails file using the Revocation Registry ID, make a `PUT` request to
92
+
`/{revoc_reg_id}` as a multipart file upload with 2 fields. The **first** field
93
+
_must_ be named `genesis` and the **second** field _must_ be named `tails`.
94
+
`genesis` should be the genesis transactions file and `tails` should be the
95
+
tails file. The server supports chunked encoding for streaming very large tails
96
+
files. The server will lookup the relevant revocation registry definition and
97
+
check the integrity of the file against `fileHash` on the ledger. If it's good,
98
+
it will store the file. Otherwise it will respond with response code `400`. If
99
+
`revoc_reg_id` does not exist on the ledger, the server will respond with
100
+
response code `404`. If the file already exists on the server, it will respond
101
+
with response code `409`.
102
+
103
+
To upload a tails file using the hash endpoint, use the `PUT /hash/{tails-hash}`
104
+
endpoint to upload the file, validate the hash against the uploaded file, and
105
+
ensure the tails file "looks" like a tails file by carrying out several checks
106
+
of the contents.
87
107
88
108
### Downloading
89
109
90
-
A simple `GET` request will download a tails file. The path is `/{revoc_reg_id}` where `revoc_reg_id` is a valid id. If it doesn't exist, the server will respond with response code `404`.
110
+
For downloading a file using the Revocation Registry ID, execute a `GET` request
111
+
with the path `/{revoc_reg_id}` where `revoc_reg_id` is a valid id. If it
112
+
doesn't exist, the server will respond with response code `404`.
113
+
114
+
For downloading a file using the tails file hash, execute a `GET
115
+
/hash/{tails-hash}`. If a file with that hash doesn't exist, the server will
116
+
respond with response code `404`.
91
117
92
118
## Guarantees
93
119
@@ -96,20 +122,40 @@ This software is designed to support scaling to as many machines or processes as
96
122
## Tests
97
123
98
124
There is a suite of integration tests that test some assumptions about the environment like the type of mounted file system and the ledger that is being connected to. For running these tests a local von-network needs to be running, you can spin one up by
125
+
99
126
```
100
127
git clone https://github.com/bcgov/von-network
101
128
cd von-network
102
129
./manage build
103
130
./manage start
104
131
```
132
+
105
133
After the von-network is up, goto the tails-server docker directory, run the manage script as follows.
134
+
106
135
```
107
136
cd indy-tails-server/docker
108
137
./manage test
109
138
```
110
-
This will perform a series of tests creating revocation registries with a local tails-server.
139
+
140
+
This will perform a series of tests creating revocation registries with a local tails-server. Some notes:
141
+
142
+
- The tests can only be run once per run of VON Network (error `UnauthorizedClientRequest`). To rerun, bring down von-network (`./manage down; ./manage start` in the von-network repository clone) and rerun the tests.
143
+
- Wait a bit after starting von-network (15-20 seconds) before running the indy-tails-server tests, as you will get an error (`Server disconnected...`) if you start too quickly. If you get that error, try again and it should work.
144
+
145
+
If you want to run a local copy for testing with other deployments, here are some things you can try:
146
+
147
+
- After starting your docker Tails File instance, run the [ACA-Py Alice-Faber
148
+
Demo with Revocation](https://aca-py.org/main/demo/#revocation).
149
+
- After starting your docker Tails File instance, run the [Aries Agent Test
150
+
Harness](https://github.com/hyperledger/aries-agent-test-harness) (AATH). For
151
+
example, after cloning the AATH repo, run the command `./manage runset acapy -b`
152
+
to build and run the standard set of tests with ACA-Py. AATH detects that a
153
+
tails file is already running locally, and so will use that instance.
111
154
112
155
## Additional Notes
113
156
114
-
Due to how revocation works in Indy, there is the expectation/requirement that the tails server public URL will be stable over time.
115
-
Failing to satisfy this requirement will cause failures when issuing and/or verifying credentials for which the credential definition was created/registered on an "old" tails server url.
157
+
Due to how revocation works in Hyperledger Indy, there is the expectation/requirement that
158
+
the tails server public URL will be stable over time. Failing to satisfy this
159
+
requirement will cause failures when issuing and/or verifying credentials for
160
+
which the credential definition was created/registered on an "old" tails server
0 commit comments