Skip to content

Commit

Permalink
Merge pull request #12 from keyko-io/feature/update-records-to-postgres
Browse files Browse the repository at this point in the history
Log records schemas to be compatible with postgres
  • Loading branch information
Enrique Ruiz authored Mar 24, 2020
2 parents 1b4c663 + c7559bf commit 2a92ade
Show file tree
Hide file tree
Showing 15 changed files with 267 additions and 275 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 7 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.keyko.monitoring</groupId>
<artifactId>schemas</artifactId>
<packaging>jar</packaging>
<version>0.2.6</version>
<version>0.3.0</version>
<name>Web3 Monitoring Schemas</name>
<url>https://github.com/keyko-io/web3-monitoring-schemas</url>

Expand Down Expand Up @@ -99,12 +99,14 @@
<include>**/*.avsc</include>
</includes>
<imports>
<import>${project.basedir}/src/main/resources/avro/ContractEventStatus.avsc</import>
<import>${project.basedir}/src/main/resources/avro/NumberParameter.avsc</import>
<import>${project.basedir}/src/main/resources/avro/StringParameter.avsc</import>
<import>${project.basedir}/src/main/resources/avro/ViewDetailsRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/BlockDetailsRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/EventDetailsRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/TransactionDetailsRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/ViewRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/BlockRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/EventsRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/LogRecordRecord.avsc</import>
<import>${project.basedir}/src/main/resources/avro/TransactionRecord.avsc</import>
</imports>
</configuration>
</execution>
Expand Down
23 changes: 0 additions & 23 deletions src/main/resources/avro/BlockDetailsRecord.avsc

This file was deleted.

15 changes: 12 additions & 3 deletions src/main/resources/avro/BlockRecord.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions src/main/resources/avro/ContractEventStatus.avsc
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
]
}

12 changes: 4 additions & 8 deletions src/main/resources/avro/EventBlockRecord.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
85 changes: 0 additions & 85 deletions src/main/resources/avro/EventDetailsRecord.avsc

This file was deleted.

63 changes: 60 additions & 3 deletions src/main/resources/avro/EventRecord.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
43 changes: 40 additions & 3 deletions src/main/resources/avro/LogRecord.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 2a92ade

Please sign in to comment.