diff --git a/cmd/chainsimulator/config/config.toml b/cmd/chainsimulator/config/config.toml index edf3f80e..d0ca5f27 100644 --- a/cmd/chainsimulator/config/config.toml +++ b/cmd/chainsimulator/config/config.toml @@ -28,3 +28,7 @@ auto-generate-blocks = false # block-time-in-milliseconds specifies the time between blocks generation in case auto-generate-blocks is enabled block-time-in-milliseconds = 6000 + + [config.fetch-state] + enabled = false + gateway-url = "https://gateway.multiversx.com" diff --git a/cmd/chainsimulator/main.go b/cmd/chainsimulator/main.go index ee8134df..602903d7 100644 --- a/cmd/chainsimulator/main.go +++ b/cmd/chainsimulator/main.go @@ -191,6 +191,13 @@ func startChainSimulator(ctx *cli.Context) error { alterConfigsError = overridableConfig.OverrideConfigValues(overrideCfg.OverridableConfigTomlValues, cfg) }, VmQueryDelayAfterStartInMs: 0, + FetchStateConfig: chainSimulator.FetchStateFromProvidedChainConfig{ + Enabled: cfg.Config.FetchState.Enabled, + FetchNonce: true, + FetchRound: true, + FetchEpoch: true, + GatewayURL: cfg.Config.FetchState.GatewayUrl, + }, } simulator, err := chainSimulator.NewChainSimulator(argsChainSimulator) if err != nil { diff --git a/config/config.go b/config/config.go index a60a43da..eb762f60 100644 --- a/config/config.go +++ b/config/config.go @@ -23,6 +23,10 @@ type Config struct { LogsPath string `toml:"logs-path"` } `toml:"logs"` BlocksGenerator BlocksGeneratorConfig `toml:"blocks-generator"` + FetchState struct { + Enabled bool `toml:"enabled"` + GatewayUrl string `toml:"gateway-url"` + } `toml:"fetch-state"` } `toml:"config"` } diff --git a/go.mod b/go.mod index 7b41a5d3..0ce51e2f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 github.com/gin-gonic/gin v1.10.0 github.com/multiversx/mx-chain-core-go v1.4.0 - github.com/multiversx/mx-chain-go v1.10.5 + github.com/multiversx/mx-chain-go v1.10.6-0.20250812073101-6e197d94a109 github.com/multiversx/mx-chain-logger-go v1.1.0 github.com/multiversx/mx-chain-proxy-go v1.3.1 github.com/pelletier/go-toml v1.9.3 diff --git a/go.sum b/go.sum index 3df19c1e..5fe70896 100644 --- a/go.sum +++ b/go.sum @@ -416,8 +416,8 @@ github.com/multiversx/mx-chain-crypto-go v1.3.0 h1:0eK2bkDOMi8VbSPrB1/vGJSYT81IB github.com/multiversx/mx-chain-crypto-go v1.3.0/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM= github.com/multiversx/mx-chain-es-indexer-go v1.9.1 h1:Jg/4CLzIiwyrjuy+ZccEJ4TcvlHXnBUr5o3pclVitGo= github.com/multiversx/mx-chain-es-indexer-go v1.9.1/go.mod h1:t1rkD2vHXSI4EClig0h7+kRCSUCRrMF+emr4DHxFtfA= -github.com/multiversx/mx-chain-go v1.10.5 h1:wldx5GZ3+MZDJWV01QenHAUF8bGW615cmZsRJtdX7gs= -github.com/multiversx/mx-chain-go v1.10.5/go.mod h1:ELWAFinKEiqOeDe8kHJ+zN9zFL9leV4tNpMgH1fLnBE= +github.com/multiversx/mx-chain-go v1.10.6-0.20250812073101-6e197d94a109 h1:AiWrdhCsLOcPmYIKEYnROkY+l6iLaCV4cZkl1Nn2dIk= +github.com/multiversx/mx-chain-go v1.10.6-0.20250812073101-6e197d94a109/go.mod h1:ELWAFinKEiqOeDe8kHJ+zN9zFL9leV4tNpMgH1fLnBE= github.com/multiversx/mx-chain-logger-go v1.1.0 h1:97x84A6L4RfCa6YOx1HpAFxZp1cf/WI0Qh112whgZNM= github.com/multiversx/mx-chain-logger-go v1.1.0/go.mod h1:K9XgiohLwOsNACETMNL0LItJMREuEvTH6NsoXWXWg7g= github.com/multiversx/mx-chain-proxy-go v1.3.1 h1:tjbTm3FpR0bjDvWAMK0zwRxRbbjGszSWltng7jv6CIg=