diff --git a/README.md b/README.md index b57ddfb..5432410 100644 --- a/README.md +++ b/README.md @@ -38,19 +38,15 @@ You can include the stubs generated with the schemas including the following dep The AVRO implementation of the schemas can be found in the **src/main/resources/avro/** folder. This are the schemas implemented: * AlertRecord.avsc -* BlockDetailsRecord.avsc * BlockRecord.avsc * EventBlockRecord.avsc -* EventDetailsRecord.avsc * EventRecord.avsc -* LogDetailsRecord.avsc * LogRecord.avsc +* LogRecordTopicsFlattened.avsc * NumberParameter.avsc * StringParameter.avsc * TimeSeriesParameter.avsc * TimeSeriesRecord.avsc -* TransactionDetailsRecord.avsc * TransactionRecord.avsc * ViewBlockRecord.avsc -* ViewDetailsRecord.avsc * ViewRecord.avsc diff --git a/pom.xml b/pom.xml index 6d41f9c..8866879 100755 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ io.keyko.monitoring schemas jar - 0.2.6 + 0.3.0 Web3 Monitoring Schemas https://github.com/keyko-io/web3-monitoring-schemas @@ -99,12 +99,14 @@ **/*.avsc + ${project.basedir}/src/main/resources/avro/ContractEventStatus.avsc ${project.basedir}/src/main/resources/avro/NumberParameter.avsc ${project.basedir}/src/main/resources/avro/StringParameter.avsc - ${project.basedir}/src/main/resources/avro/ViewDetailsRecord.avsc - ${project.basedir}/src/main/resources/avro/BlockDetailsRecord.avsc - ${project.basedir}/src/main/resources/avro/EventDetailsRecord.avsc - ${project.basedir}/src/main/resources/avro/TransactionDetailsRecord.avsc + ${project.basedir}/src/main/resources/avro/ViewRecord.avsc + ${project.basedir}/src/main/resources/avro/BlockRecord.avsc + ${project.basedir}/src/main/resources/avro/EventsRecord.avsc + ${project.basedir}/src/main/resources/avro/LogRecordRecord.avsc + ${project.basedir}/src/main/resources/avro/TransactionRecord.avsc diff --git a/src/main/resources/avro/BlockDetailsRecord.avsc b/src/main/resources/avro/BlockDetailsRecord.avsc deleted file mode 100644 index 3b938f5..0000000 --- a/src/main/resources/avro/BlockDetailsRecord.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "namespace": "io.keyko.monitoring.schemas", - "type": "record", - "name": "BlockDetailsRecord", - "fields": [{ - "name": "number", - "type": "long" - }, - { - "name": "hash", - "type": "string" - }, - { - "name": "timestamp", - "type": "long", - "logicalType": "timestamp-millis" - }, - { - "name": "nodeName", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/avro/BlockRecord.avsc b/src/main/resources/avro/BlockRecord.avsc index 1559377..a1445d2 100644 --- a/src/main/resources/avro/BlockRecord.avsc +++ b/src/main/resources/avro/BlockRecord.avsc @@ -7,12 +7,21 @@ "type": "string" }, { - "name": "type", + "name": "number", + "type": "long" + }, + { + "name": "hash", "type": "string" }, { - "name": "details", - "type": "BlockDetailsRecord" + "name": "timestamp", + "type": "long", + "logicalType": "timestamp-millis" + }, + { + "name": "nodeName", + "type": "string" }, { "name": "retries", diff --git a/src/main/resources/avro/ContractEventStatus.avsc b/src/main/resources/avro/ContractEventStatus.avsc new file mode 100644 index 0000000..a947cf3 --- /dev/null +++ b/src/main/resources/avro/ContractEventStatus.avsc @@ -0,0 +1,19 @@ +{ + "namespace": "io.keyko.monitoring.schemas", + "name": "ContractEventStatus", + "type": "record", + "fields": [ + { "name": "status", + "type": { + "name": "statuses", + "type": "enum", + "symbols": [ + "UNCONFIRMED", + "CONFIRMED", + "INVALIDATED" + ] + } + } + ] +} + diff --git a/src/main/resources/avro/EventBlockRecord.avsc b/src/main/resources/avro/EventBlockRecord.avsc index 4e887e8..1af697b 100644 --- a/src/main/resources/avro/EventBlockRecord.avsc +++ b/src/main/resources/avro/EventBlockRecord.avsc @@ -7,16 +7,12 @@ "type": "string" }, { - "name": "type", - "type": "string" - }, - { - "name": "details", - "type": "EventDetailsRecord" + "name": "event", + "type": "EventRecord" }, { - "name": "detailsBlock", - "type": "BlockDetailsRecord" + "name": "block", + "type": "BlockRecord" }, { "name": "retries", diff --git a/src/main/resources/avro/EventDetailsRecord.avsc b/src/main/resources/avro/EventDetailsRecord.avsc deleted file mode 100644 index 0766f30..0000000 --- a/src/main/resources/avro/EventDetailsRecord.avsc +++ /dev/null @@ -1,85 +0,0 @@ -{ - "namespace": "io.keyko.monitoring.schemas", - "type": "record", - "name": "EventDetailsRecord", - "fields": [ - - { - "name": "name", - "type": "string" - }, - { - "name": "contractName", - "type": "string", - "default": "" - }, - { - "name": "filterId", - "type": "string" - }, - { - "name": "nodeName", - "type": "string" - }, - { - "name": "indexedParameters", - "type": { - "type": "array", - "items": ["StringParameter", "NumberParameter"] - } - }, - - { - "name": "nonIndexedParameters", - "type": { - "type": "array", - "items": ["StringParameter", "NumberParameter"] - } - }, - { - "name": "transactionHash", - "type": "string" - }, - { - "name": "logIndex", - "type": "string", - "java-class": "java.math.BigInteger" - }, - { - "name": "blockNumber", - "type": "long" - }, - { - "name": "blockHash", - "type": "string" - }, - { - "name": "address", - "type": "string" - }, - { - "name": "status", - "type": { - "name": "ContractEventStatus", - "type": "enum", - "symbols": [ - "UNCONFIRMED", - "CONFIRMED", - "INVALIDATED" - ] - } - }, - { - "name": "eventSpecificationSignature", - "type": "string" - }, - { - "name": "networkName", - "type": "string" - }, - { - "name": "id", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/avro/EventRecord.avsc b/src/main/resources/avro/EventRecord.avsc index 523604e..32be8f1 100644 --- a/src/main/resources/avro/EventRecord.avsc +++ b/src/main/resources/avro/EventRecord.avsc @@ -7,12 +7,69 @@ "type": "string" }, { - "name": "type", + "name": "name", "type": "string" }, { - "name": "details", - "type": "EventDetailsRecord" + "name": "contractName", + "type": "string", + "default": "" + }, + { + "name": "filterId", + "type": "string" + }, + { + "name": "nodeName", + "type": "string" + }, + { + "name": "indexedParameters", + "type": { + "type": "array", + "items": ["StringParameter", "NumberParameter"] + } + }, + + { + "name": "nonIndexedParameters", + "type": { + "type": "array", + "items": ["StringParameter", "NumberParameter"] + } + }, + { + "name": "transactionHash", + "type": "string" + }, + { + "name": "logIndex", + "type": "string", + "java-class": "java.math.BigInteger" + }, + { + "name": "blockNumber", + "type": "long" + }, + { + "name": "blockHash", + "type": "string" + }, + { + "name": "address", + "type": "string" + }, + { + "name": "status", + "type": "ContractEventStatus" + }, + { + "name": "eventSpecificationSignature", + "type": "string" + }, + { + "name": "networkName", + "type": "string" }, { "name": "retries", diff --git a/src/main/resources/avro/LogRecord.avsc b/src/main/resources/avro/LogRecord.avsc index e396c4c..cf33cf0 100644 --- a/src/main/resources/avro/LogRecord.avsc +++ b/src/main/resources/avro/LogRecord.avsc @@ -7,12 +7,49 @@ "type": "string" }, { - "name": "type", + "name": "nodeName", "type": "string" }, { - "name": "details", - "type": "LogDetailsRecord" + "name": "data", + "type":"string" + }, + { + "name": "topics", + "type": { + "name": "topic", + "type": "array", + "items": "string" + } + }, + { + "name": "transactionHash", + "type": "string" + }, + { + "name": "logIndex", + "type": "string", + "java-class": "java.math.BigInteger" + }, + { + "name": "blockNumber", + "type": "long" + }, + { + "name": "blockHash", + "type": "string" + }, + { + "name": "address", + "type": "string" + }, + { + "name": "networkName", + "type": "string" + }, + { + "name": "status", + "type": "ContractEventStatus" }, { "name": "retries", diff --git a/src/main/resources/avro/LogDetailsRecord.avsc b/src/main/resources/avro/LogRecordTopicsFlattened.avsc similarity index 54% rename from src/main/resources/avro/LogDetailsRecord.avsc rename to src/main/resources/avro/LogRecordTopicsFlattened.avsc index 3b5851b..c29a3c2 100644 --- a/src/main/resources/avro/LogDetailsRecord.avsc +++ b/src/main/resources/avro/LogRecordTopicsFlattened.avsc @@ -1,8 +1,11 @@ { "namespace": "io.keyko.monitoring.schemas", "type": "record", - "name": "LogDetailsRecord", - "fields": [ + "name": "LogRecordTopicsFlattened", + "fields": [{ + "name": "id", + "type": "string" + }, { "name": "nodeName", "type": "string" @@ -12,11 +15,24 @@ "type":"string" }, { - "name": "topics", - "type": { - "type": "array", - "items": ["string"] - } + "name": "topic0", + "type": "string", + "default": "" + }, + { + "name": "topic1", + "type": "string", + "default": "" + }, + { + "name": "topic2", + "type": "string", + "default": "" + }, + { + "name": "topic3", + "type": "string", + "default": "" }, { "name": "transactionHash", @@ -44,8 +60,12 @@ "type": "string" }, { - "name": "id", - "type": "string" + "name": "status", + "type": "ContractEventStatus" + }, + { + "name": "retries", + "type": "int" } ] } \ No newline at end of file diff --git a/src/main/resources/avro/TransactionDetailsRecord.avsc b/src/main/resources/avro/TransactionDetailsRecord.avsc deleted file mode 100644 index 8f16bfb..0000000 --- a/src/main/resources/avro/TransactionDetailsRecord.avsc +++ /dev/null @@ -1,64 +0,0 @@ -{ - "namespace": "io.keyko.monitoring.schemas", - "type": "record", - "name": "TransactionDetailsRecord", - "fields": [{ - "name": "hash", - "type": "string" - }, - { - "name": "nonce", - "type": "string" - }, - { - "name": "blockNumber", - "type": "long" - }, - { - "name": "blockHash", - "type": "string" - }, - { - "name": "transactionIndex", - "type": "string" - }, - { - "name": "from", - "type": "string" - }, - { - "name": "to", - "type": "string" - }, - { - "name": "value", - "type": "string" - }, - { - "name": "nodeName", - "type": "string" - }, - { - "name": "contractAddress", - "type": "string" - }, - { - "name": "input", - "type": "string" - }, - { - "name": "revertReason", - "type": "string" - }, - { - "name": "status", - "type": { - "name": "TransactionStatus", - "type": "enum", - "symbols": [ - "UNCONFIRMED", "CONFIRMED", "INVALIDATED", "FAILED" - ] - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/avro/TransactionRecord.avsc b/src/main/resources/avro/TransactionRecord.avsc index 48c1a5d..ceb8f91 100644 --- a/src/main/resources/avro/TransactionRecord.avsc +++ b/src/main/resources/avro/TransactionRecord.avsc @@ -7,12 +7,62 @@ "type": "string" }, { - "name": "type", + "name": "hash", "type": "string" }, { - "name": "details", - "type": "TransactionDetailsRecord" + "name": "nonce", + "type": "string" + }, + { + "name": "blockNumber", + "type": "long" + }, + { + "name": "blockHash", + "type": "string" + }, + { + "name": "transactionIndex", + "type": "string" + }, + { + "name": "from", + "type": "string" + }, + { + "name": "to", + "type": "string" + }, + { + "name": "value", + "type": "string" + }, + { + "name": "nodeName", + "type": "string" + }, + { + "name": "contractAddress", + "type": "string" + }, + { + "name": "input", + "type": "string" + }, + { + "name": "revertReason", + "type": "string" + }, + { + "name": "status", + "type": { + "name": "TransactionStatus", + "type": "enum", + "symbols": [ + "UNCONFIRMED", "CONFIRMED", "INVALIDATED", "FAILED" + ] + } }, { "name": "retries", diff --git a/src/main/resources/avro/ViewBlockRecord.avsc b/src/main/resources/avro/ViewBlockRecord.avsc index 91cce64..25ed0e7 100644 --- a/src/main/resources/avro/ViewBlockRecord.avsc +++ b/src/main/resources/avro/ViewBlockRecord.avsc @@ -7,16 +7,12 @@ "type": "string" }, { - "name": "type", - "type": "string" - }, - { - "name": "details", - "type": "ViewDetailsRecord" + "name": "view", + "type": "ViewRecord" }, { - "name": "detailsBlock", - "type": "BlockDetailsRecord" + "name": "block", + "type": "BlockRecord" }, { "name": "retries", diff --git a/src/main/resources/avro/ViewDetailsRecord.avsc b/src/main/resources/avro/ViewDetailsRecord.avsc deleted file mode 100644 index dfded0f..0000000 --- a/src/main/resources/avro/ViewDetailsRecord.avsc +++ /dev/null @@ -1,52 +0,0 @@ -{ - "namespace": "io.keyko.monitoring.schemas", - "type": "record", - "name": "ViewDetailsRecord", - "fields": [{ - "name": "name", - "type": "string" - }, - { - "name": "contractName", - "type": "string", - "default": "" - }, - { - "name": "filterId", - "type": "string" - }, - { - "name": "nodeName", - "type": "string" - }, - { - "name": "output", - "type": { - "type": "array", - "items": ["StringParameter", "NumberParameter"] - } - }, - - { - "name": "blockNumber", - "type": "long" - }, - { - "name": "blockHash", - "type": "string" - }, - { - "name": "address", - "type": "string" - }, - { - "name": "networkName", - "type": "string" - }, - { - "name": "id", - "type": "string" - } - - ] -} \ No newline at end of file diff --git a/src/main/resources/avro/ViewRecord.avsc b/src/main/resources/avro/ViewRecord.avsc index ecab3ad..d8c485b 100644 --- a/src/main/resources/avro/ViewRecord.avsc +++ b/src/main/resources/avro/ViewRecord.avsc @@ -2,17 +2,51 @@ "namespace": "io.keyko.monitoring.schemas", "type": "record", "name": "ViewRecord", - "fields": [{ + "fields": [ + { "name": "id", "type": "string" }, { - "name": "type", + "name": "name", + "type": "string" + }, + { + "name": "contractName", + "type": "string", + "default": "" + }, + { + "name": "filterId", + "type": "string" + }, + { + "name": "nodeName", + "type": "string" + }, + { + "name": "output", + "type": { + "type": "array", + "items": ["StringParameter", "NumberParameter"] + } + }, + + { + "name": "blockNumber", + "type": "long" + }, + { + "name": "blockHash", + "type": "string" + }, + { + "name": "address", "type": "string" }, { - "name": "details", - "type": "ViewDetailsRecord" + "name": "networkName", + "type": "string" }, { "name": "retries",