Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ env:
@echo export CARTESI_LOG_LEVEL="info"
@echo export CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="latest"
@echo export CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="http://localhost:8545"
@echo export CARTESI_BLOCKCHAIN_WS_ENDPOINT="ws://localhost:8545"
@echo export CARTESI_BLOCKCHAIN_POLLING_INTERVAL="1"
@echo export CARTESI_BLOCKCHAIN_ID="31337"
@echo export CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="0x1b51e2992A2755Ba4D6F7094032DF91991a0Cfac"
@echo export CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="0x5E96408CFE423b01dADeD3bc867E6013135990cc"
Expand Down
8 changes: 0 additions & 8 deletions cmd/cartesi-rollups-evm-reader/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cartesi/rollups-node/internal/version"
"github.com/cartesi/rollups-node/pkg/ethutil"
"github.com/cartesi/rollups-node/pkg/service"
"github.com/ethereum/go-ethereum/ethclient"

"github.com/spf13/cobra"
)
Expand All @@ -23,7 +22,6 @@ var (
logColor bool
defaultBlockString string
blockchainHttpEndpoint string
blockchainWsEndpoint string
databaseConnection string
maxStartupTime string
enableInputReader bool
Expand Down Expand Up @@ -57,8 +55,6 @@ func init() {
"Database connection string in the URL format\n(eg.: 'postgres://user:password@hostname:port/database') ")
cli.AddFlagStrVar(flags, &blockchainHttpEndpoint, "blockchain-http-endpoint", config.BLOCKCHAIN_HTTP_ENDPOINT,
"Blockchain http endpoint")
cli.AddFlagStrVar(flags, &blockchainWsEndpoint, "blockchain-ws-endpoint", config.BLOCKCHAIN_WS_ENDPOINT,
"Blockchain WS Endpoint")
cli.AddFlagStrVar(flags, &maxStartupTime, "max-startup-time", config.MAX_STARTUP_TIME,
"Maximum startup time in seconds")
cli.AddFlagBoolVar(flags, &enableInputReader, "input-reader", config.FEATURE_INPUT_READER_ENABLED,
Expand Down Expand Up @@ -107,10 +103,6 @@ func run(cmd *cobra.Command, args []string) {
}, authOpt)
cli.CheckErr(logger, err)

wsEndpoint := cfg.BlockchainWsEndpoint.Raw()
createInfo.EthWsClient, err = ethclient.DialContext(ctx, wsEndpoint)
cli.CheckErr(logger, ethutil.RedactEndpointFromError(err, wsEndpoint))

createInfo.Repository, err = factory.NewRepositoryFromConnectionString(ctx, cfg.DatabaseConnection.Raw())
cli.CheckErr(logger, err)
defer createInfo.Repository.Close()
Expand Down
7 changes: 0 additions & 7 deletions cmd/cartesi-rollups-node/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var (
logLevelValidator string
defaultBlockString string
blockchainHttpEndpoint string
blockchainWsEndpoint string
databaseConnection string
advancerPollInterval string
validatorPollInterval string
Expand Down Expand Up @@ -90,8 +89,6 @@ func init() {
"Database connection string in the URL format\n(eg.: 'postgres://user:password@hostname:port/database') ")
cli.AddFlagStrVar(flags, &blockchainHttpEndpoint, "blockchain-http-endpoint", config.BLOCKCHAIN_HTTP_ENDPOINT,
"Blockchain HTTP endpoint")
cli.AddFlagStrVar(flags, &blockchainWsEndpoint, "blockchain-ws-endpoint", config.BLOCKCHAIN_WS_ENDPOINT,
"Blockchain WS Endpoint")
cli.AddFlagStrVar(flags, &advancerPollInterval, "advancer-poll-interval", config.ADVANCER_POLLING_INTERVAL,
"Advancer poll interval")
cli.AddFlagStrVar(flags, &validatorPollInterval, "validator-poll-interval", config.VALIDATOR_POLLING_INTERVAL,
Expand Down Expand Up @@ -167,10 +164,6 @@ func run(cmd *cobra.Command, args []string) {
createInfo.ReaderClient, err = newEthClient(ctx, config.ServiceEvmReader)
cli.CheckErr(logger, err)

wsEndpoint := cfg.BlockchainWsEndpoint.Raw()
createInfo.ReaderWSClient, err = ethclient.DialContext(ctx, wsEndpoint)
cli.CheckErr(logger, ethutil.RedactEndpointFromError(err, wsEndpoint))

createInfo.ClaimerClient, err = newEthClient(ctx, config.ServiceClaimer)
cli.CheckErr(logger, err)

Expand Down
5 changes: 1 addition & 4 deletions compose.individual-services.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x-env: &env
CARTESI_LOG_LEVEL: info
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT_FILE: /run/secrets/blockchain_http_endpoint
CARTESI_BLOCKCHAIN_WS_ENDPOINT_FILE: /run/secrets/blockchain_http_endpoint
CARTESI_BLOCKCHAIN_POLLING_INTERVAL: 1
CARTESI_BLOCKCHAIN_ID: 31337
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS: 0x1b51e2992A2755Ba4D6F7094032DF91991a0Cfac
CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS: 0x5E96408CFE423b01dADeD3bc867E6013135990cc
Expand Down Expand Up @@ -64,7 +64,6 @@ services:
secrets:
- auth_mnemonic
- blockchain_http_endpoint
- blockchain_ws_endpoint
- database_connection
environment:
<<: *env
Expand Down Expand Up @@ -153,7 +152,5 @@ secrets:
file: test/secrets/auth_mnemonic.txt
blockchain_http_endpoint:
file: test/secrets/blockchain_http_endpoint.txt
blockchain_ws_endpoint:
file: test/secrets/blockchain_ws_endpoint.txt
database_connection:
file: test/secrets/database_connection.txt
5 changes: 1 addition & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x-env: &env
CARTESI_LOG_LEVEL: info
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT_FILE: /run/secrets/blockchain_http_endpoint
CARTESI_BLOCKCHAIN_WS_ENDPOINT_FILE: /run/secrets/blockchain_http_endpoint
CARTESI_BLOCKCHAIN_POLLING_INTERVAL: 1
CARTESI_BLOCKCHAIN_ID: 31337
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS: 0x1b51e2992A2755Ba4D6F7094032DF91991a0Cfac
CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS: 0x5E96408CFE423b01dADeD3bc867E6013135990cc
Expand Down Expand Up @@ -69,7 +69,6 @@ services:
secrets:
- auth_mnemonic
- blockchain_http_endpoint
- blockchain_ws_endpoint
- database_connection
environment:
<<: *env
Expand All @@ -85,7 +84,5 @@ secrets:
file: test/secrets/auth_mnemonic.txt
blockchain_http_endpoint:
file: test/secrets/blockchain_http_endpoint.txt
blockchain_ws_endpoint:
file: test/secrets/blockchain_ws_endpoint.txt
database_connection:
file: test/secrets/database_connection.txt
27 changes: 3 additions & 24 deletions internal/config/generate/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ Examples:
omit = true
used-by = ["evmreader", "claimer", "node"]

[blockchain.CARTESI_BLOCKCHAIN_WS_ENDPOINT]
file = true
go-type = "URL"
description = """
WebSocket endpoint for the blockchain RPC provider."""
used-by = ["evmreader", "node"]

[blockchain.CARTESI_BLOCKCHAIN_LEGACY_ENABLED]
default = "false"
go-type = "bool"
Expand Down Expand Up @@ -227,25 +220,11 @@ description = """
Maximum wait time in seconds for the exponential backoff retry policy. The delay between retries for HTTP blockchain requests will never exceed this value, regardless of the backoff calculation."""
used-by = ["evmreader", "claimer", "node", "prt"]

[rollups.CARTESI_BLOCKCHAIN_WS_LIVENESS_TIMEOUT]
default = "120"
go-type = "Duration"
description = """
Maximum time in seconds to wait for a new block header on the WebSocket subscription before treating the connection as stalled and reconnecting. Handles silent connection drops where no error is delivered. The default (120s) is tuned for mainnet (~12s block time). Reduce for faster chains or devnets."""
used-by = ["evmreader", "node"]

[rollups.CARTESI_BLOCKCHAIN_WS_MAX_RETRIES]
default = "4"
go-type = "uint64"
description = """
Maximum number of consecutive WebSocket subscription failures before the service gives up and exits. A failure is counted only when a subscription attempt produces zero headers before disconnecting. Successful header processing resets the counter."""
used-by = ["evmreader", "node"]

[rollups.CARTESI_BLOCKCHAIN_WS_RECONNECT_INTERVAL]
default = "1"
[rollups.CARTESI_BLOCKCHAIN_POLLING_INTERVAL]
default = "12"
go-type = "Duration"
description = """
Wait time in seconds between WebSocket subscription reconnection attempts after a connection failure."""
Time in seconds to wait before checking for a new block header. The default (12s) is tuned for mainnet. Reduce for faster chains or devnets."""
used-by = ["evmreader", "node"]

[rollups.CARTESI_BLOCKCHAIN_MAX_BLOCK_RANGE]
Expand Down
Loading
Loading