|
|
пре 1 година | |
|---|---|---|
| .. | ||
| docs | пре 1 година | |
| explorerd | пре 1 година | |
| site | пре 1 година | |
| Makefile | пре 1 година | |
| README.md | пре 1 година | |
The DarkFi Blockchain Explorer facilitates the exploration of chain data and interaction with the DarkFi blockchain. It provides detailed insights into block and transaction activity, gas usage metrics, and native contract source code.
The testnet and mainnet configurations serve as placeholders in preparation for their respective launch. When starting environment with these environment configurations , the site will connect to an Explorer Node that point to their respective darkfid networks, but currently only display the network's genesis block.
In addition, testnet and mainnet configurations are currently using development servers for the site and work is ongoing for production-like setups.
Before you begin, ensure you have the following installed and configured:
explorerd).site).../darkfid (if not already built in project root) and apply the appropriate network configuration.../minerd (if not already built in project root) and apply the appropriate network configuration.Run the following to get explorer environments running, including explorer nodes and site to view blocks on the respective Darkfid configured networks. These commands will automatically install dependencies, configure your environment, and start all necessary components.
# Launch an explorer environment using the localnet configuration
make start-localnet
# Launch an explorer environment using the latest testnet configuration
make start-testnet
# Launch an explorer environment using the latest mainnet configuration
make start-mainnet
Once started, navigate to http://127.0.0.1:5000 in your browser to access the explorer interface.
To stop the environment, press the keyboard combination Ctrl-C and wait for all components to stop.
You can also stop the environment using Make:
# Stop the running explorer environment (nodes and site)
make stop
make help
DarkFi explorers rely on explorer nodes who are responsible for syncing with DarkFi blockchain networks. Explorer nodes function as background daemons, running continuously to ensure the Explorer database stays up-to-date. They synchronize with the latest blocks during startup and actively listen for new blocks using DarkFi's subscription interface. This ensures that the Explorer provides an accurate and consistent view of blockchain activity. Explorer nodes are implemented in Rust, designed to reliably handle real-world blockchain changes, including reorganizations (reorgs) and block updates, while maintaining data integrity.
For more details on explorer nodes and their functionality, see explorerd/README.md.
The Explorer Site is a web application that serves as the user interface for viewing DarkFi blockchain data. It provides an interactive way for users to explore blockchain information, analyze gas usage, and navigate contract source code. The site connects to explorer nodes to fetch real-time data, ensuring accurate and up-to-date information is provided.
For more details on the Explorer Site, see site/README.md.
The Explorer uses configuration files to define darkfid endpoints for block synchronization, explorerd endpoints for retrieving blockchain data, and other settings such as log file locations. These configurations can be reviewed and updated as needed.
| Configuration File | Description |
|---|---|
| Darkfid Config | Contains darkfid network configurations for localnet, testnet, and mainnet. |
| Explorerd Config | Specifies the darkfid endpoint for block synchronization and the explorerd endpoint for retrieving synchronized data. |
| ExplorerSite Config | Defines the explorerd endpoints for fetching synchronized data, as well as other settings for the Explorer site. |
The Explorer is configured to support the following pre-configured DarkFi blockchain networks.
| Network | Description |
|---|---|
localnet |
Ideal for development and testing in a local environment using darkfid's localnet configuration. |
testnet |
Used for testing the explorer with darkfid's testnet network (pending availability). |
mainnet |
The production environment for running the explorer on DarkFi's canonical chain (pending availability). |
Note: Once the testnet and mainnet are fully available, the explorer will sync more than just the genesis blocks for these networks.
The explorer’s home page serves as the starting point for navigating blockchain data and features. It provides a high-level overview of available resources, including:
The Explorer provides insights into blockchain activity by giving users the ability to view blocks, obtain transaction details, and analyze the relationships between blocks and transactions.
The Explorer presents detailed information about each block, offering insights into the transactions it contains and other metadata. Below, you’ll find an example of the block details view.
The detailed block view displays the following details.
| Field | Description |
|---|---|
| Version | Indicates the block's version. |
| Previous Block | A navigable link to the previous block's hash. |
| Block Hash | The unique identifier of the block. |
| Block Height | The block's position within the blockchain. |
| Timestamp | The UTC time at which the block was created. |
| Nonce | The proof-of-work or equivalent nonce value for the block. |
| Root | The Merkle root summarizing the hashes of all transactions. |
| Signature | The digital signature of the block. |
| Transactions | List of transaction hashes, each navigable for detailed views. |
The Explorer provides an in-depth view of individual transactions, whether accessed from a block's detailed view or using the search functionality. Below is an example of the transaction details view.
For each transaction, the Explorer displays the following details.
| Field | Description |
|---|---|
| Transaction Hash | A unique identifier for the transaction. |
| Block | The hash of the containing block, linking back to the block’s details. |
| Payload | Call data associated with the transaction. |
| Gas Consumption | The amount of gas used for execution (see Transaction Gas Consumption for more details). |
This feature enables users to:
The Explorer provides detailed analytics on gas usage, covering both network-wide metrics and transaction-level consumption. This feature empowers users to understand execution costs, identify optimization opportunities, and manage gas expenses.
| Feature | Description |
|---|---|
| Network-Wide Gas Metrics | Displays gas consumption across all operations on the blockchain, categorized into multiple categories such as WASM, ZK circuits, signatures, and deployments. |
| Transaction-Level Analysis | Provides per-transaction gas usage details, allowing users to evaluate the efficiency and execution costs of individual transactions. |
The Explorer tracks gas consumption across the blockchain broken down by category. Below is an example of the Explorer’s network-wide gas tracking view.
Each category is outlined in the table below.
| Category | Description |
|---|---|
| Total Gas Usage | The cumulative amount of gas consumed across all blockchain transactions. |
| WASM Gas Usage | Tracks gas used by WASM-based smart contract execution. |
| ZK Circuit Gas Usage | Monitors gas usage related to Zero-Knowledge Proof execution. |
| Signature Gas Usage | Represents gas consumed for transaction signatures. |
| Deployment Gas Usage | Gas required for deploying contracts on the blockchain. |
For each of these categories, the Explorer provides the following metrics.
| Metric | Description |
|---|---|
| Average Gas Usage | The average gas spent per transaction across relevant operations. |
| Minimum Gas Usage | The smallest amount of gas recorded in any transaction. |
| Maximum Gas Usage | The highest gas value observed across transactions. |
The Explorer provides detailed data on gas consumption for individual transactions, helping users evaluate the cost and efficiency of specific operations. Below is an example of the gas consumption view for a specific transaction.
| Metric | Description |
|---|---|
| Total Gas Usage | The total gas consumed by all operations within the transaction. |
| WASM Gas | The gas used during WASM contract execution. |
| ZK Circuit Gas | Gas consumed for Zero-Knowledge Proof components in the transaction. |
| Signature Gas | Gas required for transaction signature verification. |
| Deployment Gas | Gas spent specifically on deploying smart contracts. |
This feature empowers users to:
The Explorer allows users to inspect native contracts deployed on the DarkFi blockchain by presenting their metadata and source code. This feature enhances transparency and facilitates a better understanding of native DarkFi contract behavior.
The Explorer presents users with an organized list of native contracts on the Explorer home page.
From the list of native contracts, users can navigate to view the individual source files associated with a specific contract.
Users can select source files from the list to view source code content.
This feature allows users to: