From 6b679a11faba5317112d55c551840986109dc13d Mon Sep 17 00:00:00 2001 From: ssd04 Date: Tue, 10 Jan 2023 11:54:00 +0200 Subject: [PATCH 1/4] added more information on ws events --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/README.md b/README.md index 70cc2db2..a4bfd697 100644 --- a/README.md +++ b/README.md @@ -299,3 +299,73 @@ A subscription example with `eventType` will be like this: Note: if eventType type is not specified, it will be set to `all_events` by default. + +The payload data will consist of a marshalled object containing the event type and the +inner marshalled data like: +```json +{ + "type": "all_events", + "data": "<< marshalled object here >>", +} +``` + +There are multiple event types available, they can be found as constants in common package, +[constants](https://github.com/multiversx/mx-chain-notifier-go/blob/main/common/constants.go). Below there is the event type together with the associated marshalled data type. +- `all_events` +```json +{ + "hash": "blockHash1", + "events": [ + { + "address": "addr1", + "identifier": "identifier", + ... + } + ] +} +``` + +- `revert_events` +```json +{ + "hash": "blockHash1", + "nonce": 11, + "round": 2, + "epoch": 1, +} +``` + +- `finalized_events` +```json +{ + "hash": "blockHash" +} +``` + +- `block_txs`: +```json +{ + "hash": "blockHash1", + "txs": { + "txHash1": { + "Nonce": 123, + "Round": 1, + "Epoch": 1, + ... + } + } +} +``` + +- `block_scrs` +```json +{ + "hash": "blockHash1", + "scrs": { + "scrHash1": { + "Nonce": 123, + ... + } + } +} +``` From 399b845b066a68b6ebf712fe1aecd607660dfe32 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Tue, 31 Jan 2023 09:15:14 +0200 Subject: [PATCH 2/4] info on data structures --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a4bfd697..f1a66d63 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,10 @@ If `--api-type` command line parameter is set to `rabbit-api`, the notifier inst will try to publish events to `RabbitMQ`. Check `RabbitMQ` section for config in order to set up the url and exchanges properly. +There are multiple exchanges that can be used, they can be found in the main config file +in the `RabbitMQ` section. The data structures corresponding to these exchanges are defined +in code in `data/outport.go` file. + ## Subscribing Once the proxy is launched together with the observer/s, the driver's methods From 8441e93dab29156211daaefbbbe8c9be516be8d5 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Wed, 22 Feb 2023 15:04:03 +0200 Subject: [PATCH 3/4] small name change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1a66d63..725abc6a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Elrond events notifier -The notifier service is a component that receives block events synchronously +The events notifier service is a component that receives block events synchronously from elrond observer nodes, and it forwards them to a subscribing component (via message queuing service or websockets) From 96dc29cd7b97b63dfd5ba0adca1e1540baaf4080 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Wed, 22 Feb 2023 15:05:02 +0200 Subject: [PATCH 4/4] Revert "small name change" This reverts commit 8441e93dab29156211daaefbbbe8c9be516be8d5. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 725abc6a..f1a66d63 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Elrond events notifier -The events notifier service is a component that receives block events synchronously +The notifier service is a component that receives block events synchronously from elrond observer nodes, and it forwards them to a subscribing component (via message queuing service or websockets)