- replace log crate with tracing,
- replace simple-log crate with tracing-subscriber and tracing-appender
- add nu-ansi-term crate as a dependency which is itself tracing-subscriber's dependency,
inorder to write colored outputs to the terminal since we override formatting provided
by tracing-subscriber
Enhanced the `explorerd` error module by introducing parameterized errors, improving error propagation through conversions, renaming for clarity, and refining JSON-RPC error handling.
Updates include:
- Renamed `RpcError` to `ExplorerdError` for use across all application layers (rpc, service, store)
- Updated `ExplorerdError` to support parameterized error variants for more detailed and flexible error messages
- Added conversions from `ExplorerdError` to `RpcError` and `Error` to aid with error propagation from individual RPC handlers to the `handle_request` method
- Renamed `to_tuple` to `to_error_code_message` for improved readability and updated it to support parameterized errors
- Revised the `server_error` function to construct `JsonError` responses using `ExplorerdError`
- Updated Cargo.toml to include thiserror support
- Updated `mod/ping_darkfid` function to use the updated `ExplorerdError`, including error details for additional context
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
This commit relocates the explorer code from the research directory to `bin/explorer` to include it as part of future releases.
### Summary of Updates:
#### Darkfi Project
- Updated `Cargo.toml` to include `bin/explorer/explorerd` as a workspace member
- Updated `Cargo.lock` to include the `explorerd` package
- Updated the `Makefile` to include `explorerd` in the build process
#### Explorer Daemon
- Renamed the project directory from `blockchain-explorer` to `explorer`
- Moved the explorer daemon source code to `bin/explorer/explorerd`
- Updated the cargo package name to `explorerd`
- Updated log statement targets from `blockchain-explorer::` to `explorerd::`
- Renamed the explorer configuration file to `explorerd_config.toml`
- Removed Halo2 patches as they are now included in the root package
- Changed default db_path to use explorerd instead of blockchain-explorer in the path
- Changed binary crate Arg structopt name from blockchain-explorer to explorerd
#### Explorer Site
- Moved the explorer site source code to `bin/explorer/site`
- Updated README.md to include new build instructions for explorerd