Skip to content
Snippets Groups Projects
Commit a238b4f4 authored by Éloïs's avatar Éloïs
Browse files

[fix] ws2pv2 : Readjusting the REQUESTS_RESPONSES message

parent c22ed358
No related branches found
No related tags found
1 merge request!8WIP: WS2P v2
...@@ -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._
#### SYNC_CHUNK and CHUNK responses #### CHUNK response
| data name | size in bytes | data type | | data name | size in bytes | data type |
|:------------:|---------------|----------------------| |:------------:|---------------|----------------------|
| request_id | 4 | u32 |
| blocks_count | 2 | u16 |
| blocks | ? | (u16, BlockDocument) | | 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) blocks := table of tuples (block_size, block_content)
#### WOT_POOL responses #### WOT_POOL response
| data name | size in bytes | data type | | data name | size in bytes | data type |
|:-------------:|---------------|---------------------| |:-------------:|---------------|---------------------|
| request_id | 4 | u32 | | certs_size | 4 | u32 |
| certs_count | 2 | u16 |
| certs_size | 2 | u16 |
| certs | certs_size | CompactPoolIntCert | | certs | certs_size | CompactPoolIntCert |
| folders_count | 4 | u32 |
| folders | ?* | PendingIdtyFolder | | 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._ _*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._
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment