-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.py
146 lines (145 loc) · 3.03 KB
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import json
CONTRACT_SCHEMA = json.loads("""
{
"type": "object",
"properties": {
"type": {
"enum": [
"56ce3e837f575827cb5a94e2b609756a48fa4a3882f5e762b262af31f432878d"
]
},
"renter_id": {
"type": ["string", "null"],
"pattern": "^[0-9a-f]{40,40}"
},
"renter_address": {
"type": ["string", "null"],
"format": "ipv4"
},
"renter_port": {
"type": ["integer", "null"],
"minimum": 1,
"maximum": 65535
},
"renter_signature": {
"type": ["string", "null"]
},
"farmer_id": {
"type": ["string", "null"],
"pattern": "^[0-9a-f]{40,40}"
},
"farmer_address": {
"type": ["string", "null"],
"format": "ipv4"
},
"farmer_port": {
"type": ["integer", "null"],
"minimum": 1,
"maximum": 65535
},
"farmer_signature": {
"type": ["string", "null"]
},
"data_size": {
"type": ["integer", "null"],
"minimum": 0
},
"data_hash": {
"type": ["string", "null"],
"pattern": "^[0-9a-f]{64,64}$"
},
"store_begin": {
"type": ["integer", "null"],
"minimum": 0
},
"store_duration": {
"type": ["integer", "null"],
"minimum": 0
},
"store_end": {
"type": ["integer", "null"],
"minimum": 0
},
"audit_algorithm": {
"type": ["string", "null"]
},
"audit_count": {
"type": ["integer", "null"],
"minimum": 0
},
"audit_merkle_root": {
"type": ["string", "null"],
"pattern": "^[0-9a-f]{64,64}$"
},
"heartbeat_algorithm": {
"type": ["string", "null"]
},
"heartbeat_count": {
"type": ["integer", "null"],
"minimum": 0
},
"heartbeat_coverage": {
"type": ["integer", "null"],
"minimum": 0
},
"payment_currency": {
"type": ["string", "null"]
},
"payment_amount": {
"type": ["integer", "null"]
},
"payment_download_price": {
"type": ["integer", "null"]
},
"payment_destination": {
"type": ["string", "null"]
},
"payment_source": {
"type": ["string", "null"]
},
"payment_begin": {
"type": ["integer", "null"],
"minimum": 0
},
"payment_settlements": {
"type": ["integer", "null"],
"minimum": 0
},
"payment_interval": {
"type": ["integer", "null"],
"minimum": 0
}
},
"additionalProperties": false,
"required": [
"type",
"renter_id",
"renter_address",
"renter_port",
"renter_signature",
"farmer_id",
"farmer_address",
"farmer_port",
"farmer_signature",
"data_size",
"data_hash",
"store_begin",
"store_duration",
"store_end",
"audit_algorithm",
"audit_count",
"audit_merkle_root",
"heartbeat_algorithm",
"heartbeat_count",
"heartbeat_coverage",
"payment_currency",
"payment_amount",
"payment_download_price",
"payment_destination",
"payment_source",
"payment_begin",
"payment_settlements",
"payment_interval"
]
}
""")