Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index incoming tokens #6736

Open
wants to merge 11 commits into
base: feat/chain-go-sdk
Choose a base branch
from

Conversation

axenteoctavian
Copy link
Contributor

@axenteoctavian axenteoctavian commented Jan 23, 2025

Reasoning behind the pull request

  • index incoming tokens properties

Proposed changes

  • MainChainElasticSearchConnector in external.toml
  • ESDTPrefix and ElasticConfig sent as parameter to indexer
  • sh scripts will enable MainChainElasticSearchConnector if USE_ELASTICSEARCH=1
  • sovereign deploy scripts will update MainChainElasticSearchConnector.URL with link from configs.cfg

Testing procedure

  • sovereign local setup

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@axenteoctavian axenteoctavian self-assigned this Jan 23, 2025
@axenteoctavian axenteoctavian marked this pull request as ready for review January 28, 2025 13:28
@mariusmihaic mariusmihaic self-requested a review February 6, 2025 08:57
@@ -15,6 +15,17 @@
# ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts"]
EnabledIndexes = ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts"]

# MainChainElasticSearchConnector defines settings related to ElasticSearch such as login information or URL
[MainChainElasticSearchConnector]
## We do not recommend to activate this indexer on a validator node since
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use ## and no spacing after each # below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy-pasted from above 😄

  • updated

#the indexer is called synchronously and might block due to external causes.
#Strongly suggested to activate this on a regular observer node.
Enabled = false
URL = "http://localhost:9201"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example here in the comment with a link to the public es link from our mainnet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not put it here, I don't think is necessary. The deploy scripts update this automatically

EventNotifierConnector EventNotifierConfig
HostDriversConfig []HostDriversConfig
ElasticSearchConnector ElasticSearchConfig
MainChainElasticSearchConnector MainChainElasticSearchConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a preference, if you add something new, can you please MainChainElasticSearchConnector at the end of the struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the sections order from the .toml file...

@@ -64,6 +66,7 @@ type statusComponentsFactory struct {
cryptoComponents factory.CryptoComponentsHolder
isInImportMode bool
isSovereign bool
esdtPrefix string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Pass esdPrefix all the way down to here? Don't you already have the whole config in statusComponentsFactory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just the GeneralConfig, and I needed SystemSCConfig for the prefix.

@@ -8,6 +8,7 @@ WALLET="~/wallet.pem"
WALLET_SOVEREIGN="~/MultiversX/testnet/node/config/walletKey.pem"

#=========== NETWORK CONFIGURATION ===========
MAIN_CHAIN_ELASTIC=https://testnet-index.multiversx.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this config be automatically updated to mainnet/devnet elastic link if we change the script configuration chain ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHAIN_ID is not changing the PROXY or MAIN_CHAIN_ELASTIC URL. It needs to be changed manually.

section_found = True
if section_found and key in line:
line = re.sub(rf'({re.escape(key)}\s*=\s*)".*?"', rf'\1"{value}"', line)
section_found = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set this to False if you don't use it afterwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will skip the second if and will not check key in line every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants