@@ -606,7 +606,7 @@ WARNING : Exception with the ABF api feature : In a WS2P connection between two
...
@@ -606,7 +606,7 @@ WARNING : Exception with the ABF api feature : In a WS2P connection between two
### REQUESTS
### REQUESTS
| data name | size in bytes | data type |
| data name | size in bytes | data type |
|:------------:|---------------|-----------|
|:------------:|---------------|-------------|
| request_id | 4 | u32 |
| request_id | 4 | u32 |
| request_type | 1 | u8 |
| request_type | 1 | u8 |
| param_1 | ? | ? |
| param_1 | ? | ? |
...
@@ -634,39 +634,64 @@ _*This is part of the specificities of WS2P requests in binary format, which wil
...
@@ -634,39 +634,64 @@ _*This is part of the specificities of WS2P requests in binary format, which wil
### REQUESTS RESPONSES
### REQUESTS RESPONSES
| data name | size in bytes | data type |
|:----------------:|---------------|------------|
| request_id | 4 | u32 |
| response_type | 1 | u8 |
| response_content | ? | ? |
#### response_type interpretation
| value | significance |
|:-----:|--------------------|
| 0x00 | EMPTY_RESPONSE |
| 0xff | BAD_REQUEST |
| 0x01 | CURRENT_BLOCKSTAMP |
| 0x02 | BLOCKS_HASHS |
| 0x03 | CHUNK |
| 0x05 | WOT_POOL |
EMPTY_RESPONSE := `response_content` field is absent.
BAD_REQUEST := Used only in debug mode. In production, bad requests are simply ignored (The server does not respond).
#### BAD_REQUEST response
| data name | size in bytes | data type |
|:------------:|---------------|------------|
| reason | ? | utf8 |
_*The total payload size of any WS2P message is indicated in the metadata, field `reason` being the only one of unknown size, its size is deduced by calculation._
#### CURRENT_BLOCKSTAMP response
#### CURRENT_BLOCKSTAMP response
| data name | size in bytes | data type |
| data name | size in bytes | data type |
|:------------:|---------------|------------|
|:------------:|---------------|------------|
| request_id | 4 | u32 |
| blockstamp | 36 | Blockstamp |
| blockstamp | 36 | Blockstamp |
#### SPECIFIC_BLOCK_HASH response
#### BLOCKS_HASHS response
| data name | size in bytes | data type |
| data name | size in bytes | data type |
|:------------:|---------------|-----------|
|:------------:|----------------|---------------|
| request_id | 4 | u32 |
| hashs | 32*hashs_count | [[u8; 32]; ?] |
| block_hash | 32 | [u8; 32] |
_*The total payload size of any WS2P message is indicated in the metadata, field `hashs` being the only one of unknown size, its size is deduced by calculation._
_*The total payload size of any WS2P message is indicated in the metadata, field `blocks` being the only one of unknown size, its size is deduced by calculation._
blocks := table of tuples (block_size, block_content)
blocks := table of tuples (block_size, block_content)
_*The total payload size of any WS2P message is indicated in the metadata, field `folders` being the only one of unknown size, its size is deduced by calculation._
_*The total payload size of any WS2P message is indicated in the metadata, field `folders` being the only one of unknown size, its size is deduced by calculation._