#Snapshots
#Get snapshots list
#Method
1snapshots.list
#Parameters
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
method |
string |
The method name. |
Yes |
params |
object |
The parameters of the request. |
Yes |
#Result
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
result |
array |
Result. |
Yes |
result.name |
string |
Snapshot name. |
Yes |
result.size |
string |
Snapshot size (KB). |
Yes |
#Request
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "snapshots.list",
5 "params": { }
6}
#Response
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": [
5 {
6 "name": "1-102",
7 "size": 69
8 },
9 {
10 "name": "1-51",
11 "size": 55
12 },
13 {
14 "name": "1-52",
15 "size": 38
16 }
17 ]
18}
#Create snapshot
#Method
1snapshots.create
#Parameters
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
method |
string |
The method name. |
Yes |
params |
object |
The parameters of the request. |
Yes |
params.codec |
string |
Snapshot codec (default, json). |
No |
params.skipCompression |
boolean |
Skip data compression (false). |
No |
params.start |
boolean |
First block included in snapshot. |
No |
params.end |
boolean |
Last block included in snapshot. |
No |
Given start and end height may be changed to match nearest round start.
#Result
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
result |
object |
Result. |
Yes |
An empty result means that snapshot creation process has started successfully. It does not guarantee that snapshot process will complete successfully.
#Request
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "snapshots.create",
5 "params": { "codec": "json", "skipCompression": true, "start": 1, "end": 200 }
6}
#Response
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {}
5}
#Restore snapshot
#Method
1snapshots.restore
#Parameters
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
method |
string |
The method name. |
Yes |
params |
object |
The parameters of the request. |
Yes |
params.name |
string |
Snapshot name. |
Yes |
params.truncate |
boolean |
Truncate database (false). |
No |
params.verify |
boolean |
Verify data on restore (false). |
No |
#Result
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
result |
object |
Result. |
Yes |
Empty result means that snapshot restore process is started successfully. It does not guarantee that snapshot process will complete successfully.
#Request
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "snapshots.restore",
5 "params": { "blocks": "1-9793", "truncate": true, "verify": true }
6}
#Response
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {}
5}
#Delete snapshot
#Method
1snapshots.delete
#Parameters
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
method |
string |
The method name. |
Yes |
params |
object |
The parameters of the request. |
Yes |
params.name |
string |
Snapshot name. |
Yes |
#Result
Name |
Type |
Description |
Required |
id |
string / number |
The identifier of the request. |
Yes |
jsonrpc |
string |
The protocol version. |
Yes |
result |
object |
Result. |
Yes |
#Request
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "snapshots.delete",
5 "params": { "name": "1-9742" }
6}
#Response
1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {}
5}