Skip to content

Commit

Permalink
indexer: add es mappings and update code (#1862)
Browse files Browse the repository at this point in the history
* indexer: add es mappings and update code

* rpc: update serde u64 helpers

* fix test

* use meta view

* fix uint 0x
  • Loading branch information
nanne007 authored Dec 22, 2020
1 parent ca1cf3c commit a2427a5
Show file tree
Hide file tree
Showing 8 changed files with 868 additions and 91 deletions.
364 changes: 364 additions & 0 deletions cmd/indexer/mappings/block.mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,364 @@
{
"mappings": {
"properties": {
"body": {
"properties": {
"Full": {
"type": "nested",
"properties": {
"authenticator": {
"properties": {
"Ed25519": {
"properties": {
"public_key": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"signature": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"MultiEd25519": {
"properties": {
"public_key": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"signature": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
},
"raw_txn": {
"properties": {
"chain_id": {
"type": "long"
},
"expiration_timestamp_secs": {
"type": "date",
"format": "epoch_second"
},
"gas_token_code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"gas_unit_price": {
"type": "long"
},
"max_gas_amount": {
"type": "long"
},
"payload": {
"type": "text"
},
"sender": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"sequence_number": {
"type": "long"
}
}
},
"transaction_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
},
"header": {
"properties": {
"accumulator_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author_auth_key": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"block_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"body_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"chain_id": {
"type": "long"
},
"difficulty": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"gas_used": {
"type": "long"
},
"nonce": {
"type": "long"
},
"number": {
"type": "long"
},
"parent_block_accumulator_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"parent_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"state_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "date"
}
}
},
"metadata": {
"properties": {
"author": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author_auth_key": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"chain_id": {
"properties": {
"id": {
"type": "long"
}
}
},
"number": {
"type": "long"
},
"parent_gas_used": {
"type": "long"
},
"parent_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "date"
},
"uncles": {
"type": "long"
}
}
},
"uncles": {
"type": "nested",
"properties": {
"accumulator_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author_auth_key": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"block_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"body_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"chain_id": {
"type": "long"
},
"difficulty": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"gas_used": {
"type": "long"
},
"nonce": {
"type": "long"
},
"number": {
"type": "long"
},
"parent_block_accumulator_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"parent_hash": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"state_root": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "date"
}
}
}
}
}
}
Loading

0 comments on commit a2427a5

Please sign in to comment.