Commit Graph

9809 Commits

Author SHA1 Message Date
skoupidi
6c02b4a450 net/message: optional metering infra for rate limitting added 2025-03-06 20:16:41 +02:00
dasman
a4cc48a819 sdk/python: fix clippy useless conversion 2025-03-06 20:43:27 +03:00
darkfi
d84d4a2c5e darkirc: no messages on unjoined channels from paired identities
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.
2025-03-06 12:59:11 +01:00
darkfi
270099e197 darkirc: provide a manual script for four client testing scenarios 2025-03-06 12:59:04 +01:00
dasman
b93f851e38 sdk/python: use proof.verify() instead of proof.assert_satisfied() and still return errors to stderr 2025-03-06 03:26:15 +03:00
dasman
012f5dec23 darkirc/script/bots: fix accidentally messed up telegram bot 2025-03-06 03:23:59 +03:00
dasman
1b3454dd29 darkirc/script/bots: all bots exit on empty buffer 2025-03-06 03:16:45 +03:00
dasman
2acd3c60bb darkirc: deathloop fix, clients(bots) closing unexpectly causing an unhandled read buffer of 0 to continue endlessly 2025-03-06 03:13:48 +03:00
skoupidi
ee2fc468be chore: clippy 2025-03-05 13:26:39 +02:00
darkfi
c7c551ce8a research/zk: circle-stark.sage 2025-03-02 21:42:33 +01:00
skoupidi
9a9917705f script/research/dam: better flood control 2025-03-01 16:36:25 +02:00
parazyd
78109ca8ab tau: Use python3 2025-02-28 15:32:17 +01:00
kalm
5390516ec2 explorerd: Introduce README for explorerd daemon
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
2025-02-28 05:16:21 -08:00
skoupidi
b27dec9b45 net/message: optional max message bytes limit added 2025-02-28 15:03:35 +02:00
skoupidi
7678346e95 doc/arch/net/p2p-network.md: fixed relative path 2025-02-27 15:33:12 +02:00
stranger
cadb5b7d14 doc/philosophy: Add next meeting info 2025-02-26 15:39:22 +01:00
skoupidi
40ca0d4b92 darkfid: don't require minerd to be running to start 2025-02-26 13:53:40 +02:00
skoupidi
a2e25ff8cb drk/main: added missing logger 2025-02-26 13:36:30 +02:00
parazyd
e3f50d37b6 util/cli: Allow forceful process abort with 3x SIGINT 2025-02-26 12:12:34 +01:00
parazyd
1410f72bd9 chore: Add explorerd to root gitignore 2025-02-26 11:04:29 +01:00
parazyd
c7d9414bf2 runtime: Port to wasmer-6.0 2025-02-25 16:22:56 +01:00
parazyd
3f73be0f06 net/hosts: Mix socks5 with tcp 2025-02-25 12:30:28 +01:00
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