Upon restarting darkirc, messages from paired identities (i.e. users
who have exchanged and configured chacha keypairs) on unjoined
channels would be nevertheless be delivered. IRC clients like
`weechat` would ignore such events, but other clients such as `ERC`
would deliver such messages without joining the channel resulting in
confusing "phantom" channels popping up.
Added a README to document the `explorerd` daemon, including its key functionality, configuration, supported networks, setup, and instructions for running it.
Summary of Updates:
- Added an overview of `explorerd` functionality, including synchronization, reorg mitigation, and real-time updates
- Documented key features such as full blockchain synchronization and analytics support
- Included a configuration section with example configurations aligned to DarkFi network setups
- Documented supported networks (`localnet`, `testnet`, and `mainnet`)
- Provided instructions for building, installing, configuring, and starting explorer nodes
- Included steps to start supporting daemons (`darkfid` and `minerd`) for synchronization
This update adds a startup banner to explorerd that logs key details about the DarkFi Explorer Node when it starts successfully. The banner includes information such as the network, JSON-RPC endpoint, database path, configuration path, syncing details, and the connected DarkFi node, improving visibility and making debugging easier during startup. Additionally, longer log messages were shortened where possible to improve message length consistency.
Summary of Changes:
- Added the `log_started_banner` function to display the startup banner
- Updated the binary crate's main method to call `log_started_banner` after a successful startup
- Shortened some log messages to maintain a more consistent length where possible
This update introduces configuration support for multiple networks (localnet, testnet, and mainnet) in the explorer site, enabling tailored provisioning for development, testing, and production environments.
Summary of Updates:
- Added network-specific configurations in `site_config.toml` based on the latest `explorerd` configurations
- Set up `log_path` directories for each network
- Removed devnet placeholder configuration
This update adds configuration support for multiple networks (localnet, testnet, and mainnet) to the explorer daemon, enabling provisioning of tailored instances for development, testing, and production environments.
Summary of Updates:
- Added `--network` argument to the binary crate args for specifying networks (localnet, testnet, and mainnet)
- Implemented a `config` module for configuration management
- Introduced `ExplorerConfig` and `ExplorerNetworkConfig` structures to model and work with the complete configuration file programmatically in Rust
- Implemented `TryFrom` traits for configuration conversions
- Added tests for configuration loading and network selection logic, which also validate the `explorerd_config.toml` configuration file
- Updated the `explorer_config.toml` file to define initial configurations for localnet, testnet, and mainnet
- Renamed the configuration key `db_path` to `database` for consistency across the project
- Added toml dependency to Cargo.toml
- Removed unused drk dependency from Cargo.toml
- Added rpc to feature list for darkfi dependency
Improved logging capabilities for better visibility in the `localnet` environment and during application startup.
Summary of Updates:
- Added a function `add_console_handler_if_localnet` to enable console logging for all loggers when running on `localnet`
- Automatically create the log directory if it does not exist
- Log a banner with key startup details when the application successfully starts
This commit introduces error, application, and request logging to the explorer site. These changes establish a robust and unified logging system for monitoring and debugging the explorer across environments. Logs are stored in the directory specified in the site configuration TOML file under `log_path` (defaulting to the current directory if not specified).
Summary of Updates:
- Added `log` module that provides functionality to setup logging for the explorer Flask application
- Added support for specifying logging directories per environment through `log_path` in `site_config.toml`
- Implemented error logging handler to capture detailed error information in `error.log`
- Added application logging for general app-level logs such as debug and informational messages
- Integrated request logging by tying the Werkzeug logger to the same log file as the application logger
- Added `RotatingFileHandler` for mainnet logging
- Updated the 500 error handler to log detailed error information prior to rendering the `500.html` page
Added log statements to display the endpoint URLs when connecting to Darkfi nodes and starting the JSON-RPC server. These updates help confirm connections and debug any issues during deployment on different networks.
This update improves the configuration setup for the explorer site by replacing hardcoded values with a TOML-based configuration file, enabling easier configuration and deployment across different networks, such as devnet, testnet, and mainnet.
- Introduced a `load_toml_config` function to load environment-specific key-value pairs from a TOML configuration file into the Flask app's `app.config`
- Created an initial `site_config.toml` file to define default configurations for various environments (e.g., localnet, devnet, testnet, and mainnet). The configurations for devnet, testnet, and mainnet are still a work in progress and marked as TODOs.
- Updated the RPC module to connect to the explorerd using the values specified in the configuration file
- Added tomli to requirements.txt
This commit introduces timing code to measure the duration of block syncs and reorgs to improve observability of performance.
### Changes:
- Updated the log statement for each block being synced to include the sync time per block and changed it to debug level
- Enhanced logging to provide details about the number of blocks synced, the new explorer block count, and the total sync duration during the initial sync
- Added timers to track the duration of block sync and subscribe sync reorgs
- Added a timer to measure the total time taken to subscribe and sync each block
Changed logging for inserting contract source and metadata from `info` to `debug` to reduce verbosity. Added a high-level `info` log to indicate successful loading of native contract metadata.
Added a utility to format a `Duration` into a user-friendly format using days, hours, minutes, and seconds. Durations under one minute include fractional seconds with nanosecond precision (up to 9 decimal places), while longer durations use whole seconds, rounded to the nearest second. Includes unit tests to ensure correctness across various scenarios.