Commit a238b4f4 authored by Éloïs's avatar Éloïs

[fix] ws2pv2 : Readjusting the REQUESTS_RESPONSES message

parent c22ed358
......@@ -605,12 +605,12 @@ WARNING : Exception with the ABF api feature : In a WS2P connection between two
### REQUESTS
| data name | size in bytes | data type |
|:------------:|---------------|-----------|
| request_id | 4 | u32 |
| request_type | 1 | u8 |
| param_1 | ? | ? |
| param_2 | ? | ? |
| data name | size in bytes | data type |
|:------------:|---------------|-------------|
| request_id | 4 | u32 |
| request_type | 1 | u8 |
| param_1 | ? | ? |
| param_2 | ? | ? |
#### request_type interpretation
......@@ -634,39 +634,64 @@ _*This is part of the specificities of WS2P requests in binary format, which wil
### 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
| data name | size in bytes | data type |
|:------------:|---------------|------------|
| request_id | 4 | u32 |
| blockstamp | 36 | Blockstamp |
#### SPECIFIC_BLOCK_HASH response
#### BLOCKS_HASHS response
| data name | size in bytes | data type |
|:------------:|---------------|-----------|
| request_id | 4 | u32 |
| block_hash | 32 | [u8; 32] |
| data name | size in bytes | data type |
|:------------:|----------------|---------------|
| hashs | 32*hashs_count | [[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._
#### SYNC_CHUNK and CHUNK responses
#### CHUNK response
| data name | size in bytes | data type |
|:------------:|---------------|----------------------|
| request_id | 4 | u32 |
| blocks_count | 2 | u16 |
| blocks | ? | (u16, BlockDocument) |
_*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)
#### WOT_POOL responses
#### WOT_POOL response
| data name | size in bytes | data type |
|:-------------:|---------------|---------------------|
| request_id | 4 | u32 |
| certs_count | 2 | u16 |
| certs_size | 2 | u16 |
| certs_size | 4 | u32 |
| certs | certs_size | CompactPoolIntCert |
| folders_count | 4 | u32 |
| folders | ?* | PendingIdtyFolder |
_*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._
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment