ruby-libstorj 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +111 -0
- data/Guardfile +21 -0
- data/LICENSE +502 -0
- data/README.md +262 -0
- data/Rakefile +76 -0
- data/ext/libstorj/.gitignore +47 -0
- data/ext/libstorj/.travis.yml +27 -0
- data/ext/libstorj/Doxyfile +2427 -0
- data/ext/libstorj/LICENSE +502 -0
- data/ext/libstorj/Makefile.am +6 -0
- data/ext/libstorj/README.md +198 -0
- data/ext/libstorj/autogen.sh +3 -0
- data/ext/libstorj/configure.ac +64 -0
- data/ext/libstorj/depends/Makefile +153 -0
- data/ext/libstorj/depends/config.guess +1462 -0
- data/ext/libstorj/depends/config.sub +1823 -0
- data/ext/libstorj/depends/extract-osx-sdk.sh +33 -0
- data/ext/libstorj/depends/packages/cctools.mk +7 -0
- data/ext/libstorj/depends/packages/clang.mk +7 -0
- data/ext/libstorj/depends/packages/gmp.mk +23 -0
- data/ext/libstorj/depends/packages/gnutls.mk +25 -0
- data/ext/libstorj/depends/packages/json-c.mk +7 -0
- data/ext/libstorj/depends/packages/libcurl.mk +39 -0
- data/ext/libstorj/depends/packages/libmicrohttpd.mk +7 -0
- data/ext/libstorj/depends/packages/libuv.mk +7 -0
- data/ext/libstorj/depends/packages/nettle.mk +30 -0
- data/ext/libstorj/libstorj.pc.in +11 -0
- data/ext/libstorj/src/Makefile.am +23 -0
- data/ext/libstorj/src/bip39.c +233 -0
- data/ext/libstorj/src/bip39.h +64 -0
- data/ext/libstorj/src/bip39_english.h +2074 -0
- data/ext/libstorj/src/cli.c +1494 -0
- data/ext/libstorj/src/crypto.c +525 -0
- data/ext/libstorj/src/crypto.h +178 -0
- data/ext/libstorj/src/downloader.c +1923 -0
- data/ext/libstorj/src/downloader.h +163 -0
- data/ext/libstorj/src/http.c +688 -0
- data/ext/libstorj/src/http.h +175 -0
- data/ext/libstorj/src/rs.c +962 -0
- data/ext/libstorj/src/rs.h +99 -0
- data/ext/libstorj/src/storj.c +1523 -0
- data/ext/libstorj/src/storj.h +1014 -0
- data/ext/libstorj/src/uploader.c +2736 -0
- data/ext/libstorj/src/uploader.h +181 -0
- data/ext/libstorj/src/utils.c +336 -0
- data/ext/libstorj/src/utils.h +65 -0
- data/ext/libstorj/test/Makefile.am +27 -0
- data/ext/libstorj/test/mockbridge.c +260 -0
- data/ext/libstorj/test/mockbridge.json +687 -0
- data/ext/libstorj/test/mockbridgeinfo.json +1836 -0
- data/ext/libstorj/test/mockfarmer.c +358 -0
- data/ext/libstorj/test/storjtests.h +41 -0
- data/ext/libstorj/test/tests.c +1617 -0
- data/ext/libstorj/test/tests_rs.c +869 -0
- data/ext/ruby-libstorj/extconf.rb +8 -0
- data/ext/ruby-libstorj/ruby-libstorj.cc +17 -0
- data/lib/ruby-libstorj.rb +1 -0
- data/lib/ruby-libstorj/arg_forwarding_task.rb +58 -0
- data/lib/ruby-libstorj/env.rb +178 -0
- data/lib/ruby-libstorj/ext/bucket.rb +71 -0
- data/lib/ruby-libstorj/ext/create_bucket_request.rb +53 -0
- data/lib/ruby-libstorj/ext/curl_code.rb +139 -0
- data/lib/ruby-libstorj/ext/ext.rb +71 -0
- data/lib/ruby-libstorj/ext/file.rb +84 -0
- data/lib/ruby-libstorj/ext/get_bucket_request.rb +45 -0
- data/lib/ruby-libstorj/ext/json_request.rb +51 -0
- data/lib/ruby-libstorj/ext/list_files_request.rb +63 -0
- data/lib/ruby-libstorj/ext/types.rb +226 -0
- data/lib/ruby-libstorj/ext/upload_options.rb +38 -0
- data/lib/ruby-libstorj/libstorj.rb +22 -0
- data/lib/ruby-libstorj/mixins/storj.rb +27 -0
- data/lib/ruby-libstorj/struct.rb +42 -0
- data/ruby-libstorj.gemspec +57 -0
- data/spec/helpers/options.yml.example +22 -0
- data/spec/helpers/shared_rake_examples.rb +132 -0
- data/spec/helpers/storj_options.rb +96 -0
- data/spec/helpers/upload.data +3 -0
- data/spec/helpers/upload.data.sha256 +1 -0
- data/spec/libstorj_spec.rb +0 -0
- data/spec/ruby-libstorj/arg_forwarding_task_spec.rb +311 -0
- data/spec/ruby-libstorj/env_spec.rb +353 -0
- data/spec/ruby-libstorj/ext_spec.rb +75 -0
- data/spec/ruby-libstorj/json_request_spec.rb +13 -0
- data/spec/ruby-libstorj/libstorj_spec.rb +81 -0
- data/spec/ruby-libstorj/struct_spec.rb +64 -0
- data/spec/spec_helper.rb +113 -0
- metadata +136 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file utils.h
|
|
3
|
+
* @brief Storj utilities.
|
|
4
|
+
*
|
|
5
|
+
* Helper utilities
|
|
6
|
+
*/
|
|
7
|
+
#ifndef STORJ_UTILS_H
|
|
8
|
+
#define STORJ_UTILS_H
|
|
9
|
+
#define _GNU_SOURCE
|
|
10
|
+
|
|
11
|
+
#include <assert.h>
|
|
12
|
+
#include <errno.h>
|
|
13
|
+
#include <math.h>
|
|
14
|
+
#include <nettle/base16.h>
|
|
15
|
+
#include <stdarg.h>
|
|
16
|
+
#include <stdbool.h>
|
|
17
|
+
#include <stdint.h>
|
|
18
|
+
#include <stdio.h>
|
|
19
|
+
#include <stdlib.h>
|
|
20
|
+
#include <string.h>
|
|
21
|
+
#include <fcntl.h>
|
|
22
|
+
#include <unistd.h>
|
|
23
|
+
|
|
24
|
+
#ifdef _WIN32
|
|
25
|
+
#include <windows.h>
|
|
26
|
+
#include <time.h>
|
|
27
|
+
#include <io.h>
|
|
28
|
+
|
|
29
|
+
ssize_t pread(int fd, void *buf, size_t count, uint64_t offset);
|
|
30
|
+
ssize_t pwrite(int fd, const void *buf, size_t count, uint64_t offset);
|
|
31
|
+
|
|
32
|
+
#else
|
|
33
|
+
#include <sys/time.h>
|
|
34
|
+
#include <sys/mman.h>
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
#define MAX_SHARD_SIZE 4294967296 // 4Gb
|
|
38
|
+
#define MIN_SHARD_SIZE 2097152 // 2Mb
|
|
39
|
+
#define SHARD_MULTIPLES_BACK 4
|
|
40
|
+
|
|
41
|
+
int allocatefile(int fd, uint64_t length);
|
|
42
|
+
|
|
43
|
+
char *hex2str(size_t length, uint8_t *data);
|
|
44
|
+
|
|
45
|
+
void print_int_array(uint8_t *array, unsigned length);
|
|
46
|
+
|
|
47
|
+
uint8_t *str2hex(size_t length, char *data);
|
|
48
|
+
|
|
49
|
+
char *str_concat_many(int count, ...);
|
|
50
|
+
|
|
51
|
+
void random_buffer(uint8_t *buf, size_t len);
|
|
52
|
+
|
|
53
|
+
uint64_t shard_size(int hops);
|
|
54
|
+
|
|
55
|
+
uint64_t get_time_milliseconds();
|
|
56
|
+
|
|
57
|
+
void memset_zero(void *v, size_t n);
|
|
58
|
+
|
|
59
|
+
uint64_t determine_shard_size(uint64_t file_size, int accumulator);
|
|
60
|
+
|
|
61
|
+
int unmap_file(uint8_t *map, uint64_t filesize);
|
|
62
|
+
|
|
63
|
+
int map_file(int fd, uint64_t filesize, uint8_t **map, bool read_only);
|
|
64
|
+
|
|
65
|
+
#endif /* STORJ_UTILS_H */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
noinst_PROGRAMS = tests tests_rs
|
|
2
|
+
tests_SOURCES = mockbridge.c mockfarmer.c tests.c storjtests.h $(top_builddir)/src/storj.h mockbridge.json.h mockbridgeinfo.json.h
|
|
3
|
+
tests_LDADD = $(top_builddir)/src/libstorj.la
|
|
4
|
+
tests_LDFLAGS = -Wall -g
|
|
5
|
+
|
|
6
|
+
if BUILD_STORJ_DLL
|
|
7
|
+
tests_LDFLAGS += -lmicrohttpd $(top_builddir)/src/.libs/rs.o $(top_builddir)/src/.libs/bip39.o $(top_builddir)/src/.libs/crypto.o $(top_builddir)/src/.libs/utils.o
|
|
8
|
+
else
|
|
9
|
+
tests_LDFLAGS += -static -lmicrohttpd
|
|
10
|
+
endif
|
|
11
|
+
|
|
12
|
+
tests_rs_SOURCES = tests_rs.c
|
|
13
|
+
tests_rs_LDFLAGS = -Wall -g
|
|
14
|
+
TESTS = tests tests_rs
|
|
15
|
+
|
|
16
|
+
CLEANFILES = mockbridge.json.h mockbridgeinfo.json.h
|
|
17
|
+
|
|
18
|
+
mockbridge.c: mockbridge.json.h mockbridgeinfo.json.h
|
|
19
|
+
|
|
20
|
+
%.json.h: %.json
|
|
21
|
+
@$(MKDIR_P) $(@D)
|
|
22
|
+
@{ \
|
|
23
|
+
echo "static const char $(*F)_json[] = {" && \
|
|
24
|
+
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
|
|
25
|
+
echo "};"; \
|
|
26
|
+
} > "$@.new" && mv -f "$@.new" "$@"
|
|
27
|
+
@echo "Generated $@"
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
#include "storjtests.h"
|
|
2
|
+
|
|
3
|
+
char *get_response_string(json_object *obj, const char *key)
|
|
4
|
+
{
|
|
5
|
+
struct json_object* value;
|
|
6
|
+
if (json_object_object_get_ex(obj, key, &value)) {
|
|
7
|
+
return (char *)json_object_get_string(value);
|
|
8
|
+
} else {
|
|
9
|
+
printf("Could not get string for key %s", key);
|
|
10
|
+
exit(1);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
bool check_auth(char *user, char *pass, int *status_code, char *page)
|
|
15
|
+
{
|
|
16
|
+
if (user && 0 == strcmp(user, USER) && 0 == strcmp(pass, PASSHASH)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
*status_code = MHD_HTTP_UNAUTHORIZED;
|
|
21
|
+
page = "Unauthorized";
|
|
22
|
+
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
int parse_json(const char *json, json_object **responses)
|
|
27
|
+
{
|
|
28
|
+
json_tokener *tok = json_tokener_new();
|
|
29
|
+
|
|
30
|
+
int stringlen = 0;
|
|
31
|
+
enum json_tokener_error jerr;
|
|
32
|
+
do {
|
|
33
|
+
stringlen = strlen(json);
|
|
34
|
+
*responses = json_tokener_parse_ex(tok, json, stringlen);
|
|
35
|
+
} while ((jerr = json_tokener_get_error(tok)) == json_tokener_continue);
|
|
36
|
+
|
|
37
|
+
if (jerr != json_tokener_success) {
|
|
38
|
+
fprintf(stderr, "JSON Error: %s\n", json_tokener_error_desc(jerr));
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
json_tokener_free(tok);
|
|
43
|
+
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
int mock_bridge_server(void *cls,
|
|
48
|
+
struct MHD_Connection *connection,
|
|
49
|
+
const char *url,
|
|
50
|
+
const char *method,
|
|
51
|
+
const char *version,
|
|
52
|
+
const char *upload_data,
|
|
53
|
+
size_t *upload_data_size,
|
|
54
|
+
void **ptr)
|
|
55
|
+
{
|
|
56
|
+
|
|
57
|
+
struct MHD_Response *response;
|
|
58
|
+
|
|
59
|
+
json_object *responses = NULL;
|
|
60
|
+
if (parse_json(mockbridge_json, &responses)) {
|
|
61
|
+
printf("Failed to parse JSON responses.\n");
|
|
62
|
+
exit(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
json_object *responses_info = NULL;
|
|
66
|
+
if (parse_json(mockbridgeinfo_json, &responses_info)) {
|
|
67
|
+
printf("Failed to parse JSON info response.\n");
|
|
68
|
+
exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
char *page = "Not Found";
|
|
72
|
+
int status_code = MHD_HTTP_NOT_FOUND;
|
|
73
|
+
|
|
74
|
+
int ret;
|
|
75
|
+
|
|
76
|
+
char *pass = NULL;
|
|
77
|
+
char *user = MHD_basic_auth_get_username_password(connection, &pass);
|
|
78
|
+
|
|
79
|
+
if (0 == strcmp(method, "GET")) {
|
|
80
|
+
if (0 == strcmp(url, "/")) {
|
|
81
|
+
page = get_response_string(responses_info, "info");
|
|
82
|
+
status_code = MHD_HTTP_OK;
|
|
83
|
+
} else if (0 == strcmp(url, "/buckets")) {
|
|
84
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
85
|
+
page = get_response_string(responses, "getbuckets");
|
|
86
|
+
status_code = MHD_HTTP_OK;
|
|
87
|
+
}
|
|
88
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5")) {
|
|
89
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
90
|
+
page = get_response_string(responses, "getbucket");
|
|
91
|
+
status_code = MHD_HTTP_OK;
|
|
92
|
+
}
|
|
93
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files")) {
|
|
94
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
95
|
+
page = get_response_string(responses, "listfiles");
|
|
96
|
+
status_code = MHD_HTTP_OK;
|
|
97
|
+
}
|
|
98
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files/998960317b6725a3f8080c2b/info")) {
|
|
99
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
100
|
+
page = get_response_string(responses, "getfileinfo");
|
|
101
|
+
status_code = MHD_HTTP_OK;
|
|
102
|
+
}
|
|
103
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/file-ids/hTY5wsqYyLJQppCMiFQI7v2n/IZZiKb0ES1RCrUqK7Fe5m0/+fYwh+E/vp8M3FCEECle63BhlWlHi/Hj/Yg5y/bIjy8SxQ==")) {
|
|
104
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
105
|
+
status_code = MHD_HTTP_NOT_FOUND;
|
|
106
|
+
}
|
|
107
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files/998960317b6725a3f8080c2b")) {
|
|
108
|
+
// TODO check token auth
|
|
109
|
+
|
|
110
|
+
const char* skip = MHD_lookup_connection_value(connection,
|
|
111
|
+
MHD_GET_ARGUMENT_KIND,
|
|
112
|
+
"skip");
|
|
113
|
+
if (!skip || 0 == strcmp(skip, "0")) {
|
|
114
|
+
page = get_response_string(responses, "getfilepointers-0");
|
|
115
|
+
status_code = MHD_HTTP_OK;
|
|
116
|
+
} else if (0 == strcmp(skip, "3")) {
|
|
117
|
+
page = get_response_string(responses, "getfilepointers-1");
|
|
118
|
+
status_code = MHD_HTTP_OK;
|
|
119
|
+
} else if (0 == strcmp(skip, "6")) {
|
|
120
|
+
page = get_response_string(responses, "getfilepointers-2");
|
|
121
|
+
status_code = MHD_HTTP_OK;
|
|
122
|
+
} else if (0 == strcmp(skip, "9")) {
|
|
123
|
+
page = get_response_string(responses, "getfilepointers-3");
|
|
124
|
+
status_code = MHD_HTTP_OK;
|
|
125
|
+
} else if (0 == strcmp(skip, "12")) {
|
|
126
|
+
page = get_response_string(responses, "getfilepointers-4");
|
|
127
|
+
status_code = MHD_HTTP_OK;
|
|
128
|
+
} else if (0 == strcmp(skip, "15")) {
|
|
129
|
+
page = get_response_string(responses, "getfilepointers-5");
|
|
130
|
+
status_code = MHD_HTTP_OK;
|
|
131
|
+
} else if (0 == strcmp(skip, "4")) {
|
|
132
|
+
// TODO check exclude and limit query
|
|
133
|
+
page = get_response_string(responses, "getfilepointers-r");
|
|
134
|
+
status_code = MHD_HTTP_OK;
|
|
135
|
+
} else if (0 == strcmp(skip, "14")) {
|
|
136
|
+
// parity-shard
|
|
137
|
+
page = get_response_string(responses, "getfilepointers-missing");
|
|
138
|
+
status_code = MHD_HTTP_OK;
|
|
139
|
+
} else {
|
|
140
|
+
page = "[]";
|
|
141
|
+
status_code = MHD_HTTP_OK;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
} else if (0 == strcmp(url, "/frames")) {
|
|
145
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
146
|
+
page = get_response_string(responses, "getframes");
|
|
147
|
+
status_code = MHD_HTTP_OK;
|
|
148
|
+
}
|
|
149
|
+
} else if (0 == strcmp(url, "/frames/d4af71ab00e15b0c1a7b6ab2")) {
|
|
150
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
151
|
+
page = get_response_string(responses, "getframe");
|
|
152
|
+
status_code = MHD_HTTP_OK;
|
|
153
|
+
}
|
|
154
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files/998960317b6725a3f8080c2b/mirrors")) {
|
|
155
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
156
|
+
page = get_response_string(responses, "listmirrors");
|
|
157
|
+
status_code = MHD_HTTP_OK;
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
printf("url: %s\n", url);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
} else if (0 == strcmp(method, "POST")) {
|
|
164
|
+
|
|
165
|
+
if (0 == strcmp(url, "/reports/exchanges")) {
|
|
166
|
+
// TODO check post body
|
|
167
|
+
page = "{}";
|
|
168
|
+
status_code = 201;
|
|
169
|
+
} else if (0 == strcmp(url, "/buckets")) {
|
|
170
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
171
|
+
// TODO check post body
|
|
172
|
+
page = get_response_string(responses, "putbuckets");
|
|
173
|
+
status_code = MHD_HTTP_OK;
|
|
174
|
+
}
|
|
175
|
+
} else if (0 == strcmp(url, "/frames")) {
|
|
176
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
177
|
+
// TODO check post body
|
|
178
|
+
page = get_response_string(responses, "createframe");
|
|
179
|
+
status_code = MHD_HTTP_OK;
|
|
180
|
+
}
|
|
181
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/tokens")) {
|
|
182
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
183
|
+
// TODO check post body
|
|
184
|
+
page = get_response_string(responses, "createbuckettoken");
|
|
185
|
+
status_code = 201;
|
|
186
|
+
}
|
|
187
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files")) {
|
|
188
|
+
// For test upload
|
|
189
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
190
|
+
page = get_response_string(responses, "createfile");
|
|
191
|
+
status_code = 201;
|
|
192
|
+
}
|
|
193
|
+
} else if (0 == strcmp(url, "/users")) {
|
|
194
|
+
page = get_response_string(responses, "createuser");
|
|
195
|
+
status_code = 201;
|
|
196
|
+
}
|
|
197
|
+
} else if (0 == strcmp(method, "PUT")) {
|
|
198
|
+
if (0 == strcmp(url, "/frames/d6367831f7f1b117ffdd0015")) {
|
|
199
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
200
|
+
// TODO check post body
|
|
201
|
+
page = get_response_string(responses, "putframe");
|
|
202
|
+
status_code = MHD_HTTP_OK;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} else if (0 == strcmp(method, "DELETE")) {
|
|
206
|
+
if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5")) {
|
|
207
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
208
|
+
// TODO check post body
|
|
209
|
+
// there is no response body
|
|
210
|
+
page = NULL;
|
|
211
|
+
status_code = 204;
|
|
212
|
+
}
|
|
213
|
+
} else if (0 == strcmp(url, "/buckets/368be0816766b28fd5f43af5/files/998960317b6725a3f8080c2b")) {
|
|
214
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
215
|
+
// TODO check post body
|
|
216
|
+
// there is no response body
|
|
217
|
+
status_code = MHD_HTTP_OK;
|
|
218
|
+
}
|
|
219
|
+
} else if (0 == strcmp(url, "/frames/d4af71ab00e15b0c1a7b6ab2")) {
|
|
220
|
+
if (check_auth(user, pass, &status_code, page)) {
|
|
221
|
+
// TODO check post body
|
|
222
|
+
status_code = MHD_HTTP_OK;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (page) {
|
|
228
|
+
int page_len = strlen(page);
|
|
229
|
+
char *page_cpy = calloc(page_len + 1, sizeof(char));
|
|
230
|
+
memcpy(page_cpy, page, page_len);
|
|
231
|
+
|
|
232
|
+
response = MHD_create_response_from_buffer(page_len,
|
|
233
|
+
(void *) page_cpy,
|
|
234
|
+
MHD_RESPMEM_MUST_FREE);
|
|
235
|
+
} else {
|
|
236
|
+
response = MHD_create_response_from_buffer(0,
|
|
237
|
+
NULL,
|
|
238
|
+
MHD_RESPMEM_MUST_FREE);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
*ptr = NULL;
|
|
242
|
+
|
|
243
|
+
ret = MHD_queue_response(connection, status_code, response);
|
|
244
|
+
if (ret == MHD_NO) {
|
|
245
|
+
fprintf(stderr, "MHD_queue_response ERROR: Bad args were passed " \
|
|
246
|
+
"(e.g. null value), or another error occurred" \
|
|
247
|
+
"(e.g. reply was already sent)\n");
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
MHD_destroy_response(response);
|
|
251
|
+
|
|
252
|
+
if (pass) {
|
|
253
|
+
free(pass);
|
|
254
|
+
}
|
|
255
|
+
free(user);
|
|
256
|
+
json_object_put(responses);
|
|
257
|
+
json_object_put(responses_info);
|
|
258
|
+
|
|
259
|
+
return ret;
|
|
260
|
+
}
|
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
{
|
|
2
|
+
"getbuckets": [
|
|
3
|
+
{
|
|
4
|
+
"user": "user@sample.com",
|
|
5
|
+
"created": "2016-10-12T14:40:21.259Z",
|
|
6
|
+
"name": "test",
|
|
7
|
+
"id": "e3eca45f4d294132c07b49f4"
|
|
8
|
+
}, {
|
|
9
|
+
"user": "user@sample.com",
|
|
10
|
+
"created": "2016-10-12T15:36:40.012Z",
|
|
11
|
+
"name": "test2",
|
|
12
|
+
"id": "ef466257f5e10aa4755d411a"
|
|
13
|
+
}, {
|
|
14
|
+
"user": "user@sample.com",
|
|
15
|
+
"created": "2016-11-08T02:14:18.628Z",
|
|
16
|
+
"name": "Bucket-5919ed",
|
|
17
|
+
"id": "eaf27b3a4daec36fb45f8b57"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"getbucket": {
|
|
21
|
+
"user": "user@sample.com",
|
|
22
|
+
"created": "2016-10-12T14:40:21.259Z",
|
|
23
|
+
"name": "g9qacwq2AE1+5nzL/HYyYdY9WoIr+1ueOuVEx6/IzzZKK9sULoKDDdYvhOpavHH2P3xQNw==",
|
|
24
|
+
"id": "368be0816766b28fd5f43af5"
|
|
25
|
+
},
|
|
26
|
+
"putbuckets": {
|
|
27
|
+
"user": "user@sample.com",
|
|
28
|
+
"encryptionKey": "",
|
|
29
|
+
"publicPermissions": [ ],
|
|
30
|
+
"created": "2016-11-16T19:39:11.605Z",
|
|
31
|
+
"name": "backups",
|
|
32
|
+
"pubkeys": [ ],
|
|
33
|
+
"status": "Active",
|
|
34
|
+
"transfer": 0,
|
|
35
|
+
"storage": 0,
|
|
36
|
+
"id": "0f1810b4bb5b6472352ec486"
|
|
37
|
+
},
|
|
38
|
+
"deletebucket": null,
|
|
39
|
+
"listfiles": [
|
|
40
|
+
{
|
|
41
|
+
"bucket": "0cf572e48da78e9af943a771",
|
|
42
|
+
"mimetype": "video/mp4",
|
|
43
|
+
"filename": "TheMeaningOfLifeAndEverything.mp4",
|
|
44
|
+
"frame": "d4af71ab00e15b0c1a7b6ab2",
|
|
45
|
+
"size": 3193765382,
|
|
46
|
+
"id": "f18b5ca437b1ca3daa14969f"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"bucket": "ceafaedb399610639bdfc2d7",
|
|
50
|
+
"mimetype": "video/ogg",
|
|
51
|
+
"filename": "TheMeaningOfLifeAndEverything.ogv",
|
|
52
|
+
"frame": "563026f766ec4aaaa372366f",
|
|
53
|
+
"size": 442719839,
|
|
54
|
+
"id": "85fb0ed00de1196dc22e0f6d"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"createfile": {
|
|
58
|
+
"id": "85fb0ed00de1196dc22e0f6d"
|
|
59
|
+
},
|
|
60
|
+
"createbuckettoken": {
|
|
61
|
+
"bucket": "845f106ddfc234054eee274a",
|
|
62
|
+
"operation": "PULL",
|
|
63
|
+
"expires": "2016-11-17T17:10:53.528Z",
|
|
64
|
+
"token": "a264e12611ad93b1777e82065f86cfcf088967dba2f15559cea5e140d5339a0e",
|
|
65
|
+
"id": "c89535457d462136215f7f75b3408d9d5d2f38031c1366781990681fd238bfe3",
|
|
66
|
+
"encryptionKey": ""
|
|
67
|
+
},
|
|
68
|
+
"deletefile": null,
|
|
69
|
+
"createframe": {
|
|
70
|
+
"user": "user@sample.com",
|
|
71
|
+
"shards": [],
|
|
72
|
+
"size": 0,
|
|
73
|
+
"locked": false,
|
|
74
|
+
"created": "2016-11-19T00:12:51.009Z",
|
|
75
|
+
"id": "d6367831f7f1b117ffdd0015"
|
|
76
|
+
},
|
|
77
|
+
"getframes": [
|
|
78
|
+
{
|
|
79
|
+
"user": "user@sample.com",
|
|
80
|
+
"shards": [
|
|
81
|
+
"8dfcb59090a55a8b1c5f5fc2",
|
|
82
|
+
"4343dfc37e3bcb93435fd696",
|
|
83
|
+
"7e72c40a22f0e41afc474dd1"
|
|
84
|
+
],
|
|
85
|
+
"size": 3193765382,
|
|
86
|
+
"locked": true,
|
|
87
|
+
"created": "2016-10-12T14:43:24.303Z",
|
|
88
|
+
"id": "52b8cc8dfd47bb057d8c8a17"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"user": "user@sample.com",
|
|
92
|
+
"shards": [
|
|
93
|
+
"6af4213990fb563d190ffa87",
|
|
94
|
+
"884e2f3f7f84a0db5ded21a0",
|
|
95
|
+
"b024c25ab483335a6ac08d9c"
|
|
96
|
+
],
|
|
97
|
+
"size": 2919235584,
|
|
98
|
+
"locked": false,
|
|
99
|
+
"created": "2016-10-12T15:16:44.908Z",
|
|
100
|
+
"id": "6e7039165071cbba36c9a607"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"user": "user@sample.com",
|
|
104
|
+
"shards": [
|
|
105
|
+
"41705e9bef3090fcab3eb67a",
|
|
106
|
+
"beb028dd7e2ec91b3785d9db",
|
|
107
|
+
"5f2b47f5baa028102fa8d4e5"
|
|
108
|
+
],
|
|
109
|
+
"size": 3193765382,
|
|
110
|
+
"locked": false,
|
|
111
|
+
"created": "2016-10-12T15:26:59.353Z",
|
|
112
|
+
"id": "57fe564313aa0801ebf0e52e"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"user": "user@sample.com",
|
|
116
|
+
"shards": [
|
|
117
|
+
"a7445e1c62edb9c0da7c2019",
|
|
118
|
+
"991d6b8e81c14f1757c59c37",
|
|
119
|
+
"5839eab4ad22548a19953b95"
|
|
120
|
+
],
|
|
121
|
+
"size": 3327983110,
|
|
122
|
+
"locked": true,
|
|
123
|
+
"created": "2016-10-12T15:36:59.923Z",
|
|
124
|
+
"id": "45369a5132dc69a3a1e625ca"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"user": "user@sample.com",
|
|
128
|
+
"shards": [
|
|
129
|
+
"99e4c92f0e392755ce82ed4c",
|
|
130
|
+
"79bb3eb93ca6a79c21068c92",
|
|
131
|
+
"ff96e85dc8c115191259f3a5"
|
|
132
|
+
],
|
|
133
|
+
"size": 3327983110,
|
|
134
|
+
"locked": true,
|
|
135
|
+
"created": "2016-10-12T20:34:06.699Z",
|
|
136
|
+
"id": "85161efd8b7b631dab7844e4"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"user": "user@sample.com",
|
|
140
|
+
"shards": [
|
|
141
|
+
"d21534cf0dc5488f6a00b7a0",
|
|
142
|
+
"28be6ce035527799e446ec38",
|
|
143
|
+
"d221f90bf445bfa4a813cdeb"
|
|
144
|
+
],
|
|
145
|
+
"size": 83886080,
|
|
146
|
+
"locked": false,
|
|
147
|
+
"created": "2016-10-26T18:22:31.033Z",
|
|
148
|
+
"id": "f28ca760e1a2d5a5d4dbaecf"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"user": "user@sample.com",
|
|
152
|
+
"shards": [
|
|
153
|
+
"cbea29ab2618cb036f3b4d63"
|
|
154
|
+
],
|
|
155
|
+
"size": 442719839,
|
|
156
|
+
"locked": true,
|
|
157
|
+
"created": "2016-10-26T18:56:26.566Z",
|
|
158
|
+
"id": "b719da4f46dd29fa51b428f5"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"user": "user@sample.com",
|
|
162
|
+
"shards": [
|
|
163
|
+
"2aad5e61eea4ba6d8ab4b5f7"
|
|
164
|
+
],
|
|
165
|
+
"size": 3193765382,
|
|
166
|
+
"locked": true,
|
|
167
|
+
"created": "2016-11-08T02:15:15.356Z",
|
|
168
|
+
"id": "9089eba7e52a0c44480773af"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"user": "user@sample.com",
|
|
172
|
+
"shards": [
|
|
173
|
+
"f850c72c904073bf934a83fe"
|
|
174
|
+
],
|
|
175
|
+
"size": 134235,
|
|
176
|
+
"locked": true,
|
|
177
|
+
"created": "2016-11-17T17:59:58.684Z",
|
|
178
|
+
"id": "80aa76ef9222cac3b5ee1fdf"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"user": "user@sample.com",
|
|
182
|
+
"shards": [],
|
|
183
|
+
"size": 0,
|
|
184
|
+
"locked": false,
|
|
185
|
+
"created": "2016-11-19T00:12:51.009Z",
|
|
186
|
+
"id": "70bd54bddb2f98f2445be75f"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"getframe": {
|
|
190
|
+
"user": "user@sample.com",
|
|
191
|
+
"shards": [
|
|
192
|
+
"b3c7cf3d61ec90e0e588253b",
|
|
193
|
+
"bf56de167e9503c275db06b2",
|
|
194
|
+
"d3e9d2c8f1809a8f70d6c288",
|
|
195
|
+
"4a321d3a013c8ed0a8d5ece1",
|
|
196
|
+
"5e20d3b6105d43590ccdd0c7",
|
|
197
|
+
"6b891bdbbe3643074e66333e",
|
|
198
|
+
"0d047a4a003b05f16f97ef48",
|
|
199
|
+
"40eb217b5a0a3a47990854e5",
|
|
200
|
+
"f0c466b0116d9ceb349e29e1",
|
|
201
|
+
"d62dbbdbe33885e5f45b81c1",
|
|
202
|
+
"ddde362481b8629a90e9ac53",
|
|
203
|
+
"c90ccb6af4510060dfb7bcb4",
|
|
204
|
+
"634312e65d1cb0a58779a486",
|
|
205
|
+
"6c066b7737c0871dc2b597f4",
|
|
206
|
+
"587adbd61a4788997781aedc",
|
|
207
|
+
"7bc73bfd4763ad24d7c52713",
|
|
208
|
+
"7ba26ef19918d2494671bcf4",
|
|
209
|
+
"0bcc3a2410cdb3fe85176a88",
|
|
210
|
+
"d496d13eccc99a06546af4d3",
|
|
211
|
+
"828a9eb075248ffc21c481b0",
|
|
212
|
+
"8f73805462697f132a740cf4",
|
|
213
|
+
"ecb971ec1926df2e668b36fb",
|
|
214
|
+
"cf814028c3fefe3268707d29",
|
|
215
|
+
"14c7c12622f963fb47b9a82d",
|
|
216
|
+
"b9897acc54699d42500741ac"
|
|
217
|
+
],
|
|
218
|
+
"size": 3193765382,
|
|
219
|
+
"locked": true,
|
|
220
|
+
"created": "2016-10-12T14:43:24.303Z",
|
|
221
|
+
"id": "192f90792f42875a7533340b"
|
|
222
|
+
},
|
|
223
|
+
"deleteframe": null,
|
|
224
|
+
"putframe": {
|
|
225
|
+
"hash": "b3b31e2232cf17ccf2cdc3ae5dc291f67a8d0b7e",
|
|
226
|
+
"token": "1aa226cb1d35eb87e3f28920e1eab43e91e1435a",
|
|
227
|
+
"operation": "PUSH",
|
|
228
|
+
"farmer": {
|
|
229
|
+
"userAgent": "6.0.15",
|
|
230
|
+
"protocol": "1.1.0",
|
|
231
|
+
"address": "localhost",
|
|
232
|
+
"port": 8092,
|
|
233
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
234
|
+
"lastSeen": 1485378872153
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"getfileinfo": {
|
|
238
|
+
"bucket": "368be0816766b28fd5f43af5",
|
|
239
|
+
"mimetype": "video/ogg",
|
|
240
|
+
"filename": "storj-test-download.data",
|
|
241
|
+
"frame": "2f2133b1d23e0bc4123f96de",
|
|
242
|
+
"size": 3193765382,
|
|
243
|
+
"id": "998960317b6725a3f8080c2b",
|
|
244
|
+
"hmac": {
|
|
245
|
+
"value": "78462f9056d9e997e3a74b778014b9e20b6404e19dbea3516991c3a6dc105384463df4123246634de5aaa2304da54f03c09d92d73c3febe1da56ca0478d85cc4",
|
|
246
|
+
"type": "sha512"
|
|
247
|
+
},
|
|
248
|
+
"erasure": {
|
|
249
|
+
"type": "reedsolomon"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"getfileid": {
|
|
253
|
+
"id": "998960317b6725a3f8080c2b"
|
|
254
|
+
},
|
|
255
|
+
"getfilepointers-0": [
|
|
256
|
+
{
|
|
257
|
+
"token": "de8e83dcf41789d66f2855259f35b729c9834eeb",
|
|
258
|
+
"hash": "269e72f24703be80bbb10499c91dc9b2022c4dc3",
|
|
259
|
+
"farmer": {
|
|
260
|
+
"userAgent": "6.0.1",
|
|
261
|
+
"protocol": "1.0.0",
|
|
262
|
+
"address": "localhost",
|
|
263
|
+
"port": 8092,
|
|
264
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
265
|
+
"lastSeen": 1480963976750
|
|
266
|
+
},
|
|
267
|
+
"operation": "PULL",
|
|
268
|
+
"index": 0,
|
|
269
|
+
"size": 16777216
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"hash": "17416a592487d7b1b74c100448c8296122d8aff8",
|
|
273
|
+
"index": 1,
|
|
274
|
+
"size": 16777216
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"token": "f63d4f4d7ca0c3e4bca5c9dcd4a1c3be212f137e",
|
|
278
|
+
"hash": "83cf5eaf2311a1ae9699772d9bafbb3e369a41cc",
|
|
279
|
+
"farmer": {
|
|
280
|
+
"userAgent": "6.0.1",
|
|
281
|
+
"protocol": "1.0.0",
|
|
282
|
+
"address": "localhost",
|
|
283
|
+
"port": 8092,
|
|
284
|
+
"nodeID": "fe1d29e063197502b070c70782242485b276cd5c",
|
|
285
|
+
"lastSeen": 1480963976882
|
|
286
|
+
},
|
|
287
|
+
"operation": "PULL",
|
|
288
|
+
"index": 2,
|
|
289
|
+
"size": 16777216
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"getfilepointers-1": [
|
|
293
|
+
{
|
|
294
|
+
"token": "cc02fb5c9687c397fd1ead5a2e71239dcffb0f4c",
|
|
295
|
+
"hash": "214ed86cb1287fe0fd18c174eecbf84341bf2655",
|
|
296
|
+
"farmer": {
|
|
297
|
+
"userAgent": "6.0.1",
|
|
298
|
+
"protocol": "1.0.0",
|
|
299
|
+
"address": "localhost",
|
|
300
|
+
"port": 8092,
|
|
301
|
+
"nodeID": "2f3b918a3bbe74608806c215ec341449ab9998ec",
|
|
302
|
+
"lastSeen": 1480963976950
|
|
303
|
+
},
|
|
304
|
+
"operation": "PULL",
|
|
305
|
+
"index": 3,
|
|
306
|
+
"size": 16777216
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"token": "2d9ae13d317209c1523b80716f186f887a4c7d3a",
|
|
310
|
+
"hash": "1ea408fad0213a16f53421e9b72aeb0e12b93a4a",
|
|
311
|
+
"farmer": {
|
|
312
|
+
"userAgent": "6.0.1",
|
|
313
|
+
"protocol": "1.0.0",
|
|
314
|
+
"address": "localhost",
|
|
315
|
+
"port": 8092,
|
|
316
|
+
"nodeID": "15a02aed7a92e593d03d6cd1f43c0ab504131296",
|
|
317
|
+
"lastSeen": 1480963977022
|
|
318
|
+
},
|
|
319
|
+
"operation": "PULL",
|
|
320
|
+
"index": 4,
|
|
321
|
+
"size": 16777216
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"token": "382827e71429823a4aafedbe839b4efee9d5f68b",
|
|
325
|
+
"hash": "0219bb523832c09c77069c74804e5b0476cea7cf",
|
|
326
|
+
"farmer": {
|
|
327
|
+
"userAgent": "6.0.1",
|
|
328
|
+
"protocol": "1.0.0",
|
|
329
|
+
"address": "localhost",
|
|
330
|
+
"port": 8092,
|
|
331
|
+
"nodeID": "15a02aed7a92e593d03d6cd1f43c0ab504131296",
|
|
332
|
+
"lastSeen": 1480963977087
|
|
333
|
+
},
|
|
334
|
+
"operation": "PULL",
|
|
335
|
+
"index": 5,
|
|
336
|
+
"size": 16777216
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"getfilepointers-2": [
|
|
340
|
+
{
|
|
341
|
+
"token": "de8e83dcf41789d66f2855259f35b729c9834eeb",
|
|
342
|
+
"hash": "ebcbe78dd209a03d3ce29f2e5460304de2060031",
|
|
343
|
+
"farmer": {
|
|
344
|
+
"userAgent": "6.0.1",
|
|
345
|
+
"protocol": "1.0.0",
|
|
346
|
+
"address": "localhost",
|
|
347
|
+
"port": 8092,
|
|
348
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
349
|
+
"lastSeen": 1480963976750
|
|
350
|
+
},
|
|
351
|
+
"operation": "PULL",
|
|
352
|
+
"index": 6,
|
|
353
|
+
"size": 16777216
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"token": "bc1b9cc047fc805fe756b08789f5db4ec37dc11e",
|
|
357
|
+
"hash": "5ecd6cc2964a344b42406d3688e13927a51937aa",
|
|
358
|
+
"farmer": {
|
|
359
|
+
"userAgent": "6.0.1",
|
|
360
|
+
"protocol": "1.0.0",
|
|
361
|
+
"address": "localhost",
|
|
362
|
+
"port": 8092,
|
|
363
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
364
|
+
"lastSeen": 1480963976831
|
|
365
|
+
},
|
|
366
|
+
"operation": "PULL",
|
|
367
|
+
"index": 7,
|
|
368
|
+
"size": 16777216
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"hash": "88c5e8885160c449b1dbb00ccf317067200b39a0",
|
|
372
|
+
"index": 8,
|
|
373
|
+
"size": 16777216
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"getfilepointers-3": [
|
|
377
|
+
{
|
|
378
|
+
"token": "cc02fb5c9687c397fd1ead5a2e71239dcffb0f4c",
|
|
379
|
+
"hash": "76b1a97498e026c47c924374b5b1148543d5c0ab",
|
|
380
|
+
"farmer": {
|
|
381
|
+
"userAgent": "6.0.1",
|
|
382
|
+
"protocol": "1.0.0",
|
|
383
|
+
"address": "localhost",
|
|
384
|
+
"port": 8092,
|
|
385
|
+
"nodeID": "2f3b918a3bbe74608806c215ec341449ab9998ec",
|
|
386
|
+
"lastSeen": 1480963976950
|
|
387
|
+
},
|
|
388
|
+
"operation": "PULL",
|
|
389
|
+
"index": 9,
|
|
390
|
+
"size": 16777216
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"token": "2d9ae13d317209c1523b80716f186f887a4c7d3a",
|
|
394
|
+
"hash": "48e02627e37433c89fa034d3ee2df644ac7ac7a0",
|
|
395
|
+
"farmer": {
|
|
396
|
+
"userAgent": "6.0.1",
|
|
397
|
+
"protocol": "1.0.0",
|
|
398
|
+
"address": "localhost",
|
|
399
|
+
"port": 8092,
|
|
400
|
+
"nodeID": "15a02aed7a92e593d03d6cd1f43c0ab504131296",
|
|
401
|
+
"lastSeen": 1480963977022
|
|
402
|
+
},
|
|
403
|
+
"operation": "PULL",
|
|
404
|
+
"index": 10,
|
|
405
|
+
"size": 16777216
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"token": "382827e71429823a4aafedbe839b4efee9d5f68b",
|
|
409
|
+
"hash": "e4617532be728d48a8155ecfb200d50f00a01a23",
|
|
410
|
+
"farmer": {
|
|
411
|
+
"userAgent": "6.0.1",
|
|
412
|
+
"protocol": "1.0.0",
|
|
413
|
+
"address": "localhost",
|
|
414
|
+
"port": 8092,
|
|
415
|
+
"nodeID": "15a02aed7a92e593d03d6cd1f43c0ab504131296",
|
|
416
|
+
"lastSeen": 1480963977087
|
|
417
|
+
},
|
|
418
|
+
"operation": "PULL",
|
|
419
|
+
"index": 11,
|
|
420
|
+
"size": 16777216
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"getfilepointers-4": [
|
|
424
|
+
{
|
|
425
|
+
"token": "de8e83dcf41789d66f2855259f35b729c9834eeb",
|
|
426
|
+
"hash": "973701b43290e3bef7007db0cb75744f9556ae3b",
|
|
427
|
+
"farmer": {
|
|
428
|
+
"userAgent": "6.0.1",
|
|
429
|
+
"protocol": "1.0.0",
|
|
430
|
+
"address": "localhost",
|
|
431
|
+
"port": 8092,
|
|
432
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
433
|
+
"lastSeen": 1480963976750
|
|
434
|
+
},
|
|
435
|
+
"operation": "PULL",
|
|
436
|
+
"index": 12,
|
|
437
|
+
"size": 16777216
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"token": "bc1b9cc047fc805fe756b08789f5db4ec37dc11e",
|
|
441
|
+
"hash": "a0ec63ad4069fa51a53871c7a282e184371b842b",
|
|
442
|
+
"farmer": {
|
|
443
|
+
"userAgent": "6.0.1",
|
|
444
|
+
"protocol": "1.0.0",
|
|
445
|
+
"address": "localhost",
|
|
446
|
+
"port": 8092,
|
|
447
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
448
|
+
"lastSeen": 1480963976831
|
|
449
|
+
},
|
|
450
|
+
"operation": "PULL",
|
|
451
|
+
"index": 13,
|
|
452
|
+
"size": 16777216
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"token": "4a207fadceca4a9622f0ef25b1220ef9b8cf4831",
|
|
456
|
+
"hash": "5b388088b0ef4b44594311794cc1390b85c2f6d3",
|
|
457
|
+
"farmer": {
|
|
458
|
+
"userAgent": "6.0.1",
|
|
459
|
+
"protocol": "1.0.0",
|
|
460
|
+
"address": "localhost",
|
|
461
|
+
"port": 8092,
|
|
462
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
463
|
+
"lastSeen": 1480963976831
|
|
464
|
+
},
|
|
465
|
+
"operation": "PULL",
|
|
466
|
+
"index": 14,
|
|
467
|
+
"parity": true,
|
|
468
|
+
"size": 16777216
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
"getfilepointers-5": [
|
|
472
|
+
{
|
|
473
|
+
"token": "3b3f8ccb23ec47cec1ad57f7f68cab285dde54d6",
|
|
474
|
+
"hash": "424cdf090604317570da38ef7d5b41abea0952df",
|
|
475
|
+
"farmer": {
|
|
476
|
+
"userAgent": "6.0.1",
|
|
477
|
+
"protocol": "1.0.0",
|
|
478
|
+
"address": "localhost",
|
|
479
|
+
"port": 8092,
|
|
480
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
481
|
+
"lastSeen": 1480963976831
|
|
482
|
+
},
|
|
483
|
+
"operation": "PULL",
|
|
484
|
+
"index": 15,
|
|
485
|
+
"parity": true,
|
|
486
|
+
"size": 16777216
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"token": "44e1db2c17af152618dbe319f8f2bf1a6ef21b94",
|
|
490
|
+
"hash": "a292c0de26b2a9086473905abb938c7a1c45a9e9",
|
|
491
|
+
"farmer": {
|
|
492
|
+
"userAgent": "6.0.1",
|
|
493
|
+
"protocol": "1.0.0",
|
|
494
|
+
"address": "localhost",
|
|
495
|
+
"port": 8092,
|
|
496
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
497
|
+
"lastSeen": 1480963976831
|
|
498
|
+
},
|
|
499
|
+
"operation": "PULL",
|
|
500
|
+
"index": 16,
|
|
501
|
+
"parity": true,
|
|
502
|
+
"size": 16777216
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"token": "9424f843e3a10a7f96dc79a301c6700385d1a74b",
|
|
506
|
+
"hash": "aca155b4deeac64f2be748e3c434e1f5e9719ef3",
|
|
507
|
+
"farmer": {
|
|
508
|
+
"userAgent": "6.0.1",
|
|
509
|
+
"protocol": "1.0.0",
|
|
510
|
+
"address": "localhost",
|
|
511
|
+
"port": 8092,
|
|
512
|
+
"nodeID": "4bb49fb779e9233f9ed14f6ef34e29048911f018",
|
|
513
|
+
"lastSeen": 1480963976831
|
|
514
|
+
},
|
|
515
|
+
"operation": "PULL",
|
|
516
|
+
"index": 17,
|
|
517
|
+
"parity": true,
|
|
518
|
+
"size": 16777216
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
"getfilepointers-r": [
|
|
522
|
+
{
|
|
523
|
+
"token": "2d9ae13d317209c1523b80716f186f887a4c7d3a",
|
|
524
|
+
"hash": "1ea408fad0213a16f53421e9b72aeb0e12b93a4a",
|
|
525
|
+
"farmer": {
|
|
526
|
+
"userAgent": "6.0.1",
|
|
527
|
+
"protocol": "1.0.0",
|
|
528
|
+
"address": "localhost",
|
|
529
|
+
"port": 8092,
|
|
530
|
+
"nodeID": "15a02aed7a92e593d03d6cd1f43c0ab504131296",
|
|
531
|
+
"lastSeen": 1480963977022
|
|
532
|
+
},
|
|
533
|
+
"operation": "PULL",
|
|
534
|
+
"index": 4,
|
|
535
|
+
"size": 16777216
|
|
536
|
+
}
|
|
537
|
+
],
|
|
538
|
+
"getfilepointers-missing": [
|
|
539
|
+
{
|
|
540
|
+
"hash": "1ea408fad0213a16f53421e9b72aeb0e12b93a4a",
|
|
541
|
+
"parity": true,
|
|
542
|
+
"index": 14,
|
|
543
|
+
"size": 16777216
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"createuser": {
|
|
547
|
+
"isFreeTier": true,
|
|
548
|
+
"activated": false,
|
|
549
|
+
"created": "2017-01-26T19:06:51.045Z",
|
|
550
|
+
"defaultPaymentProcessor": null,
|
|
551
|
+
"email": "test@test.com",
|
|
552
|
+
"id": "test@test.com"
|
|
553
|
+
},
|
|
554
|
+
"listmirrors": [
|
|
555
|
+
{
|
|
556
|
+
"established": [
|
|
557
|
+
{
|
|
558
|
+
"shardHash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
559
|
+
"contact": {
|
|
560
|
+
"protocol": "1.0.0",
|
|
561
|
+
"address": "storj04.prybil.com",
|
|
562
|
+
"port": 4040,
|
|
563
|
+
"lastSeen": "2017-01-24T11:43:39.540Z",
|
|
564
|
+
"userAgent": "6.0.11",
|
|
565
|
+
"lastTimeout": "2017-01-23T17:20:51.739Z",
|
|
566
|
+
"responseTime": 8845.665080981631,
|
|
567
|
+
"timeoutRate": 0.24837207175925927,
|
|
568
|
+
"nodeID": "3b5e44403ef9d53c9336a6f82adf3a51f57a2c90"
|
|
569
|
+
},
|
|
570
|
+
"contract": {
|
|
571
|
+
"audit_count": 3,
|
|
572
|
+
"data_hash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
573
|
+
"data_size": 12,
|
|
574
|
+
"farmer_id": "3b5e44403ef9d53c9336a6f82adf3a51f57a2c90",
|
|
575
|
+
"farmer_signature": "H3h8d0CFeZ3s+l+Fzu4VztEqeIGCol6OaoB0CMMc08FzTwmLXFlL1+ozj+gZnn2XPR591ONBheCXTeEb4R21INg=",
|
|
576
|
+
"payment_destination": "1DAFL2mDpCLceAQ72Rq3dQzfKmBa2FNc6J",
|
|
577
|
+
"payment_download_price": 0,
|
|
578
|
+
"payment_storage_price": 0,
|
|
579
|
+
"renter_hd_index": 4792918,
|
|
580
|
+
"renter_hd_key": "xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42",
|
|
581
|
+
"renter_id": "363703b24803489b156d5e78ef2951dd40440c8c",
|
|
582
|
+
"renter_signature": "IBW+KgE9EdllgwQTOrKviMXeQPN0ydVh8RszXp8rDGu5DH4MDxg9XKlFdohp5rRWK7f\/4l\/PxwFSUvUV9bD0vys=",
|
|
583
|
+
"store_begin": 1482778989402,
|
|
584
|
+
"store_end": 1490554989402,
|
|
585
|
+
"version": 0
|
|
586
|
+
},
|
|
587
|
+
"isEstablished": true,
|
|
588
|
+
"id": "5861696e6e527d78e232d3f4"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"shardHash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
592
|
+
"contact": {
|
|
593
|
+
"protocol": "1.1.0",
|
|
594
|
+
"address": "011s.storjlt.xyz",
|
|
595
|
+
"port": 3801,
|
|
596
|
+
"lastSeen": "2017-01-24T20:17:49.152Z",
|
|
597
|
+
"userAgent": "6.0.15",
|
|
598
|
+
"lastTimeout": "2017-01-18T01:42:32.385Z",
|
|
599
|
+
"nodeID": "392ea1b3909a80d784a4ca3232b9f099b1d40312"
|
|
600
|
+
},
|
|
601
|
+
"contract": {
|
|
602
|
+
"audit_count": 3,
|
|
603
|
+
"data_hash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
604
|
+
"data_size": 12,
|
|
605
|
+
"farmer_id": "392ea1b3909a80d784a4ca3232b9f099b1d40312",
|
|
606
|
+
"farmer_signature": "H5LMAJWkhvZVU0Yr8ZEVi1pzCmyPFTZ899SbCVPT8IN6O\/DGj5QdPbHpZO\/gVQZ7WWkXV1bWsKUDAAdCE\/gaxbg=",
|
|
607
|
+
"payment_destination": "1J14szQGQoKcCf14ALSZBPL8dy1zgEW2C8",
|
|
608
|
+
"payment_download_price": 0,
|
|
609
|
+
"payment_storage_price": 0,
|
|
610
|
+
"renter_hd_index": 4792918,
|
|
611
|
+
"renter_hd_key": "xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42",
|
|
612
|
+
"renter_id": "363703b24803489b156d5e78ef2951dd40440c8c",
|
|
613
|
+
"renter_signature": "H+\/zEohkeih\/S9zYcLFipGohsrXDIJKFFNdH6umJW1fqTJgfMYJBdrfRVH0hwKxiYGKJ5euFMljuYOFhDF0iSDY=",
|
|
614
|
+
"store_begin": 1482778989402,
|
|
615
|
+
"store_end": 1490554989402,
|
|
616
|
+
"version": 0
|
|
617
|
+
},
|
|
618
|
+
"isEstablished": true,
|
|
619
|
+
"id": "5861696e6e527d78e232d3f5"
|
|
620
|
+
}
|
|
621
|
+
],
|
|
622
|
+
"available": [
|
|
623
|
+
{
|
|
624
|
+
"shardHash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
625
|
+
"contact": {
|
|
626
|
+
"lastSeen": "2017-01-01T09:15:59.903Z",
|
|
627
|
+
"port": 15049,
|
|
628
|
+
"address": "client018.storj.dk",
|
|
629
|
+
"userAgent": "6.0.11",
|
|
630
|
+
"protocol": "1.0.0",
|
|
631
|
+
"nodeID": "39614d0ea75b956797e5ed903f4ed684d5ca8aa6"
|
|
632
|
+
},
|
|
633
|
+
"contract": {
|
|
634
|
+
"audit_count": 3,
|
|
635
|
+
"data_hash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
636
|
+
"data_size": 12,
|
|
637
|
+
"farmer_id": "39614d0ea75b956797e5ed903f4ed684d5ca8aa6",
|
|
638
|
+
"farmer_signature": "H+VUeZcZ80+NeXJRhhDnk5yKZkhSj\/eZWOJjbv9QFrE8Fz3Fc0yxBUtJaoHgnwEhNtCgT8M5Lop+ZVsC2TEEjq4=",
|
|
639
|
+
"payment_destination": "13A9pNsK1SWPkzzHZTgoQZjVyZdxKB1KGB",
|
|
640
|
+
"payment_download_price": 0,
|
|
641
|
+
"payment_storage_price": 0,
|
|
642
|
+
"renter_hd_index": 4792918,
|
|
643
|
+
"renter_hd_key": "xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42",
|
|
644
|
+
"renter_id": "363703b24803489b156d5e78ef2951dd40440c8c",
|
|
645
|
+
"renter_signature": "IKeZWCSosRhUb4iJNm9ojiLorlCIxqu5SlDVPbe9xXfXPd+yBUjU5+4u2KA8OWCv29p2DB5kQDKWm\/9k7fQoISE=",
|
|
646
|
+
"store_begin": 1482778989402,
|
|
647
|
+
"store_end": 1490554989402,
|
|
648
|
+
"version": 0
|
|
649
|
+
},
|
|
650
|
+
"isEstablished": false,
|
|
651
|
+
"id": "5861696e6e527d78e232d3f9"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"shardHash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
655
|
+
"contact": {
|
|
656
|
+
"lastSeen": "2017-01-22T00:49:14.331Z",
|
|
657
|
+
"port": 15024,
|
|
658
|
+
"address": "client013.storj.dk",
|
|
659
|
+
"userAgent": "6.0.11",
|
|
660
|
+
"protocol": "1.0.0",
|
|
661
|
+
"lastTimeout": "2016-12-28T18:13:13.729Z",
|
|
662
|
+
"nodeID": "3b7c33c6648b094e7950cb4b25fe777d49fd3bb6"
|
|
663
|
+
},
|
|
664
|
+
"contract": {
|
|
665
|
+
"audit_count": 3,
|
|
666
|
+
"data_hash": "399d6b739ef5a17cb6d332c9b36517411b273048",
|
|
667
|
+
"data_size": 12,
|
|
668
|
+
"farmer_id": "3b7c33c6648b094e7950cb4b25fe777d49fd3bb6",
|
|
669
|
+
"farmer_signature": "H88eeX3oe16BlJ8ffUKM21THgiPfVT\/06330losJi9wFBGW+H\/TgCloVsbwFCch0nB0GMsmohJ2HNn+cnx5OdCk=",
|
|
670
|
+
"payment_destination": "13DYoH5MBm2LWVb1UziCy6L1ex6PPypyvu",
|
|
671
|
+
"payment_download_price": 0,
|
|
672
|
+
"payment_storage_price": 0,
|
|
673
|
+
"renter_hd_index": 4792918,
|
|
674
|
+
"renter_hd_key": "xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42",
|
|
675
|
+
"renter_id": "363703b24803489b156d5e78ef2951dd40440c8c",
|
|
676
|
+
"renter_signature": "H2fCafYjCVrWsyloWif38tcPbTUpcq8Sq6K7taIKa4Q1MhtsTgLTchXRWOaOgjYn7oJOYT0MfaMHFrkVDH6gCXI=",
|
|
677
|
+
"store_begin": 1482778989402,
|
|
678
|
+
"store_end": 1490554989402,
|
|
679
|
+
"version": 0
|
|
680
|
+
},
|
|
681
|
+
"isEstablished": false,
|
|
682
|
+
"id": "5861696e6e527d78e232d3fa"
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
}
|
|
686
|
+
]
|
|
687
|
+
}
|