19 Commits

Author SHA1 Message Date
x
4f30aae91d doc: Update book links 2026-01-02 17:28:09 +00:00
x
9785777642 chore: Update copyright license year
Happy 2026!
2026-01-01 11:40:45 +00:00
kalm
5cd8c6c035 explorer/site: run testnet and mainnet on WSGI server
This commit updates the explorer web app to run on a Gunicorn-based WSGI server for testnet and mainnet rather than the built-in dev server. In doing so, it provides for improved scalability, reliability, integration with Nginx, and flexible run configuration.

We’ve introduced a dedicated configuration file (gunicorn_config.py) allowing control over the number of worker processes and threads. By adjusting these values, we can handle more simultaneous requests, fine-tune performance based on CPU resources, and tweak other operational parameters to suit deployment needs.

Update Summary:
- Added gunicorn_config.py to configure bind address, workers, threads, pidfile, and logs
- Updated the testnet and mainnet ports to run on 8000 instead of the 5000 dev port
- Created wsgi.py to load and expose the Flask app via `create_app()`
- Updated requirements.txt to include Gunicorn dependency
- Modified makefile start-% target to start with Gunicorn for testnet/mainnet instead of the development server
- Adjusted stop task to stop Gunicorn server when stopping the explorer
- We updated the requirements.txt install to run quietly
- Updated Makefile to export LOG_HOME so it can be accessed by gunicorn_config.py
2025-05-26 15:34:10 -07:00
skoupidi
56546572e7 explorer/site/templates/block: fucking moron 2025-05-07 17:58:59 +03:00
skoupidi
c38e5f66a5 explorer/site/templates/block: missing pow type added 2025-05-07 17:56:16 +03:00
skoupidi
7656bde63b blockchain: contracts states checksums monotree(smt) added 2025-05-06 16:28:40 +03:00
kalm
34e0fdd7be explorer/site: accommodate new RPC parameter handling of numerics
Change the index route code in explore.py to call `get_last_n_blocks` with an integer instead of a string to accommodate the updated RPC layer, which now expects numeric types rather than strings for numbers.
2025-03-24 04:18:38 -07:00
kalm
753dc262f2 explorer/site: add quick-start guide to explorer site README, clarified network status
This commit enhances the explorer site README by adding a quick-start guide. Additionally, it clarifies the current network status for testnet and mainnet environments, and improves the overall document organization.

Summary of Updates:
- Added Quick-Start Guide section to README documenting new make commands for server management
- Added Network Status section explaining the current placeholder state of testnet and mainnet
- Reorganized README structure into Quick-Start and Detailed Guide sections for better navigation
- Added help command information (make help) for quick reference
2025-03-10 04:54:22 -07:00
kalm
27d8618e84 explorer/site: Add help target and reorganize Makefile
- Add help target with organized documentation of available commands
- Rename 'stop-server' target to more concise 'stop'
- Fix Python executable path (use generic 'python' instead of hard-coded path)
- Reorganize sections for better logical grouping
- Generalized naming to explorer site
- Added console statements to show the testnet and mainnet log locations on startup to see server startup details
2025-03-09 05:37:17 -07:00
kalm
a839603b2c explorer/site: Add Makefile for simplified Flask Explorer site management
Introduced a Makefile to streamline the setup, startup, and shutdown of the Flask Explorer site across different networks (localnet, testnet, mainnet). It simplifies server management and cleanup with straightforward commands.

In future iterations, `testnet` and `mainnet` environments may transition to production-ready setups (e.g., running behind a reverse proxy). This implementation serves as a starting point and is expected to be expanded upon.

Summary of Updates:
- Automatic virtual environment setup and dependency installation (`all`, ``install` targets)
- Added targets to start the Flask server for localnet, testnet, and mainnet networks
- Implemented the use of a `flask.pid` file to track the Flask server’s process ID (PID), enabling proper process termination during the `stop-server` target
- Provided a `clean` target to remove the virtual environment and reset the workspace
2025-03-07 21:58:08 -08:00
kalm
5a56634929 explorer/site: display running network in the explorer site nav bar
This commit enables users to identify which network the explorer site is currently running, improving clarity for users navigating the site.

- Added a `<div>` in `base.html` to display the current network in the nav bar
- Updated `app.py` to store the network environment in app config, making it accessible for use in the nav bar
- Renamed references from env to network in app.py
2025-03-07 21:22:10 -08:00
kalm
d6815b217d explorer/site: improved text color consistency across components
- Added new CSS variables: `--color-input-background: #3B3B3B;`, `--color-source-code-link: #D1CDC7;`, `--color-text-primary: #D1CDC7;`
- Set the default color of the content container to `--color-text-primary`
- Updated the search input to explicitly set the background color (`--color-input-background`) and border color (`--color-border-primary`)
- Explicitly set the table text color to `--color-text-primary`
- Overrode Bootstrap's default `pre` and `pre code` styles to use `--color-text-primary`
2025-03-06 21:58:31 -08:00
kalm
aa42428f23 explorer/site: enhance explorer site README.md
Expanded site README documentation to provide updated instructions reflecting the latest code.

Summary of Updates:
- Updated overall project description
- Included a key features section detailing core site functionality
- Reorganized the Usage section into a Getting Started section, separating prerequisites, installation, and running the application
- Moved supporting daemons and explorerd-related setup to explorerd/README.md and explorer/README.md
- Added a configuration section describing the site's configuration options
- Added a Logging section providing insights on the site's use of logs, log locations, log output, and log level configuration
2025-03-06 14:56:25 -08:00
kalm
33a79af5a3 explorer/site: add support for explorer nodes running on multiple networks (localnet, testnet, mainnet)
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
2025-02-24 06:14:11 -08:00
kalm
18dc05283d explorer/site: Enhance logging functionality and add application startup banner
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
2025-02-23 22:05:46 -08:00
kalm
d811a60cb4 explorer/site: introduce logging for the explorer site
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
2025-02-22 13:24:42 -08:00
kalm
7eaab11f76 explorer/site: update configuration keys to lowercase
Refactored all configuration keys in `site_config.toml` to use lowercase instead of uppercase for consistency.
2025-02-22 03:00:26 -08:00
kalm
1a684c6702 explorer/site: Add support for TOML-based configuration
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
2025-02-22 01:25:43 -08:00
kalm
f852967618 explorer: move explorer source code from research to bin/explorer for project releases
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
2025-02-18 03:49:44 -08:00