Skip to content

Commit

Permalink
fix: rename light-beaconchain-explorer to dora-the-explorer & change …
Browse files Browse the repository at this point in the history
…db location (#243)

The lightweight beaconchain explorer was renamed to `dora` (Dora the
Explorer).
This PR renames all explorer related variables & references accordingly.

I've also changed the explorer db path to a local file instead of the
`:memory:` placeholder.
The in-memory database caused issues as the content is being wiped when
all db connections are being closed.
I've just used `/dora-database.sqlite` as path. Maybe some of you can
give feedback if that's the right location for it :)

Replacement for #219, as the renaming has been reworked in a new branch
  • Loading branch information
pk910 authored Sep 28, 2023
1 parent db92f7b commit d3a4b49
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi
"cl_forkmon",
"el_forkmon",
"beacon_metrics_gazer",
"light_beaconchain_explorer",
"dora",
"prometheus_grafana"
],

Expand Down
18 changes: 7 additions & 11 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ el_forkmon = import_module(
beacon_metrics_gazer = import_module(
"github.com/kurtosis-tech/ethereum-package/src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star"
)
light_beaconchain_explorer = import_module(
"github.com/kurtosis-tech/ethereum-package/src/light_beaconchain/light_beaconchain_launcher.star"
dora = import_module(
"github.com/kurtosis-tech/ethereum-package/src/dora/dora_launcher.star"
)
prometheus = import_module(
"github.com/kurtosis-tech/ethereum-package/src/prometheus/prometheus_launcher.star"
Expand Down Expand Up @@ -299,15 +299,11 @@ def run(plan, args={}):
beacon_metrics_gazer_prometheus_metrics_job
)
plan.print("Succesfully launched beacon metrics gazer")
elif additional_service == "light_beaconchain_explorer":
plan.print("Launching light-beaconchain-explorer")
light_beaconchain_explorer_config_template = read_file(
static_files.LIGHT_BEACONCHAIN_CONFIG_TEMPLATE_FILEPATH
)
light_beaconchain_explorer.launch_light_beacon(
plan, light_beaconchain_explorer_config_template, all_cl_client_contexts
)
plan.print("Succesfully light-beaconchain-explorer")
elif additional_service == "dora":
plan.print("Launching dora")
dora_config_template = read_file(static_files.DORA_CONFIG_TEMPLATE_FILEPATH)
dora.launch_dora(plan, dora_config_template, all_cl_client_contexts)
plan.print("Succesfully launched dora")
elif additional_service == "prometheus_grafana":
# Allow prometheus to be launched last so is able to collect metrics from other services
launch_prometheus_grafana = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ shared_utils = import_module(
)


SERVICE_NAME = "light-beaconchain"
SERVICE_NAME = "dora"
IMAGE_NAME = "ethpandaops/dora-the-explorer:master"

HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 8080

LIGHT_BEACONCHAIN_CONFIG_FILENAME = "light-beaconchain-config.yaml"
DORA_CONFIG_FILENAME = "dora-config.yaml"

LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config"
DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config"

VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE = "/validator-ranges"
VALIDATOR_RANGES_ARTIFACT_NAME = "validator-ranges"
Expand All @@ -29,7 +29,7 @@ USED_PORTS = {
}


def launch_light_beacon(
def launch_dora(
plan,
config_template,
cl_client_contexts,
Expand All @@ -48,12 +48,10 @@ def launch_light_beacon(
config_template, template_data
)
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[
LIGHT_BEACONCHAIN_CONFIG_FILENAME
] = template_and_data
template_and_data_by_rel_dest_filepath[DORA_CONFIG_FILENAME] = template_and_data

config_files_artifact_name = plan.render_templates(
template_and_data_by_rel_dest_filepath, "light-beaconchain-config"
template_and_data_by_rel_dest_filepath, "dora-config"
)

config = get_config(config_files_artifact_name)
Expand All @@ -63,14 +61,14 @@ def launch_light_beacon(

def get_config(config_files_artifact_name):
config_file_path = shared_utils.path_join(
LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
LIGHT_BEACONCHAIN_CONFIG_FILENAME,
DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
DORA_CONFIG_FILENAME,
)
return ServiceConfig(
image=IMAGE_NAME,
ports=USED_PORTS,
files={
LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME,
CL_CONFIG_MOUNT_DIRPATH_ON_SERVICE: CL_CONFIG_ARTIFACT_NAME,
},
Expand Down
2 changes: 1 addition & 1 deletion src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DEFAULT_ADDITIONAL_SERVICES = [
"cl_forkmon",
"el_forkmon",
"beacon_metrics_gazer",
"light_beaconchain_explorer",
"dora",
"prometheus_grafana",
]

Expand Down
4 changes: 1 addition & 3 deletions src/static_files/static_files.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ BEACON_METRICS_GAZER_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/beacon-metrics-gazer-config/config.yaml.tmpl"
)

LIGHT_BEACONCHAIN_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/light-beaconchain-config/config.yaml.tmpl"
)
DORA_CONFIG_TEMPLATE_FILEPATH = STATIC_FILES_DIRPATH + "/dora-config/config.yaml.tmpl"

# Grafana config
GRAFANA_CONFIG_DIRPATH = "/grafana-config"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

logging:
outputLevel: "info"
#outputStderr: false

#filePath: "explorer.log"
#fileLevel: "warn"

# Chain network configuration
chain:
Expand All @@ -23,7 +19,7 @@ frontend:
minimize: false # minimize html templates

# Name of the site, displayed in the title tag
siteName: "Beaconchain Light"
siteName: "Dora the Explorer"
siteSubtitle: "Kurtosis Testnet"

# link to EL Explorer
Expand All @@ -41,31 +37,27 @@ beaconapi:
archive: true
{{- end }}
# local cache for page models
localCacheSize: 100 # 100MB
localCacheSize: 10 # 10MB

# remote cache for page models
redisCacheAddr: ""
redisCachePrefix: ""

# indexer keeps track of the latest epochs in memory.
indexer:
# number of epochs to load on startup
prepopulateEpochs: 2

# max number of epochs to keep in memory
inMemoryEpochs: 3
inMemoryEpochs: 8

# epoch processing delay (should be >= 2)
epochProcessingDelay: 2
# number of epochs to wait before storing unfinalized blocks to db
cachePersistenceDelay: 8

# disable synchronizing and everything that writes to the db (indexer just maintains local cache)
disableIndexWriter: false

# number of seconds to wait between each epoch (don't overload CL client)
syncEpochCooldown: 2

syncEpochCooldown: 1

database:
engine: "sqlite"
sqlite:
file: ":memory:"
file: "/dora-database.sqlite"

0 comments on commit d3a4b49

Please sign in to comment.