From bf2b6a61ad47597da152efd8c963ba33ef3446b3 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 5 Jun 2025 14:47:07 +0300 Subject: [PATCH 1/3] remove kibana stuff no longer used --- cmd/elasticindexer/config/prefs.toml | 1 - go.mod | 2 +- go.sum | 4 +- integrationtests/claimRewards_test.go | 3 +- process/elasticproc/elasticProcessor.go | 13 +- .../factory/elasticProcessorFactory.go | 2 +- .../templatesAndPolicies/noKibana.go | 53 ---- .../templatesAndPolicies/reader.go | 53 ++++ .../{noKibana_test.go => reader_test.go} | 2 +- .../templatesAndPoliciesFactory.go | 10 - .../templatesAndPoliciesFactory_test.go | 25 -- .../templatesAndPolicies/withKibana.go | 77 ------ .../templatesAndPolicies/withKibana_test.go | 18 -- templates/{noKibana => indices}/accounts.go | 2 +- .../{noKibana => indices}/accountsESDT.go | 2 +- .../accountsESDTHistory.go | 2 +- .../{noKibana => indices}/accountsHistory.go | 2 +- templates/{noKibana => indices}/blocks.go | 2 +- templates/{noKibana => indices}/delegators.go | 2 +- templates/{noKibana => indices}/deploys.go | 2 +- templates/{noKibana => indices}/epochInfo.go | 2 +- templates/{noKibana => indices}/esdts.go | 2 +- templates/{noKibana => indices}/events.go | 2 +- templates/{noKibana => indices}/logs.go | 2 +- templates/{noKibana => indices}/miniblocks.go | 2 +- templates/{noKibana => indices}/opendistro.go | 2 +- templates/{noKibana => indices}/operations.go | 2 +- templates/{noKibana => indices}/rating.go | 2 +- templates/{noKibana => indices}/receipts.go | 2 +- templates/{noKibana => indices}/rounds.go | 2 +- templates/{noKibana => indices}/scResults.go | 2 +- templates/{noKibana => indices}/tags.go | 2 +- templates/{noKibana => indices}/tokens.go | 2 +- .../{noKibana => indices}/transactions.go | 2 +- templates/{noKibana => indices}/validators.go | 2 +- templates/{noKibana => indices}/values.go | 2 +- templates/withKibana/accounts.go | 61 ----- templates/withKibana/accountsESDT.go | 86 ------ templates/withKibana/accountsESDTHistory.go | 45 ---- .../withKibana/accountsESDTHistoryPolicy.go | 44 --- templates/withKibana/accountsESDTPolicy.go | 44 --- templates/withKibana/accountsHistory.go | 36 --- templates/withKibana/accountsHistoryPolicy.go | 44 --- templates/withKibana/accountsPolicy.go | 44 --- templates/withKibana/blocks.go | 251 ------------------ templates/withKibana/blocksPolicy.go | 44 --- templates/withKibana/delegators.go | 54 ---- templates/withKibana/deploys.go | 65 ----- templates/withKibana/epochInfo.go | 22 -- templates/withKibana/esdts.go | 130 --------- templates/withKibana/logs.go | 44 --- templates/withKibana/miniblocks.go | 45 ---- templates/withKibana/miniblocksPolicy.go | 44 --- templates/withKibana/opendistro.go | 12 - templates/withKibana/operations.go | 174 ------------ templates/withKibana/rating.go | 20 -- templates/withKibana/ratingPolicy.go | 44 --- templates/withKibana/receipts.go | 42 --- templates/withKibana/receiptsPolicy.go | 44 --- templates/withKibana/rounds.go | 44 --- templates/withKibana/roundsPolicy.go | 44 --- templates/withKibana/scResults.go | 114 -------- templates/withKibana/scResultsPolicy.go | 44 --- templates/withKibana/tags.go | 22 -- templates/withKibana/tokens.go | 172 ------------ templates/withKibana/transactions.go | 141 ---------- templates/withKibana/transactionsPolicy.go | 44 --- templates/withKibana/validators.go | 19 -- templates/withKibana/validatorsPolicy.go | 44 --- 69 files changed, 85 insertions(+), 2351 deletions(-) delete mode 100644 process/elasticproc/templatesAndPolicies/noKibana.go create mode 100644 process/elasticproc/templatesAndPolicies/reader.go rename process/elasticproc/templatesAndPolicies/{noKibana_test.go => reader_test.go} (87%) delete mode 100644 process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory.go delete mode 100644 process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory_test.go delete mode 100644 process/elasticproc/templatesAndPolicies/withKibana.go delete mode 100644 process/elasticproc/templatesAndPolicies/withKibana_test.go rename templates/{noKibana => indices}/accounts.go (98%) rename templates/{noKibana => indices}/accountsESDT.go (98%) rename templates/{noKibana => indices}/accountsESDTHistory.go (98%) rename templates/{noKibana => indices}/accountsHistory.go (97%) rename templates/{noKibana => indices}/blocks.go (99%) rename templates/{noKibana => indices}/delegators.go (98%) rename templates/{noKibana => indices}/deploys.go (98%) rename templates/{noKibana => indices}/epochInfo.go (96%) rename templates/{noKibana => indices}/esdts.go (99%) rename templates/{noKibana => indices}/events.go (98%) rename templates/{noKibana => indices}/logs.go (97%) rename templates/{noKibana => indices}/miniblocks.go (98%) rename templates/{noKibana => indices}/opendistro.go (93%) rename templates/{noKibana => indices}/operations.go (99%) rename templates/{noKibana => indices}/rating.go (95%) rename templates/{noKibana => indices}/receipts.go (97%) rename templates/{noKibana => indices}/rounds.go (97%) rename templates/{noKibana => indices}/scResults.go (99%) rename templates/{noKibana => indices}/tags.go (95%) rename templates/{noKibana => indices}/tokens.go (99%) rename templates/{noKibana => indices}/transactions.go (99%) rename templates/{noKibana => indices}/validators.go (95%) rename templates/{noKibana => indices}/values.go (95%) delete mode 100644 templates/withKibana/accounts.go delete mode 100644 templates/withKibana/accountsESDT.go delete mode 100644 templates/withKibana/accountsESDTHistory.go delete mode 100644 templates/withKibana/accountsESDTHistoryPolicy.go delete mode 100644 templates/withKibana/accountsESDTPolicy.go delete mode 100644 templates/withKibana/accountsHistory.go delete mode 100644 templates/withKibana/accountsHistoryPolicy.go delete mode 100644 templates/withKibana/accountsPolicy.go delete mode 100644 templates/withKibana/blocks.go delete mode 100644 templates/withKibana/blocksPolicy.go delete mode 100644 templates/withKibana/delegators.go delete mode 100644 templates/withKibana/deploys.go delete mode 100644 templates/withKibana/epochInfo.go delete mode 100644 templates/withKibana/esdts.go delete mode 100644 templates/withKibana/logs.go delete mode 100644 templates/withKibana/miniblocks.go delete mode 100644 templates/withKibana/miniblocksPolicy.go delete mode 100644 templates/withKibana/opendistro.go delete mode 100644 templates/withKibana/operations.go delete mode 100644 templates/withKibana/rating.go delete mode 100644 templates/withKibana/ratingPolicy.go delete mode 100644 templates/withKibana/receipts.go delete mode 100644 templates/withKibana/receiptsPolicy.go delete mode 100644 templates/withKibana/rounds.go delete mode 100644 templates/withKibana/roundsPolicy.go delete mode 100644 templates/withKibana/scResults.go delete mode 100644 templates/withKibana/scResultsPolicy.go delete mode 100644 templates/withKibana/tags.go delete mode 100644 templates/withKibana/tokens.go delete mode 100644 templates/withKibana/transactions.go delete mode 100644 templates/withKibana/transactionsPolicy.go delete mode 100644 templates/withKibana/validators.go delete mode 100644 templates/withKibana/validatorsPolicy.go diff --git a/cmd/elasticindexer/config/prefs.toml b/cmd/elasticindexer/config/prefs.toml index 2685e4b8..b60b6ce6 100644 --- a/cmd/elasticindexer/config/prefs.toml +++ b/cmd/elasticindexer/config/prefs.toml @@ -18,7 +18,6 @@ acknowledge-timeout-in-seconds = 50 [config.elastic-cluster] - use-kibana = false url = "http://localhost:9200" username = "" password = "" diff --git a/go.mod b/go.mod index 74cb6e77..0aeaf8e3 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gin-gonic/gin v1.10.0 github.com/google/uuid v1.6.0 github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476 - github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a + github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39 github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273 github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250520075408-c94bee9ee163 github.com/prometheus/client_model v0.6.1 diff --git a/go.sum b/go.sum index 31e379a7..d68cc34c 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,8 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476 h1:Dn73bH1AdG+7+3/FFRfOiivOEvwPyzZUBWWxpk8QVxc= github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476/go.mod h1:99+FW6f7X0Ri5tph+2l2GaDVrdej1do89exkfh7gilE= -github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a h1:dhCobNEcBdvutX+0UYF/l86oLVO9iUiUeF3sLFa9qhE= -github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g= +github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39 h1:a+98PN1XXTCYiJEdg7gpqfTOxGuQqvA8H1yglidV/p0= +github.com/multiversx/mx-chain-core-go v1.3.2-0.20250602142114-cb1013453d39/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g= github.com/multiversx/mx-chain-crypto-go v1.2.13-0.20250520075055-8ab2a164945d h1:NI5uKpkwP5XZu9gtDiWxmbbb07T9hXegPist17WAzY4= github.com/multiversx/mx-chain-crypto-go v1.2.13-0.20250520075055-8ab2a164945d/go.mod h1:yekQt4uB5LYXtimbhpdUbnFexjucWrQG/t+AX55bdM8= github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273 h1:1I2CgGDAMINxrKI6yzSP/Y6Wow2YUmqegUXcltpGXQA= diff --git a/integrationtests/claimRewards_test.go b/integrationtests/claimRewards_test.go index 8901fe1f..9d9b11cf 100644 --- a/integrationtests/claimRewards_test.go +++ b/integrationtests/claimRewards_test.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "math/big" "testing" + "time" "github.com/multiversx/mx-chain-core-go/core" dataBlock "github.com/multiversx/mx-chain-core-go/data/block" @@ -29,7 +30,7 @@ func TestTransactionWithClaimRewardsGasRefund(t *testing.T) { txHash := []byte("claimRewards") header := &dataBlock.Header{ Round: 50, - TimeStamp: 5040, + TimeStamp: uint64(time.Now().Unix()), ShardID: core.MetachainShardId, } diff --git a/process/elasticproc/elasticProcessor.go b/process/elasticproc/elasticProcessor.go index 89634a95..dc94c30c 100644 --- a/process/elasticproc/elasticProcessor.go +++ b/process/elasticproc/elasticProcessor.go @@ -96,7 +96,7 @@ func NewElasticProcessor(arguments *ArgElasticProcessor) (*elasticProcessor, err bulkRequestMaxSize: arguments.BulkRequestMaxSize, } - err = ei.init(arguments.UseKibana, arguments.IndexTemplates, arguments.IndexPolicies, arguments.ExtraMappings) + err = ei.init(arguments.IndexTemplates, arguments.IndexPolicies, arguments.ExtraMappings) if err != nil { return nil, err } @@ -107,21 +107,12 @@ func NewElasticProcessor(arguments *ArgElasticProcessor) (*elasticProcessor, err } // TODO move all the index create part in a new component -func (ei *elasticProcessor) init(useKibana bool, indexTemplates, _ map[string]*bytes.Buffer, extraMappings []templates.ExtraMapping) error { +func (ei *elasticProcessor) init(indexTemplates, _ map[string]*bytes.Buffer, extraMappings []templates.ExtraMapping) error { err := ei.createOpenDistroTemplates(indexTemplates) if err != nil { return err } - //nolint - if useKibana { - // TODO: Re-activate after we think of a solid way to handle forks+rotating indexes - // err = ei.createIndexPolicies(indexPolicies) - // if err != nil { - // return err - // } - } - err = ei.createIndexTemplates(indexTemplates) if err != nil { return err diff --git a/process/elasticproc/factory/elasticProcessorFactory.go b/process/elasticproc/factory/elasticProcessorFactory.go index 37ea72e0..92624338 100644 --- a/process/elasticproc/factory/elasticProcessorFactory.go +++ b/process/elasticproc/factory/elasticProcessorFactory.go @@ -35,7 +35,7 @@ type ArgElasticProcessorFactory struct { // CreateElasticProcessor will create a new instance of ElasticProcessor func CreateElasticProcessor(arguments ArgElasticProcessorFactory) (dataindexer.ElasticProcessor, error) { - templatesAndPoliciesReader := templatesAndPolicies.CreateTemplatesAndPoliciesReader(arguments.UseKibana) + templatesAndPoliciesReader := templatesAndPolicies.NewTemplatesAndPolicyReader() indexTemplates, indexPolicies, err := templatesAndPoliciesReader.GetElasticTemplatesAndPolicies() if err != nil { return nil, err diff --git a/process/elasticproc/templatesAndPolicies/noKibana.go b/process/elasticproc/templatesAndPolicies/noKibana.go deleted file mode 100644 index 3840c71c..00000000 --- a/process/elasticproc/templatesAndPolicies/noKibana.go +++ /dev/null @@ -1,53 +0,0 @@ -package templatesAndPolicies - -import ( - "bytes" - - indexer "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer" - "github.com/multiversx/mx-chain-es-indexer-go/templates" - "github.com/multiversx/mx-chain-es-indexer-go/templates/noKibana" -) - -type templatesAndPolicyReaderNoKibana struct{} - -// NewTemplatesAndPolicyReaderNoKibana will create a new instance of templatesAndPolicyReaderNoKibana -func NewTemplatesAndPolicyReaderNoKibana() *templatesAndPolicyReaderNoKibana { - return new(templatesAndPolicyReaderNoKibana) -} - -// GetElasticTemplatesAndPolicies will return templates and policies -func (tr *templatesAndPolicyReaderNoKibana) GetElasticTemplatesAndPolicies() (map[string]*bytes.Buffer, map[string]*bytes.Buffer, error) { - indexPolicies := make(map[string]*bytes.Buffer) - indexTemplates := make(map[string]*bytes.Buffer) - - indexTemplates["opendistro"] = noKibana.OpenDistro.ToBuffer() - indexTemplates[indexer.TransactionsIndex] = noKibana.Transactions.ToBuffer() - indexTemplates[indexer.BlockIndex] = noKibana.Blocks.ToBuffer() - indexTemplates[indexer.MiniblocksIndex] = noKibana.Miniblocks.ToBuffer() - indexTemplates[indexer.RatingIndex] = noKibana.Rating.ToBuffer() - indexTemplates[indexer.RoundsIndex] = noKibana.Rounds.ToBuffer() - indexTemplates[indexer.ValidatorsIndex] = noKibana.Validators.ToBuffer() - indexTemplates[indexer.AccountsIndex] = noKibana.Accounts.ToBuffer() - indexTemplates[indexer.AccountsHistoryIndex] = noKibana.AccountsHistory.ToBuffer() - indexTemplates[indexer.AccountsESDTIndex] = noKibana.AccountsESDT.ToBuffer() - indexTemplates[indexer.AccountsESDTHistoryIndex] = noKibana.AccountsESDTHistory.ToBuffer() - indexTemplates[indexer.EpochInfoIndex] = noKibana.EpochInfo.ToBuffer() - indexTemplates[indexer.ReceiptsIndex] = noKibana.Receipts.ToBuffer() - indexTemplates[indexer.ScResultsIndex] = noKibana.SCResults.ToBuffer() - indexTemplates[indexer.SCDeploysIndex] = noKibana.SCDeploys.ToBuffer() - indexTemplates[indexer.TokensIndex] = noKibana.Tokens.ToBuffer() - indexTemplates[indexer.TagsIndex] = noKibana.Tags.ToBuffer() - indexTemplates[indexer.LogsIndex] = noKibana.Logs.ToBuffer() - indexTemplates[indexer.DelegatorsIndex] = noKibana.Delegators.ToBuffer() - indexTemplates[indexer.OperationsIndex] = noKibana.Operations.ToBuffer() - indexTemplates[indexer.ESDTsIndex] = noKibana.ESDTs.ToBuffer() - indexTemplates[indexer.ValuesIndex] = noKibana.Values.ToBuffer() - indexTemplates[indexer.EventsIndex] = noKibana.Events.ToBuffer() - - return indexTemplates, indexPolicies, nil -} - -// GetExtraMappings will return an array of indices extra mappings -func (tr *templatesAndPolicyReaderNoKibana) GetExtraMappings() ([]templates.ExtraMapping, error) { - return []templates.ExtraMapping{}, nil -} diff --git a/process/elasticproc/templatesAndPolicies/reader.go b/process/elasticproc/templatesAndPolicies/reader.go new file mode 100644 index 00000000..05743a1a --- /dev/null +++ b/process/elasticproc/templatesAndPolicies/reader.go @@ -0,0 +1,53 @@ +package templatesAndPolicies + +import ( + "bytes" + + indexer "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer" + "github.com/multiversx/mx-chain-es-indexer-go/templates" + "github.com/multiversx/mx-chain-es-indexer-go/templates/indices" +) + +type templatesAndPolicyReader struct{} + +// NewTemplatesAndPolicyReader will create a new instance of templatesAndPolicyReaderNoKibana +func NewTemplatesAndPolicyReader() *templatesAndPolicyReader { + return new(templatesAndPolicyReader) +} + +// GetElasticTemplatesAndPolicies will return templates and policies +func (tr *templatesAndPolicyReader) GetElasticTemplatesAndPolicies() (map[string]*bytes.Buffer, map[string]*bytes.Buffer, error) { + indexPolicies := make(map[string]*bytes.Buffer) + indexTemplates := make(map[string]*bytes.Buffer) + + indexTemplates["opendistro"] = indices.OpenDistro.ToBuffer() + indexTemplates[indexer.TransactionsIndex] = indices.Transactions.ToBuffer() + indexTemplates[indexer.BlockIndex] = indices.Blocks.ToBuffer() + indexTemplates[indexer.MiniblocksIndex] = indices.Miniblocks.ToBuffer() + indexTemplates[indexer.RatingIndex] = indices.Rating.ToBuffer() + indexTemplates[indexer.RoundsIndex] = indices.Rounds.ToBuffer() + indexTemplates[indexer.ValidatorsIndex] = indices.Validators.ToBuffer() + indexTemplates[indexer.AccountsIndex] = indices.Accounts.ToBuffer() + indexTemplates[indexer.AccountsHistoryIndex] = indices.AccountsHistory.ToBuffer() + indexTemplates[indexer.AccountsESDTIndex] = indices.AccountsESDT.ToBuffer() + indexTemplates[indexer.AccountsESDTHistoryIndex] = indices.AccountsESDTHistory.ToBuffer() + indexTemplates[indexer.EpochInfoIndex] = indices.EpochInfo.ToBuffer() + indexTemplates[indexer.ReceiptsIndex] = indices.Receipts.ToBuffer() + indexTemplates[indexer.ScResultsIndex] = indices.SCResults.ToBuffer() + indexTemplates[indexer.SCDeploysIndex] = indices.SCDeploys.ToBuffer() + indexTemplates[indexer.TokensIndex] = indices.Tokens.ToBuffer() + indexTemplates[indexer.TagsIndex] = indices.Tags.ToBuffer() + indexTemplates[indexer.LogsIndex] = indices.Logs.ToBuffer() + indexTemplates[indexer.DelegatorsIndex] = indices.Delegators.ToBuffer() + indexTemplates[indexer.OperationsIndex] = indices.Operations.ToBuffer() + indexTemplates[indexer.ESDTsIndex] = indices.ESDTs.ToBuffer() + indexTemplates[indexer.ValuesIndex] = indices.Values.ToBuffer() + indexTemplates[indexer.EventsIndex] = indices.Events.ToBuffer() + + return indexTemplates, indexPolicies, nil +} + +// GetExtraMappings will return an array of indices extra mappings +func (tr *templatesAndPolicyReader) GetExtraMappings() ([]templates.ExtraMapping, error) { + return []templates.ExtraMapping{}, nil +} diff --git a/process/elasticproc/templatesAndPolicies/noKibana_test.go b/process/elasticproc/templatesAndPolicies/reader_test.go similarity index 87% rename from process/elasticproc/templatesAndPolicies/noKibana_test.go rename to process/elasticproc/templatesAndPolicies/reader_test.go index 7cbf22b9..6626311e 100644 --- a/process/elasticproc/templatesAndPolicies/noKibana_test.go +++ b/process/elasticproc/templatesAndPolicies/reader_test.go @@ -9,7 +9,7 @@ import ( func TestTemplatesAndPolicyReaderNoKibana_GetElasticTemplatesAndPolicies(t *testing.T) { t.Parallel() - reader := NewTemplatesAndPolicyReaderNoKibana() + reader := NewTemplatesAndPolicyReader() templates, policies, err := reader.GetElasticTemplatesAndPolicies() require.Nil(t, err) diff --git a/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory.go b/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory.go deleted file mode 100644 index e3a32e32..00000000 --- a/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory.go +++ /dev/null @@ -1,10 +0,0 @@ -package templatesAndPolicies - -// CreateTemplatesAndPoliciesReader will create a new instance of templatesAndPoliciesReader -func CreateTemplatesAndPoliciesReader(useKibana bool) TemplatesAndPoliciesHandler { - if useKibana { - return NewTemplatesAndPolicyReaderWithKibana() - } - - return NewTemplatesAndPolicyReaderNoKibana() -} diff --git a/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory_test.go b/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory_test.go deleted file mode 100644 index 8e9e0f45..00000000 --- a/process/elasticproc/templatesAndPolicies/templatesAndPoliciesFactory_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package templatesAndPolicies - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestCreateTemplatesAndPoliciesReader_NoKibana(t *testing.T) { - t.Parallel() - - reader := CreateTemplatesAndPoliciesReader(false) - - _, ok := reader.(*templatesAndPolicyReaderNoKibana) - require.True(t, ok) -} - -func TestCreateTemplatesAndPoliciesReader_WithKibana(t *testing.T) { - t.Parallel() - - reader := CreateTemplatesAndPoliciesReader(true) - - _, ok := reader.(*templatesAndPolicyReaderWithKibana) - require.True(t, ok) -} diff --git a/process/elasticproc/templatesAndPolicies/withKibana.go b/process/elasticproc/templatesAndPolicies/withKibana.go deleted file mode 100644 index 7ffe6b2f..00000000 --- a/process/elasticproc/templatesAndPolicies/withKibana.go +++ /dev/null @@ -1,77 +0,0 @@ -package templatesAndPolicies - -import ( - "bytes" - - indexer "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer" - "github.com/multiversx/mx-chain-es-indexer-go/templates" - "github.com/multiversx/mx-chain-es-indexer-go/templates/withKibana" -) - -type templatesAndPolicyReaderWithKibana struct{} - -// NewTemplatesAndPolicyReaderWithKibana will create a new instance of templatesAndPolicyReaderWithKibana -func NewTemplatesAndPolicyReaderWithKibana() *templatesAndPolicyReaderWithKibana { - return new(templatesAndPolicyReaderWithKibana) -} - -// GetElasticTemplatesAndPolicies will return templates and policies -func (tr *templatesAndPolicyReaderWithKibana) GetElasticTemplatesAndPolicies() (map[string]*bytes.Buffer, map[string]*bytes.Buffer, error) { - indexTemplates := getTemplatesKibana() - indexPolicies := getPolicies() - - return indexTemplates, indexPolicies, nil -} - -// GetExtraMappings will return an array of indices extra mappings -func (tr *templatesAndPolicyReaderWithKibana) GetExtraMappings() ([]templates.ExtraMapping, error) { - return []templates.ExtraMapping{}, nil -} - -func getTemplatesKibana() map[string]*bytes.Buffer { - indexTemplates := make(map[string]*bytes.Buffer) - - indexTemplates["opendistro"] = withKibana.OpenDistro.ToBuffer() - indexTemplates[indexer.TransactionsIndex] = withKibana.Transactions.ToBuffer() - indexTemplates[indexer.BlockIndex] = withKibana.Blocks.ToBuffer() - indexTemplates[indexer.MiniblocksIndex] = withKibana.Miniblocks.ToBuffer() - indexTemplates[indexer.RatingIndex] = withKibana.Rating.ToBuffer() - indexTemplates[indexer.RoundsIndex] = withKibana.Rounds.ToBuffer() - indexTemplates[indexer.ValidatorsIndex] = withKibana.Validators.ToBuffer() - indexTemplates[indexer.AccountsIndex] = withKibana.Accounts.ToBuffer() - indexTemplates[indexer.AccountsHistoryIndex] = withKibana.AccountsHistory.ToBuffer() - indexTemplates[indexer.AccountsESDTIndex] = withKibana.AccountsESDT.ToBuffer() - indexTemplates[indexer.AccountsESDTHistoryIndex] = withKibana.AccountsESDTHistory.ToBuffer() - indexTemplates[indexer.EpochInfoIndex] = withKibana.EpochInfo.ToBuffer() - indexTemplates[indexer.ReceiptsIndex] = withKibana.Receipts.ToBuffer() - indexTemplates[indexer.ScResultsIndex] = withKibana.SCResults.ToBuffer() - indexTemplates[indexer.SCDeploysIndex] = withKibana.SCDeploys.ToBuffer() - indexTemplates[indexer.TokensIndex] = withKibana.Tokens.ToBuffer() - indexTemplates[indexer.TagsIndex] = withKibana.Tags.ToBuffer() - indexTemplates[indexer.LogsIndex] = withKibana.Logs.ToBuffer() - indexTemplates[indexer.DelegatorsIndex] = withKibana.Delegators.ToBuffer() - indexTemplates[indexer.OperationsIndex] = withKibana.Operations.ToBuffer() - indexTemplates[indexer.ESDTsIndex] = withKibana.ESDTs.ToBuffer() - - return indexTemplates -} - -func getPolicies() map[string]*bytes.Buffer { - indexesPolicies := make(map[string]*bytes.Buffer) - - indexesPolicies[indexer.TransactionsPolicy] = withKibana.TransactionsPolicy.ToBuffer() - indexesPolicies[indexer.BlockPolicy] = withKibana.BlocksPolicy.ToBuffer() - indexesPolicies[indexer.MiniblocksPolicy] = withKibana.MiniblocksPolicy.ToBuffer() - indexesPolicies[indexer.RatingPolicy] = withKibana.RatingPolicy.ToBuffer() - indexesPolicies[indexer.RoundsPolicy] = withKibana.RoundsPolicy.ToBuffer() - indexesPolicies[indexer.ValidatorsPolicy] = withKibana.ValidatorsPolicy.ToBuffer() - indexesPolicies[indexer.AccountsHistoryPolicy] = withKibana.AccountsHistoryPolicy.ToBuffer() - indexesPolicies[indexer.AccountsPolicy] = withKibana.AccountsPolicy.ToBuffer() - indexesPolicies[indexer.AccountsESDTPolicy] = withKibana.AccountsESDTPolicy.ToBuffer() - indexesPolicies[indexer.AccountsESDTHistoryPolicy] = withKibana.AccountsESDTHistoryPolicy.ToBuffer() - indexesPolicies[indexer.AccountsHistoryPolicy] = withKibana.AccountsHistoryPolicy.ToBuffer() - indexesPolicies[indexer.ReceiptsPolicy] = withKibana.ReceiptsPolicy.ToBuffer() - indexesPolicies[indexer.ScResultsPolicy] = withKibana.ScResultsPolicy.ToBuffer() - - return indexesPolicies -} diff --git a/process/elasticproc/templatesAndPolicies/withKibana_test.go b/process/elasticproc/templatesAndPolicies/withKibana_test.go deleted file mode 100644 index 0a9ab191..00000000 --- a/process/elasticproc/templatesAndPolicies/withKibana_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package templatesAndPolicies - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestTemplatesAndPolicyReaderWithKibana_GetElasticTemplatesAndPolicies(t *testing.T) { - t.Parallel() - - reader := NewTemplatesAndPolicyReaderWithKibana() - - templates, policies, err := reader.GetElasticTemplatesAndPolicies() - require.Nil(t, err) - require.Len(t, policies, 12) - require.Len(t, templates, 21) -} diff --git a/templates/noKibana/accounts.go b/templates/indices/accounts.go similarity index 98% rename from templates/noKibana/accounts.go rename to templates/indices/accounts.go index ac8b64ea..18ab6be6 100644 --- a/templates/noKibana/accounts.go +++ b/templates/indices/accounts.go @@ -1,4 +1,4 @@ -package noKibana +package indices import ( "github.com/multiversx/mx-chain-es-indexer-go/templates" diff --git a/templates/noKibana/accountsESDT.go b/templates/indices/accountsESDT.go similarity index 98% rename from templates/noKibana/accountsESDT.go rename to templates/indices/accountsESDT.go index d15ecaf3..c06bc4f2 100644 --- a/templates/noKibana/accountsESDT.go +++ b/templates/indices/accountsESDT.go @@ -1,4 +1,4 @@ -package noKibana +package indices // AccountsESDT will hold the configuration for the accountsesdt index var AccountsESDT = Object{ diff --git a/templates/noKibana/accountsESDTHistory.go b/templates/indices/accountsESDTHistory.go similarity index 98% rename from templates/noKibana/accountsESDTHistory.go rename to templates/indices/accountsESDTHistory.go index d8c2454d..ed3050f3 100644 --- a/templates/noKibana/accountsESDTHistory.go +++ b/templates/indices/accountsESDTHistory.go @@ -1,4 +1,4 @@ -package noKibana +package indices // AccountsESDTHistory will hold the configuration for the accountsesdthistory index var AccountsESDTHistory = Object{ diff --git a/templates/noKibana/accountsHistory.go b/templates/indices/accountsHistory.go similarity index 97% rename from templates/noKibana/accountsHistory.go rename to templates/indices/accountsHistory.go index cf46b285..69d314ae 100644 --- a/templates/noKibana/accountsHistory.go +++ b/templates/indices/accountsHistory.go @@ -1,4 +1,4 @@ -package noKibana +package indices // AccountsHistory will hold the configuration for the accountshistory index var AccountsHistory = Object{ diff --git a/templates/noKibana/blocks.go b/templates/indices/blocks.go similarity index 99% rename from templates/noKibana/blocks.go rename to templates/indices/blocks.go index 00d2381d..816ec6a5 100644 --- a/templates/noKibana/blocks.go +++ b/templates/indices/blocks.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Blocks will hold the configuration for the blocks index var Blocks = Object{ diff --git a/templates/noKibana/delegators.go b/templates/indices/delegators.go similarity index 98% rename from templates/noKibana/delegators.go rename to templates/indices/delegators.go index 91f33c94..c5bc031a 100644 --- a/templates/noKibana/delegators.go +++ b/templates/indices/delegators.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Delegators will hold the configuration for the delegators index var Delegators = Object{ diff --git a/templates/noKibana/deploys.go b/templates/indices/deploys.go similarity index 98% rename from templates/noKibana/deploys.go rename to templates/indices/deploys.go index 18f04afd..540cf886 100644 --- a/templates/noKibana/deploys.go +++ b/templates/indices/deploys.go @@ -1,4 +1,4 @@ -package noKibana +package indices // SCDeploys will hold the configuration for the scdeploys index var SCDeploys = Object{ diff --git a/templates/noKibana/epochInfo.go b/templates/indices/epochInfo.go similarity index 96% rename from templates/noKibana/epochInfo.go rename to templates/indices/epochInfo.go index 337941f1..849b8630 100644 --- a/templates/noKibana/epochInfo.go +++ b/templates/indices/epochInfo.go @@ -1,4 +1,4 @@ -package noKibana +package indices // EpochInfo will hold the configuration for the epochinfo index var EpochInfo = Object{ diff --git a/templates/noKibana/esdts.go b/templates/indices/esdts.go similarity index 99% rename from templates/noKibana/esdts.go rename to templates/indices/esdts.go index 9ea5588b..aa15da35 100644 --- a/templates/noKibana/esdts.go +++ b/templates/indices/esdts.go @@ -1,4 +1,4 @@ -package noKibana +package indices // ESDTs will hold the configuration for the esdts index var ESDTs = Object{ diff --git a/templates/noKibana/events.go b/templates/indices/events.go similarity index 98% rename from templates/noKibana/events.go rename to templates/indices/events.go index cdf3613a..332971cb 100644 --- a/templates/noKibana/events.go +++ b/templates/indices/events.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Events will hold the configuration for the events index var Events = Object{ diff --git a/templates/noKibana/logs.go b/templates/indices/logs.go similarity index 97% rename from templates/noKibana/logs.go rename to templates/indices/logs.go index 21cd297d..a3451253 100644 --- a/templates/noKibana/logs.go +++ b/templates/indices/logs.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Logs will hold the configuration for the logs index var Logs = Object{ diff --git a/templates/noKibana/miniblocks.go b/templates/indices/miniblocks.go similarity index 98% rename from templates/noKibana/miniblocks.go rename to templates/indices/miniblocks.go index 30ef3360..a0952ac8 100644 --- a/templates/noKibana/miniblocks.go +++ b/templates/indices/miniblocks.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Miniblocks will hold the configuration for the miniblocks index var Miniblocks = Object{ diff --git a/templates/noKibana/opendistro.go b/templates/indices/opendistro.go similarity index 93% rename from templates/noKibana/opendistro.go rename to templates/indices/opendistro.go index 66a0bca8..a09095a0 100644 --- a/templates/noKibana/opendistro.go +++ b/templates/indices/opendistro.go @@ -1,4 +1,4 @@ -package noKibana +package indices // OpenDistro will hold the configuration for the opendistro var OpenDistro = Object{ diff --git a/templates/noKibana/operations.go b/templates/indices/operations.go similarity index 99% rename from templates/noKibana/operations.go rename to templates/indices/operations.go index d9598f58..c161a589 100644 --- a/templates/noKibana/operations.go +++ b/templates/indices/operations.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Operations will hold the configuration for the operations index var Operations = Object{ diff --git a/templates/noKibana/rating.go b/templates/indices/rating.go similarity index 95% rename from templates/noKibana/rating.go rename to templates/indices/rating.go index 53add6b8..49d80422 100644 --- a/templates/noKibana/rating.go +++ b/templates/indices/rating.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Rating will hold the configuration for the rating index var Rating = Object{ diff --git a/templates/noKibana/receipts.go b/templates/indices/receipts.go similarity index 97% rename from templates/noKibana/receipts.go rename to templates/indices/receipts.go index b5869cd1..2eacdd71 100644 --- a/templates/noKibana/receipts.go +++ b/templates/indices/receipts.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Receipts will hold the configuration for the receipts index var Receipts = Object{ diff --git a/templates/noKibana/rounds.go b/templates/indices/rounds.go similarity index 97% rename from templates/noKibana/rounds.go rename to templates/indices/rounds.go index 890b3077..043d8604 100644 --- a/templates/noKibana/rounds.go +++ b/templates/indices/rounds.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Rounds will hold the configuration for the rounds index var Rounds = Object{ diff --git a/templates/noKibana/scResults.go b/templates/indices/scResults.go similarity index 99% rename from templates/noKibana/scResults.go rename to templates/indices/scResults.go index d8c02de1..710e7816 100644 --- a/templates/noKibana/scResults.go +++ b/templates/indices/scResults.go @@ -1,4 +1,4 @@ -package noKibana +package indices // SCResults will hold the configuration for the scresults index var SCResults = Object{ diff --git a/templates/noKibana/tags.go b/templates/indices/tags.go similarity index 95% rename from templates/noKibana/tags.go rename to templates/indices/tags.go index 45918b70..aa6b5643 100644 --- a/templates/noKibana/tags.go +++ b/templates/indices/tags.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Tags will hold the configuration for the tags index var Tags = Object{ diff --git a/templates/noKibana/tokens.go b/templates/indices/tokens.go similarity index 99% rename from templates/noKibana/tokens.go rename to templates/indices/tokens.go index fbfb812c..46b64f58 100644 --- a/templates/noKibana/tokens.go +++ b/templates/indices/tokens.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Tokens will hold the configuration for the tokens index var Tokens = Object{ diff --git a/templates/noKibana/transactions.go b/templates/indices/transactions.go similarity index 99% rename from templates/noKibana/transactions.go rename to templates/indices/transactions.go index 4935807c..f03d76df 100644 --- a/templates/noKibana/transactions.go +++ b/templates/indices/transactions.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Transactions will hold the configuration for the transactions index var Transactions = Object{ diff --git a/templates/noKibana/validators.go b/templates/indices/validators.go similarity index 95% rename from templates/noKibana/validators.go rename to templates/indices/validators.go index 88c09295..15dce9f2 100644 --- a/templates/noKibana/validators.go +++ b/templates/indices/validators.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Validators will hold the configuration for the validators index var Validators = Object{ diff --git a/templates/noKibana/values.go b/templates/indices/values.go similarity index 95% rename from templates/noKibana/values.go rename to templates/indices/values.go index 707a3329..2f76457a 100644 --- a/templates/noKibana/values.go +++ b/templates/indices/values.go @@ -1,4 +1,4 @@ -package noKibana +package indices // Values will hold the configuration for the values index var Values = Object{ diff --git a/templates/withKibana/accounts.go b/templates/withKibana/accounts.go deleted file mode 100644 index b6a37c88..00000000 --- a/templates/withKibana/accounts.go +++ /dev/null @@ -1,61 +0,0 @@ -package withKibana - -import ( - "github.com/multiversx/mx-chain-es-indexer-go/templates" -) - -type Object = templates.Object -type Array = templates.Array - -// Accounts will hold the configuration for the accounts index -var Accounts = Object{ - "index_patterns": Array{ - "accounts-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "accounts", - }, - "mappings": Object{ - "properties": Object{ - "balanceNum": Object{ - "type": "double", - }, - "totalBalanceWithStakeNum": Object{ - "type": "double", - }, - "nonce": Object{ - "type": "double", - }, - "address": Object{ - "type": "keyword", - }, - "balance": Object{ - "type": "keyword", - }, - "totalBalanceWithStake": Object{ - "type": "keyword", - }, - "shardID": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "userName": Object{ - "type": "keyword", - }, - "owner": Object{ - "type": "keyword", - }, - "developerRewards": Object{ - "type": "keyword", - }, - "developerRewardsNum": Object{ - "type": "double", - }, - }, - }, -} diff --git a/templates/withKibana/accountsESDT.go b/templates/withKibana/accountsESDT.go deleted file mode 100644 index 2d0f9152..00000000 --- a/templates/withKibana/accountsESDT.go +++ /dev/null @@ -1,86 +0,0 @@ -package withKibana - -// AccountsESDT will hold the configuration for the accountsesdt index -var AccountsESDT = Object{ - "index_patterns": Array{ - "accountsesdt-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "balance": Object{ - "type": "keyword", - }, - "balanceNum": Object{ - "type": "double", - }, - "currentOwner": Object{ - "type": "keyword", - }, - "data": Object{ - "type": "nested", - "properties": Object{ - "attributes": Object{ - "index": "false", - "type": "keyword", - }, - "creator": Object{ - "type": "keyword", - }, - "hash": Object{ - "index": "false", - "type": "keyword", - }, - "metadata": Object{ - "index": "false", - "type": "keyword", - }, - "name": Object{ - "type": "keyword", - }, - "nonEmptyURIs": Object{ - "type": "boolean", - }, - "royalties": Object{ - "index": "false", - "type": "long", - }, - "tags": Object{ - "type": "text", - }, - "uris": Object{ - "type": "text", - }, - }, - }, - "identifier": Object{ - "type": "text", - }, - "properties": Object{ - "type": "keyword", - }, - "shardID": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "token": Object{ - "type": "text", - }, - "tokenNonce": Object{ - "type": "double", - }, - "type": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/accountsESDTHistory.go b/templates/withKibana/accountsESDTHistory.go deleted file mode 100644 index a9b14832..00000000 --- a/templates/withKibana/accountsESDTHistory.go +++ /dev/null @@ -1,45 +0,0 @@ -package withKibana - -// AccountsESDTHistory will hold the configuration for the accountsesdthistory index -var AccountsESDTHistory = Object{ - "index_patterns": Array{ - "accountsesdthistory-*", - }, - "settings": Object{ - "number_of_shards": 5, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "accountsesdthistory", - }, - "mappings": Object{ - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "balance": Object{ - "type": "keyword", - }, - "identifier": Object{ - "type": "text", - }, - "isSender": Object{ - "type": "boolean", - }, - "isSmartContract": Object{ - "type": "boolean", - }, - "shardID": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "token": Object{ - "type": "text", - }, - "tokenNonce": Object{ - "type": "double", - }, - }, - }, -} diff --git a/templates/withKibana/accountsESDTHistoryPolicy.go b/templates/withKibana/accountsESDTHistoryPolicy.go deleted file mode 100644 index 7bc33203..00000000 --- a/templates/withKibana/accountsESDTHistoryPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// AccountsESDTHistoryPolicy will hold the configuration for the accountsesdthistory index policy -var AccountsESDTHistoryPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the accountsesdthistory elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"accountsesdthistory-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/accountsESDTPolicy.go b/templates/withKibana/accountsESDTPolicy.go deleted file mode 100644 index 7e9cc3c6..00000000 --- a/templates/withKibana/accountsESDTPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// AccountsESDTPolicy will hold the configuration for the accountsesdt index policy -var AccountsESDTPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the accountsesdt elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"accountsesdt-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/accountsHistory.go b/templates/withKibana/accountsHistory.go deleted file mode 100644 index a23baef8..00000000 --- a/templates/withKibana/accountsHistory.go +++ /dev/null @@ -1,36 +0,0 @@ -package withKibana - -// AccountsHistory will hold the configuration for the accountshistory index -var AccountsHistory = Object{ - "index_patterns": Array{ - "accountshistory-*", - }, - "settings": Object{ - "number_of_shards": 5, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "accountshistory", - }, - "mappings": Object{ - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "balance": Object{ - "type": "keyword", - }, - "isSender": Object{ - "type": "boolean", - }, - "isSmartContract": Object{ - "type": "boolean", - }, - "shardID": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - }, - }, -} diff --git a/templates/withKibana/accountsHistoryPolicy.go b/templates/withKibana/accountsHistoryPolicy.go deleted file mode 100644 index 24ccd4ef..00000000 --- a/templates/withKibana/accountsHistoryPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// AccountsHistoryPolicy will hold the configuration for the accountshistory index policy -var AccountsHistoryPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the accountshistory elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"accountshistory-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/accountsPolicy.go b/templates/withKibana/accountsPolicy.go deleted file mode 100644 index d7222ccb..00000000 --- a/templates/withKibana/accountsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// AccountsPolicy will hold the configuration for the accounts index policy -var AccountsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the accounts elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"accounts-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/blocks.go b/templates/withKibana/blocks.go deleted file mode 100644 index e3cc043d..00000000 --- a/templates/withKibana/blocks.go +++ /dev/null @@ -1,251 +0,0 @@ -package withKibana - -// Blocks will hold the configuration for the blocks index -var Blocks = Object{ - "index_patterns": Array{ - "blocks-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "blocks", - "index": Object{ - "sort.field": Array{ - "timestamp", "nonce", - }, - "sort.order": Array{ - "desc", "desc", - }, - }, - }, - "mappings": Object{ - "properties": Object{ - "accumulatedFees": Object{ - "index": "false", - "type": "keyword", - }, - "developerFees": Object{ - "index": "false", - "type": "keyword", - }, - "epoch": Object{ - "type": "long", - }, - "epochStartBlock": Object{ - "type": "boolean", - }, - "epochStartInfo": Object{ - "properties": Object{ - "nodePrice": Object{ - "index": "false", - "type": "keyword", - }, - "prevEpochStartHash": Object{ - "index": "false", - "type": "keyword", - }, - "prevEpochStartRound": Object{ - "index": "false", - "type": "double", - }, - "rewardsForProtocolSustainability": Object{ - "index": "false", - "type": "keyword", - }, - "rewardsPerBlock": Object{ - "index": "false", - "type": "keyword", - }, - "totalNewlyMinted": Object{ - "index": "false", - "type": "keyword", - }, - "totalSupply": Object{ - "index": "false", - "type": "keyword", - }, - "totalToDistribute": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, - "epochStartShardsData": Object{ - "properties": Object{ - "epoch": Object{ - "index": "false", - "type": "long", - }, - "firstPendingMetaBlock": Object{ - "index": "false", - "type": "keyword", - }, - "headerHash": Object{ - "index": "false", - "type": "keyword", - }, - "lastFinishedMetaBlock": Object{ - "index": "false", - "type": "keyword", - }, - "nonce": Object{ - "index": "false", - "type": "double", - }, - "pendingMiniBlockHeaders": Object{ - "properties": Object{ - "hash": Object{ - "index": "false", - "type": "keyword", - }, - "receiverShard": Object{ - "index": "false", - "type": "long", - }, - "senderShard": Object{ - "index": "false", - "type": "long", - }, - "timestamp": Object{ - "index": "false", - "type": "date", - "format": "epoch_second", - }, - "type": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, - "rootHash": Object{ - "index": "false", - "type": "keyword", - }, - "round": Object{ - "index": "false", - "type": "double", - }, - "scheduledRootHash": Object{ - "index": "false", - "type": "keyword", - }, - "shardID": Object{ - "index": "false", - "type": "long", - }, - }, - }, - "gasPenalized": Object{ - "type": "double", - }, - "gasProvided": Object{ - "type": "double", - }, - "gasRefunded": Object{ - "type": "double", - }, - "maxGasLimit": Object{ - "type": "double", - }, - "miniBlocksDetails": Object{ - "properties": Object{ - "firstProcessedTx": Object{ - "index": "false", - "type": "long", - }, - "lastProcessedTx": Object{ - "index": "false", - "type": "long", - }, - "mbIndex": Object{ - "index": "false", - "type": "long", - }, - }, - }, - "miniBlocksHashes": Object{ - "type": "keyword", - }, - "nonce": Object{ - "type": "double", - }, - "notarizedBlocksHashes": Object{ - "type": "keyword", - }, - "notarizedTxsCount": Object{ - "index": "false", - "type": "long", - }, - "prevHash": Object{ - "type": "keyword", - }, - "proposer": Object{ - "type": "long", - }, - "pubKeyBitmap": Object{ - "index": "false", - "type": "keyword", - }, - "round": Object{ - "type": "double", - }, - "scheduledData": Object{ - "properties": Object{ - "accumulatedFees": Object{ - "index": "false", - "type": "keyword", - }, - "developerFees": Object{ - "index": "false", - "type": "keyword", - }, - "gasProvided": Object{ - "index": "false", - "type": "double", - }, - "gasRefunded": Object{ - "index": "false", - "type": "double", - }, - "penalized": Object{ - "index": "false", - "type": "double", - }, - "rootHash": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, - "searchOrder": Object{ - "type": "long", - }, - "shardId": Object{ - "type": "long", - }, - "size": Object{ - "index": "false", - "type": "long", - }, - "sizeTxs": Object{ - "index": "false", - "type": "long", - }, - "stateRootHash": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "txCount": Object{ - "index": "false", - "type": "long", - }, - "validators": Object{ - "index": "false", - "type": "long", - }, - }, - }, -} diff --git a/templates/withKibana/blocksPolicy.go b/templates/withKibana/blocksPolicy.go deleted file mode 100644 index a9a59b10..00000000 --- a/templates/withKibana/blocksPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// BlocksPolicy will hold the configuration for the blocks index policy -var BlocksPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the blocks elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "60gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "60gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"blocks-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/delegators.go b/templates/withKibana/delegators.go deleted file mode 100644 index da97b3e8..00000000 --- a/templates/withKibana/delegators.go +++ /dev/null @@ -1,54 +0,0 @@ -package withKibana - -// Delegators will hold the configuration for the delegators index -var Delegators = Object{ - "index_patterns": Array{ - "delegators-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - - "mappings": Object{ - "properties": Object{ - "activeStake": Object{ - "type": "keyword", - }, - "activeStakeNum": Object{ - "type": "double", - }, - "address": Object{ - "type": "keyword", - }, - "contract": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "unDelegateInfo": Object{ - "properties": Object{ - "id": Object{ - "index": "false", - "type": "keyword", - }, - "value": Object{ - "index": "false", - "type": "keyword", - }, - "valueNum": Object{ - "index": "false", - "type": "double", - }, - "timestamp": Object{ - "index": "false", - "type": "date", - "format": "epoch_second", - }, - }, - }, - }, - }, -} diff --git a/templates/withKibana/deploys.go b/templates/withKibana/deploys.go deleted file mode 100644 index 1f75d3db..00000000 --- a/templates/withKibana/deploys.go +++ /dev/null @@ -1,65 +0,0 @@ -package withKibana - -// SCDeploys will hold the configuration for the scdeploys index -var SCDeploys = Object{ - "index_patterns": Array{ - "scdeploys-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "deployTxHash": Object{ - "type": "keyword", - }, - "deployer": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "currentOwner": Object{ - "type": "keyword", - }, - "initialCodeHash": Object{ - "type": "keyword", - }, - "upgrades": Object{ - "type": "nested", - "properties": Object{ - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "upgradeTxHash": Object{ - "type": "keyword", - }, - "upgrader": Object{ - "type": "keyword", - }, - "codeHash": Object{ - "type": "keyword", - }, - }, - }, - "owners": Object{ - "type": "nested", - "properties": Object{ - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "txHash": Object{ - "type": "keyword", - }, - "address": Object{ - "type": "keyword", - }, - }, - }, - }, - }, -} diff --git a/templates/withKibana/epochInfo.go b/templates/withKibana/epochInfo.go deleted file mode 100644 index 0aa8fb43..00000000 --- a/templates/withKibana/epochInfo.go +++ /dev/null @@ -1,22 +0,0 @@ -package withKibana - -// EpochInfo will hold the configuration for the epochinfo index -var EpochInfo = Object{ - "index_patterns": Array{ - "epochinfo-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "accumulatedFees": Object{ - "type": "keyword", - }, - "developerFees": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/esdts.go b/templates/withKibana/esdts.go deleted file mode 100644 index cc27f793..00000000 --- a/templates/withKibana/esdts.go +++ /dev/null @@ -1,130 +0,0 @@ -package withKibana - -// ESDTs will hold the configuration for the esdts index -var ESDTs = Object{ - "index_patterns": Array{ - "esdts-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "name": Object{ - "type": "keyword", - }, - "ticker": Object{ - "type": "keyword", - }, - "token": Object{ - "type": "text", - }, - "issuer": Object{ - "type": "keyword", - }, - "currentOwner": Object{ - "type": "keyword", - }, - "numDecimals": Object{ - "type": "long", - }, - "type": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "ownersHistory": Object{ - "type": "nested", - "properties": Object{ - "timestamp": Object{ - "index": "false", - "type": "date", - "format": "epoch_second", - }, - "address": Object{ - "type": "keyword", - }, - }, - }, - "paused": Object{ - "type": "boolean", - }, - "properties": Object{ - "properties": Object{ - "canMint": Object{ - "index": "false", - "type": "boolean", - }, - "canBurn": Object{ - "index": "false", - "type": "boolean", - }, - "canUpgrade": Object{ - "index": "false", - "type": "boolean", - }, - "canTransferNFTCreateRole": Object{ - "index": "false", - "type": "boolean", - }, - "canAddSpecialRoles": Object{ - "index": "false", - "type": "boolean", - }, - "canPause": Object{ - "index": "false", - "type": "boolean", - }, - "canFreeze": Object{ - "index": "false", - "type": "boolean", - }, - "canWipe": Object{ - "index": "false", - "type": "boolean", - }, - "canChangeOwner": Object{ - "index": "false", - "type": "boolean", - }, - "canCreateMultiShard": Object{ - "index": "false", - "type": "boolean", - }, - }, - }, - "roles": Object{ - "type": "nested", - "properties": Object{ - "ESDTRoleLocalBurn": Object{ - "type": "keyword", - }, - "ESDTRoleLocalMint": Object{ - "type": "keyword", - }, - "ESDTRoleNFTAddQuantity": Object{ - "type": "keyword", - }, - "ESDTRoleNFTAddURI": Object{ - "type": "keyword", - }, - "ESDTRoleNFTBurn": Object{ - "type": "keyword", - }, - "ESDTRoleNFTCreate": Object{ - "type": "keyword", - }, - "ESDTRoleNFTUpdateAttributes": Object{ - "type": "keyword", - }, - "ESDTTransferRole": Object{ - "type": "keyword", - }, - }, - }, - }, - }, -} diff --git a/templates/withKibana/logs.go b/templates/withKibana/logs.go deleted file mode 100644 index 1dcc4c27..00000000 --- a/templates/withKibana/logs.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// Logs will hold the configuration for the logs index -var Logs = Object{ - "index_patterns": Array{ - "logs-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "events": Object{ - "type": "nested", - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "data": Object{ - "index": "false", - "type": "text", - }, - "identifier": Object{ - "type": "keyword", - }, - "topics": Object{ - "type": "text", - }, - }, - }, - "originalTxHash": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - }, - }, -} diff --git a/templates/withKibana/miniblocks.go b/templates/withKibana/miniblocks.go deleted file mode 100644 index 05a38b08..00000000 --- a/templates/withKibana/miniblocks.go +++ /dev/null @@ -1,45 +0,0 @@ -package withKibana - -// Miniblocks will hold the configuration for the miniblocks index -var Miniblocks = Object{ - "index_patterns": Array{ - "miniblocks-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "procTypeD": Object{ - "type": "keyword", - }, - "procTypeS": Object{ - "type": "keyword", - }, - "receiverBlockHash": Object{ - "type": "keyword", - }, - "receiverShard": Object{ - "type": "long", - }, - "reserved": Object{ - "index": "false", - "type": "keyword", - }, - "senderBlockHash": Object{ - "type": "keyword", - }, - "senderShard": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "type": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/miniblocksPolicy.go b/templates/withKibana/miniblocksPolicy.go deleted file mode 100644 index 60805b39..00000000 --- a/templates/withKibana/miniblocksPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// MiniblocksPolicy will hold the configuration for the miniblocks index policy -var MiniblocksPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the miniblocks elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "60gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "60gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"miniblocks-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/opendistro.go b/templates/withKibana/opendistro.go deleted file mode 100644 index 26e518df..00000000 --- a/templates/withKibana/opendistro.go +++ /dev/null @@ -1,12 +0,0 @@ -package withKibana - -// OpenDistro will hold the configuration for the opendistro -var OpenDistro = Object{ - "index_patterns": Array{ - ".opendistro-*", - }, - "settings": Object{ - "number_of_shards": 1, - "number_of_replicas": 0, - }, -} diff --git a/templates/withKibana/operations.go b/templates/withKibana/operations.go deleted file mode 100644 index 5753e762..00000000 --- a/templates/withKibana/operations.go +++ /dev/null @@ -1,174 +0,0 @@ -package withKibana - -// Operations will hold the configuration for the operations index -var Operations = Object{ - "index_patterns": Array{ - "operations-*", - }, - "settings": Object{ - "number_of_shards": 5, - "number_of_replicas": 0, - "index": Object{ - "sort.field": Array{ - "timestamp", "nonce", - }, - "sort.order": Array{ - "desc", "desc", - }, - }, - }, - - "mappings": Object{ - "properties": Object{ - "callType": Object{ - "index": "false", - "type": "keyword", - }, - "canBeIgnored": Object{ - "type": "boolean", - }, - "code": Object{ - "index": "false", - "type": "text", - }, - "data": Object{ - "type": "text", - }, - "esdtValues": Object{ - "type": "keyword", - }, - "esdtValuesNum": Object{ - "type": "double", - }, - "fee": Object{ - "index": "false", - "type": "keyword", - }, - "feeNum": Object{ - "type": "double", - }, - "function": Object{ - "type": "keyword", - }, - "gasLimit": Object{ - "index": "false", - "type": "double", - }, - "gasPrice": Object{ - "index": "false", - "type": "double", - }, - "gasUsed": Object{ - "index": "false", - "type": "double", - }, - "hasOperations": Object{ - "type": "boolean", - }, - "hasScResults": Object{ - "type": "boolean", - }, - "hasLogs": Object{ - "type": "boolean", - }, - "initialPaidFee": Object{ - "index": "false", - "type": "keyword", - }, - "isRelayed": Object{ - "type": "boolean", - }, - "isScCall": Object{ - "type": "boolean", - }, - "miniBlockHash": Object{ - "type": "keyword", - }, - "nonce": Object{ - "type": "double", - }, - "operation": Object{ - "type": "keyword", - }, - "originalSender": Object{ - "type": "keyword", - }, - "originalTxHash": Object{ - "type": "keyword", - }, - "prevTxHash": Object{ - "type": "keyword", - }, - "receiver": Object{ - "type": "keyword", - }, - "receiverShard": Object{ - "type": "long", - }, - "receivers": Object{ - "type": "keyword", - }, - "receiversShardIDs": Object{ - "type": "long", - }, - "relayedValue": Object{ - "index": "false", - "type": "keyword", - }, - "relayerAddr": Object{ - "type": "keyword", - }, - "returnMessage": Object{ - "type": "text", - }, - "round": Object{ - "type": "double", - }, - "searchOrder": Object{ - "type": "long", - }, - "sender": Object{ - "type": "keyword", - }, - "senderShard": Object{ - "type": "long", - }, - "senderUserName": Object{ - "type": "keyword", - }, - "signature": Object{ - "index": "false", - "type": "keyword", - }, - "status": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "tokens": Object{ - "type": "text", - }, - "type": Object{ - "type": "keyword", - }, - "value": Object{ - "type": "keyword", - }, - "valueNum": Object{ - "type": "double", - }, - "version": Object{ - "type": "long", - }, - "guardian": Object{ - "type": "keyword", - }, - "guardianSignature": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/rating.go b/templates/withKibana/rating.go deleted file mode 100644 index 3ce1a75e..00000000 --- a/templates/withKibana/rating.go +++ /dev/null @@ -1,20 +0,0 @@ -package withKibana - -// Rating will hold the configuration for the rating index -var Rating = Object{ - "index_patterns": Array{ - "rating-*", - }, - "settings": Object{ - "number_of_shards": 1, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "rating", - }, - "mappings": Object{ - "properties": Object{ - "rating": Object{ - "type": "double", - }, - }, - }, -} diff --git a/templates/withKibana/ratingPolicy.go b/templates/withKibana/ratingPolicy.go deleted file mode 100644 index 732648c1..00000000 --- a/templates/withKibana/ratingPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// RatingPolicy will hold the configuration for the ratings index policy -var RatingPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the ratings elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "20gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "20gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"rating-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/receipts.go b/templates/withKibana/receipts.go deleted file mode 100644 index e900d00c..00000000 --- a/templates/withKibana/receipts.go +++ /dev/null @@ -1,42 +0,0 @@ -package withKibana - -// Receipts will hold the configuration for the receipts index -var Receipts = Object{ - "index_patterns": Array{ - "receipts-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - "index": Object{ - "sort.field": Array{ - "timestamp", - }, - "sort.order": Array{ - "desc", - }, - }, - "opendistro.index_state_management.rollover_alias": "receipts", - }, - "mappings": Object{ - "properties": Object{ - "data": Object{ - "type": "keyword", - }, - "sender": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "txHash": Object{ - "type": "keyword", - }, - "value": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/receiptsPolicy.go b/templates/withKibana/receiptsPolicy.go deleted file mode 100644 index 0af6316b..00000000 --- a/templates/withKibana/receiptsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// ReceiptsPolicy will hold the configuration for the receipts index policy -var ReceiptsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the receipts elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"receipts-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/rounds.go b/templates/withKibana/rounds.go deleted file mode 100644 index 186132dd..00000000 --- a/templates/withKibana/rounds.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// Rounds will hold the configuration for the rounds index -var Rounds = Object{ - "index_patterns": Array{ - "rounds-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "rounds", - "index": Object{ - "sort.field": Array{ - "timestamp", - }, - "sort.order": Array{ - "desc", - }, - }, - }, - "mappings": Object{ - "properties": Object{ - "blockWasProposed": Object{ - "type": "boolean", - }, - "epoch": Object{ - "type": "long", - }, - "round": Object{ - "type": "double", - }, - "shardId": Object{ - "type": "long", - }, - "signersIndexes": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - }, - }, -} diff --git a/templates/withKibana/roundsPolicy.go b/templates/withKibana/roundsPolicy.go deleted file mode 100644 index 0c136aa9..00000000 --- a/templates/withKibana/roundsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// RoundsPolicy will hold the configuration for the rounds index policy -var RoundsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the rounds elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "60gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "60gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"rounds-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/scResults.go b/templates/withKibana/scResults.go deleted file mode 100644 index 3aeead69..00000000 --- a/templates/withKibana/scResults.go +++ /dev/null @@ -1,114 +0,0 @@ -package withKibana - -// SCResults will hold the configuration for the scresults index -var SCResults = Object{ - "index_patterns": Array{ - "scresults-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - "index": Object{ - "sort.field": Array{ - "timestamp", - }, - "sort.order": Array{ - "desc", - }, - }, - "opendistro.index_state_management.rollover_alias": "scresults", - }, - "mappings": Object{ - "properties": Object{ - "callType": Object{ - "type": "keyword", - }, - "code": Object{ - "index": "false", - "type": "text", - }, - "data": Object{ - "type": "text", - }, - "esdtValues": Object{ - "type": "keyword", - }, - "esdtValuesNum": Object{ - "type": "double", - }, - "function": Object{ - "type": "keyword", - }, - "gasLimit": Object{ - "index": "false", - "type": "double", - }, - "gasPrice": Object{ - "index": "false", - "type": "double", - }, - "hasOperations": Object{ - "type": "boolean", - }, - "miniBlockHash": Object{ - "type": "keyword", - }, - "nonce": Object{ - "type": "double", - }, - "operation": Object{ - "type": "keyword", - }, - "originalSender": Object{ - "type": "keyword", - }, - "originalTxHash": Object{ - "type": "keyword", - }, - "prevTxHash": Object{ - "type": "keyword", - }, - "receiver": Object{ - "type": "keyword", - }, - "receiverShard": Object{ - "type": "long", - }, - "receivers": Object{ - "type": "keyword", - }, - "receiversShardIDs": Object{ - "type": "long", - }, - "relayedValue": Object{ - "index": "false", - "type": "keyword", - }, - "relayerAddr": Object{ - "type": "keyword", - }, - "returnMessage": Object{ - "type": "text", - }, - "sender": Object{ - "type": "keyword", - }, - "senderShard": Object{ - "type": "long", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "tokens": Object{ - "type": "text", - }, - "value": Object{ - "type": "keyword", - }, - "valueNum": Object{ - "type": "double", - }, - }, - }, -} diff --git a/templates/withKibana/scResultsPolicy.go b/templates/withKibana/scResultsPolicy.go deleted file mode 100644 index bb25928a..00000000 --- a/templates/withKibana/scResultsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// ScResultsPolicy will hold the configuration for the scResults index policy -var ScResultsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the scresults elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"scresults-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/tags.go b/templates/withKibana/tags.go deleted file mode 100644 index 67d589d8..00000000 --- a/templates/withKibana/tags.go +++ /dev/null @@ -1,22 +0,0 @@ -package withKibana - -// Tags will hold the configuration for the tags index -var Tags = Object{ - "index_patterns": Array{ - "tags-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "count": Object{ - "type": "long", - }, - "tag": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/tokens.go b/templates/withKibana/tokens.go deleted file mode 100644 index a969be39..00000000 --- a/templates/withKibana/tokens.go +++ /dev/null @@ -1,172 +0,0 @@ -package withKibana - -// Tokens will hold the configuration for the tokens index -var Tokens = Object{ - "index_patterns": Array{ - "tokens-*", - }, - "settings": Object{ - "number_of_shards": 3, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "currentOwner": Object{ - "type": "keyword", - }, - "data": Object{ - "type": "nested", - "properties": Object{ - "attributes": Object{ - "index": "false", - "type": "keyword", - }, - "creator": Object{ - "type": "keyword", - }, - "hash": Object{ - "index": "false", - "type": "keyword", - }, - "metadata": Object{ - "index": "false", - "type": "keyword", - }, - "name": Object{ - "type": "keyword", - }, - "nonEmptyURIs": Object{ - "type": "boolean", - }, - "royalties": Object{ - "type": "long", - }, - "tags": Object{ - "type": "keyword", - }, - "uris": Object{ - "type": "keyword", - }, - "whiteListedStorage": Object{ - "type": "boolean", - }, - }, - }, - "identifier": Object{ - "type": "text", - }, - "issuer": Object{ - "type": "keyword", - }, - "name": Object{ - "type": "keyword", - }, - - "nonce": Object{ - "type": "double", - }, - "numDecimals": Object{ - "type": "long", - }, - "ownersHistory": Object{ - "type": "nested", - "properties": Object{ - "address": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "index": "false", - "type": "date", - "format": "epoch_second", - }, - }, - }, - "properties": Object{ - "properties": Object{ - "canAddSpecialRoles": Object{ - "index": "false", - "type": "boolean", - }, - "canBurn": Object{ - "index": "false", - "type": "boolean", - }, - "canChangeOwner": Object{ - "index": "false", - "type": "boolean", - }, - "canCreateMultiShard": Object{ - "index": "false", - "type": "boolean", - }, - "canFreeze": Object{ - "index": "false", - "type": "boolean", - }, - "canMint": Object{ - "index": "false", - "type": "boolean", - }, - "canPause": Object{ - "index": "false", - "type": "boolean", - }, - "canTransferNFTCreateRole": Object{ - "index": "false", - "type": "boolean", - }, - "canUpgrade": Object{ - "index": "false", - "type": "boolean", - }, - "canWipe": Object{ - "index": "false", - "type": "boolean", - }, - }, - }, - "roles": Object{ - "type": "nested", - "properties": Object{ - "ESDTRoleLocalBurn": Object{ - "type": "keyword", - }, - "ESDTRoleLocalMint": Object{ - "type": "keyword", - }, - "ESDTRoleNFTAddQuantity": Object{ - "type": "keyword", - }, - "ESDTRoleNFTAddURI": Object{ - "type": "keyword", - }, - "ESDTRoleNFTBurn": Object{ - "type": "keyword", - }, - "ESDTRoleNFTCreate": Object{ - "type": "keyword", - }, - "ESDTRoleNFTUpdateAttributes": Object{ - "type": "keyword", - }, - "ESDTTransferRole": Object{ - "type": "keyword", - }, - }, - }, - "ticker": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "token": Object{ - "type": "text", - }, - "type": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/transactions.go b/templates/withKibana/transactions.go deleted file mode 100644 index c96b9b30..00000000 --- a/templates/withKibana/transactions.go +++ /dev/null @@ -1,141 +0,0 @@ -package withKibana - -// Transactions will hold the configuration for the transactions index -var Transactions = Object{ - "index_patterns": Array{ - "transactions-*", - }, - "settings": Object{ - "number_of_shards": 5, - "number_of_replicas": 0, - "opendistro.index_state_management.rollover_alias": "transactions", - "index": Object{ - "sort.field": Array{ - "timestamp", "nonce", - }, - "sort.order": Array{ - "desc", "desc", - }, - }, - }, - "mappings": Object{ - "properties": Object{ - "data": Object{ - "type": "text", - }, - "esdtValues": Object{ - "type": "keyword", - }, - "esdtValuesNum": Object{ - "type": "double", - }, - "fee": Object{ - "index": "false", - "type": "keyword", - }, - "feeNum": Object{ - "type": "double", - }, - "function": Object{ - "type": "keyword", - }, - "gasLimit": Object{ - "index": "false", - "type": "double", - }, - "gasPrice": Object{ - "index": "false", - "type": "double", - }, - "gasUsed": Object{ - "index": "false", - "type": "double", - }, - "hasOperations": Object{ - "type": "boolean", - }, - "hasScResults": Object{ - "type": "boolean", - }, - "hasLogs": Object{ - "type": "boolean", - }, - "initialPaidFee": Object{ - "index": "false", - "type": "keyword", - }, - "isRelayed": Object{ - "type": "boolean", - }, - "isScCall": Object{ - "type": "boolean", - }, - "miniBlockHash": Object{ - "type": "keyword", - }, - "nonce": Object{ - "type": "double", - }, - "operation": Object{ - "type": "keyword", - }, - "receiver": Object{ - "type": "keyword", - }, - "receiverShard": Object{ - "type": "long", - }, - "receivers": Object{ - "type": "keyword", - }, - "receiversShardIDs": Object{ - "type": "long", - }, - "round": Object{ - "type": "double", - }, - "searchOrder": Object{ - "type": "long", - }, - "sender": Object{ - "type": "keyword", - }, - "senderShard": Object{ - "type": "long", - }, - "senderUserName": Object{ - "type": "keyword", - }, - "signature": Object{ - "index": "false", - "type": "keyword", - }, - "status": Object{ - "type": "keyword", - }, - "timestamp": Object{ - "type": "date", - "format": "epoch_second", - }, - "tokens": Object{ - "type": "text", - }, - "value": Object{ - "type": "keyword", - }, - "valueNum": Object{ - "type": "double", - }, - "version": Object{ - "type": "long", - }, - "guardian": Object{ - "type": "keyword", - }, - "guardianSignature": Object{ - "index": "false", - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/transactionsPolicy.go b/templates/withKibana/transactionsPolicy.go deleted file mode 100644 index 3344f012..00000000 --- a/templates/withKibana/transactionsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// TransactionsPolicy will hold the configuration for the transactions index policy -var TransactionsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the transactions elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "85gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "85gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"transactions-*"}, - "priority": 100, - }, - }, -} diff --git a/templates/withKibana/validators.go b/templates/withKibana/validators.go deleted file mode 100644 index 817f5c66..00000000 --- a/templates/withKibana/validators.go +++ /dev/null @@ -1,19 +0,0 @@ -package withKibana - -// Validators will hold the configuration for the validators index -var Validators = Object{ - "index_patterns": Array{ - "validators-*", - }, - "settings": Object{ - "number_of_shards": 1, - "number_of_replicas": 0, - }, - "mappings": Object{ - "properties": Object{ - "publicKeys": Object{ - "type": "keyword", - }, - }, - }, -} diff --git a/templates/withKibana/validatorsPolicy.go b/templates/withKibana/validatorsPolicy.go deleted file mode 100644 index 6ff00c3b..00000000 --- a/templates/withKibana/validatorsPolicy.go +++ /dev/null @@ -1,44 +0,0 @@ -package withKibana - -// ValidatorsPolicy will hold the configuration for the validators index policy -var ValidatorsPolicy = Object{ - "policy": Object{ - "description": "Open distro policy for the validators elastic index.", - "default_state": "hot", - "states": Array{ - Object{ - "name": "hot", - "actions": Array{ - Object{ - "rollover": Object{ - "min_size": "20gb", - }, - }, - }, - "transitions": Array{ - Object{ - "state_name": "warm", - "conditions": Object{ - "min_size": "20gb", - }, - }, - }, - }, - Object{ - "name": "warm", - "actions": Array{ - Object{ - "replica_count": Object{ - "number_of_replicas": 1, - }, - }, - }, - "transitions": Array{}, - }, - }, - "ism_template": Object{ - "index_patterns": Array{"validators-*"}, - "priority": 100, - }, - }, -} From 16d559d7657daba97d5068976af61d8b343318da Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 5 Jun 2025 14:55:35 +0300 Subject: [PATCH 2/3] fix --- integrationtests/claimRewards_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/integrationtests/claimRewards_test.go b/integrationtests/claimRewards_test.go index 9d9b11cf..8901fe1f 100644 --- a/integrationtests/claimRewards_test.go +++ b/integrationtests/claimRewards_test.go @@ -7,7 +7,6 @@ import ( "encoding/hex" "math/big" "testing" - "time" "github.com/multiversx/mx-chain-core-go/core" dataBlock "github.com/multiversx/mx-chain-core-go/data/block" @@ -30,7 +29,7 @@ func TestTransactionWithClaimRewardsGasRefund(t *testing.T) { txHash := []byte("claimRewards") header := &dataBlock.Header{ Round: 50, - TimeStamp: uint64(time.Now().Unix()), + TimeStamp: 5040, ShardID: core.MetachainShardId, } From d91ef7869dbf50da3438b78d75700411d41fd36c Mon Sep 17 00:00:00 2001 From: Iuga Mihai <50499646+miiu96@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:03:09 +0300 Subject: [PATCH 3/3] Update process/elasticproc/templatesAndPolicies/reader.go Co-authored-by: Darius --- process/elasticproc/templatesAndPolicies/reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/elasticproc/templatesAndPolicies/reader.go b/process/elasticproc/templatesAndPolicies/reader.go index 05743a1a..d14c7987 100644 --- a/process/elasticproc/templatesAndPolicies/reader.go +++ b/process/elasticproc/templatesAndPolicies/reader.go @@ -10,7 +10,7 @@ import ( type templatesAndPolicyReader struct{} -// NewTemplatesAndPolicyReader will create a new instance of templatesAndPolicyReaderNoKibana +// NewTemplatesAndPolicyReader will create a new instance of templatesAndPolicyReader func NewTemplatesAndPolicyReader() *templatesAndPolicyReader { return new(templatesAndPolicyReader) }