-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
kalm
committed
Feb 22, 2025
1 parent
c98d728
commit 1a684c6
Showing
4 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
flask[async] | ||
Pygments | ||
Pygments | ||
tomli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file is part of DarkFi (https://dark.fi) | ||
# | ||
# Copyright (C) 2020-2025 Dyne.org foundation | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
# Localnet Configuration | ||
[localnet] | ||
EXPLORER_RPC_URL = "127.0.0.1" | ||
EXPLORER_RPC_PORT = 14567 | ||
|
||
# Devnet Configuration | ||
[devnet] | ||
EXPLORER_RPC_URL = "TODO" | ||
EXPLORER_RPC_PORT = "TODO" | ||
|
||
# Testnet Configuration | ||
[testnet] | ||
EXPLORER_RPC_URL = "TODO" | ||
EXPLORER_RPC_PORT = "TODO" | ||
|
||
# Mainnet Configuration | ||
[mainnet] | ||
EXPLORER_RPC_URL = "TODO" | ||
EXPLORER_RPC_PORT = "TODO" |