Commit Graph

9787 Commits

Author SHA1 Message Date
parazyd
f5baac83cf chore: Update crate dependencies 2025-02-25 12:15:28 +01:00
parazyd
ee96346e4c net/connector: Allow socks5+tls with transport mixing 2025-02-25 12:10:43 +01:00
parazyd
01ba2431a6 net: Add socks5+tls support 2025-02-25 12:05:44 +01:00
kalm
315ef49038 explorerd: add startup banner and refine log message lengths
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
2025-02-24 06:16:53 -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
fcdfc3f1bb darkfi: update Cargo.lock to reflect updated explorerd package dependencies
This commit updates Cargo.lock to add the new `toml` dependency and remove the unused `drk` dependency for the explorerd package.
2025-02-24 06:11:24 -08:00
kalm
b8e93d80af explorerd: add support for multiple networks (localnet, testnet, mainnet)
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
2025-02-24 06:06:10 -08:00
skoupidi
bfe1ec9285 darkirc: minor cleanup nitpicks 2025-02-24 14:54:30 +02:00
oars
bd6d6a3e16 contrib/localnet/darkirc: new format for contact config 2025-02-24 14:41:24 +03:00
oars
bdaba4cd41 doc/darkirc/private_message.md: add docs for multiple chacha key support 2025-02-24 14:41:24 +03:00
oars
2b865bcd59 darkirc: multiple chacha keys support 2025-02-24 14:41:24 +03: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
600f3e3b09 darkfi/error: add ConfigError variant with message
Added the `ConfigError` variant for handling configuration-related errors, with details provided in the message.
2025-02-23 16:38:57 -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
d1263aa6f2 explorer/main: update log statements to show connection and server endpoint URLs on startup
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.
2025-02-22 02:01:58 -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
skoupidi
c98d728f87 script/research/dam: sleep deprevation detected 2025-02-21 23:23:50 +02:00
skoupidi
4c7fe93cd4 script/research/dam: Denial-of-service Analysis Multitool added 2025-02-21 23:04:43 +02:00
darkfi
99ae01a8c0 event_graph: minor fix to log output 2025-02-21 19:02:52 +01:00
parazyd
817db023f6 minerd: Allow stopping the miner at given blockchain height 2025-02-21 17:15:15 +01:00
skoupidi
8cff305b5b darkfid/darkfid_config: added missing p2p config options 2025-02-21 16:26:00 +02:00
skoupidi
d5b523a38f script/research/rlnd/rlnd: updated to new rpc impl 2025-02-21 16:21:10 +02:00
kalm
1372a07f6f explorer/rpc_blocks: adjust log level to debug for each synced block on initial explorer sync
This commit addresses a TODO by changing the log level from info to debug for each block synced during the initial block sync.
2025-02-21 03:12:46 -08:00
kalm
d5d1614899 explorer/rpc_blocks: add timing metrics for block syncs and reorgs
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
2025-02-21 02:56:59 -08:00
kalm
aaff4dd6a0 explorer: reduce logging verbosity when loading contract source code and metadata
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.
2025-02-21 01:16:53 -08:00
kalm
ede6f46aef util/time: add fmt_duration for user-friendly duration formatting
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.
2025-02-21 00:51:11 -08:00
darkfi
1ff93a89ba darkirc: persist all channels on /rehash 2025-02-20 19:53:52 +01:00
dasman
5f36dcda79 tau: fix a big in set_comment RPC, and exit with no access msg accordingly 2025-02-20 20:33:01 +03:00
skoupidi
1ae4b7c858 darkfid/rpc: expose endpoints to retrieve contract tree state records, as per task UHqZgC 2025-02-20 16:17:28 +02:00
skoupidi
851d147975 blockchain/contract_store: compute contract state tree pointer after guards has passed 2025-02-20 14:41:58 +02:00
darkfi
2af96b9f83 zkrunner: fix broken witness_gen.py 2025-02-20 12:15:18 +01:00
skoupidi
295590a45e contracts: simplyfied status update returns 2025-02-19 21:14:20 +02:00
skoupidi
01cd3b15cb contracts: host enforcing update FuncId, as per task bVPVbQ 2025-02-19 20:17:46 +02:00
skoupidi
e44bc17586 contract/money/client: shuffle outputs of genesis mint and transfer as per task xo5Vne 2025-02-19 16:11:36 +02:00
skoupidi
c0af9925a8 contract/money/model/token_id: removed deprecated derive functions as per DEP0003 2025-02-19 15:15:48 +02:00
skoupidi
c784b4bd88 Makefile: minor cosmetic change in .PHONY 2025-02-19 14:41:00 +02:00
skoupidi
7a659809bf Makefile: fixed explorerd missing stuff 2025-02-19 14:32:55 +02:00
skoupidi
a671d43cee chore: fmt and fixed minor comments inconsistencies 2025-02-19 13:54:38 +02:00
darkfi
2bbe39e0ee use RpcSettings and RpcSettingsOpt 2025-02-19 13:21:12 +02:00
darkfi
a220243e56 script/node_get-info.py: handle RPC error responses 2025-02-19 13:21:12 +02:00
darkfi
1ad208f0fd rpc/server: use RpcSettings and handle disabled methods 2025-02-19 13:21:12 +02:00
darkfi
1ddafa5e95 rpc: create RpcSettings and RpcSettingsOpt 2025-02-19 13:21:12 +02:00
kalm
7e476b37c0 explorer/rpc_blocks: handle genesis height case when preparing next block to sync after reorg.
This commit adds a check to ensure that the genesis block is included when syncing blocks after a reorg resets the blockchain state to start block sync from block 0.
2025-02-18 19:33:52 -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
parazyd
92f0a8a97e research/sss: Fix Cargo.toml 2025-02-18 12:12:29 +01:00
parazyd
34d8671323 research/snowball: Fix code 2025-02-18 12:11:56 +01:00
skoupidi
a076201e7b minerd/rpc: fixed pending requests check 2025-02-18 13:02:47 +02:00
parazyd
c8636de5ce research/pow: Make the code run again 2025-02-18 11:56:12 +01:00
parazyd
bce531d2ac research/pow: Fix Cargo.toml 2025-02-18 11:45:47 +01:00