|
|
# Purpose of these scripts/scenarios
|
|
|
|
|
|
Validate _multiple_ *publishers* (aka. producers) and _multiple_ *consumers* working on the same queue, exchange messages via some AMQP message broker without any message corruption. Messages consumed should only be consumed *once*; In other words, no consumer should receive a message that has already been seen by another consumer (it's in question if this will by technically proven).
|
|
|
|
|
|
## Scenario 1
|
|
|
|
|
|
* Scope: Check valid message exchange, [cryptographically](https://en.wikipedia.org/wiki/Cryptography) proven message exchange
|
|
|
* Out of scope: [Performance](https://en.wikipedia.org/wiki/Performance_indicator) data
|
|
|
* Algorithm used to prove correct message exchange: Similar to many blockchains, a (simplistic) [PoW](https://en.wikipedia.org/wiki/Proof-of-work_system)
|
|
|
|
|
|
### Producer
|
|
|
|
|
|
Generate hash over the last produced PoW, last produced proof and new proof, where proof is a prime number (to further increase complexity and unpredictability, this is a random number (between fixed MIN/MAX, however, the resulting prime can be larger than MAX) and the hash starts with n number of 0s (zeros).
|
|
|
|
|
|
#### Example (Genesis hash)
|
|
|
|
|
|
``` python
|
|
|
last_block = {
|
|
|
'hash': '',
|
|
|
'proof': 100003
|
|
|
}
|
|
|
# Will generate (eg.):
|
|
|
new_block = {
|
|
|
'hash': '00004913ba4dc384985524eda948b9b66d9b43fb9be10c9be55c60a9809fe887',
|
|
|
'proof': 909451
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Explanation of process
|
|
|
|
|
|
|
|
|
|
|
|
## Scenario 2
|
|
|
* Scope: Check performance, low level validation of results
|
|
|
* Out of scope: n/a
|
|
|
|