Skip to content

Commit

Permalink
doc: refine the block hub doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Aug 8, 2024
1 parent 90817ec commit 55c026e
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 106 deletions.
56 changes: 0 additions & 56 deletions docs/bnb-greenfield/for-developers/data-archive/block-archiver.md

This file was deleted.

58 changes: 58 additions & 0 deletions docs/bnb-greenfield/for-developers/data-archive/block-hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: BlockHub
description: Archive blocks on Greenfield
keywords: [ BNB Greenfield, NodeReal, Data Archive Layer, BlockHub ]
---

# BlockHub

BlockHub offers a lightweight, trustless, and decentralized method for accessing blockchain data. It provides a user experience
that is fully consistent with the original network's RPC and P2P access, eliminating the need for users to run full nodes or
rely on centralized data providers to fetch block data. Don't want to trust a third party provider to provide the block data?
Greenfield Blockhub is the answer. BlockHub is alive for BSC now.

Much like Blob Hub, which uses the Bundle Service to archive blobs into a single bundle, BlockHub leverages
the bundle service to combine a range of blocks into a single bundle. This approach optimizes storage usage, ensures cost-effectiveness,
and maintains data integrity and accessibility.

Note: Greenfield charges a fee for both storing and accessing objects. If the bucket owner's payment account lacks sufficient balance,
users will be unable to query data until the quota is refilled.

# How BlockHub Operates

The BlockHub comprises three main components:

- Block Indexer: This service continuously indexes blocks from the Blockchain and stores them in Greenfield. It ensures no block is missed and that each stored block is accurate.
- API Server: This component handles user requests for historical block data, providing seamless access to the stored blocks.
- Light Peers: It is a blockchain client that is backed by Greenfield storage but can serve in the P2P network. Refer to the [Light Peer](./light-peer.md) documentation for more details.

![BlockHub](../../static/asset/block-hub.png)

The indexing process ensures data integrity by running a post-verification process. This process scans all uploaded blocks,
conducts validation checks against data already stored in Greenfield, and detects any missing data.

# Who Needs to Access the BlockHub?

## Node Operators

Node operators requiring full sync from the genesis block need access to historical block data via the BlockHub.
Leveraging Greenfield's robust infrastructure, they can trust the integrity and availability of the stored data.

The Greenfield community has launched the `Greenfield Peer`, a data-seed solution for those who need to run BSC nodes in fullsync mode. For more details, check out this [page](./light-peer.md).

## Data Analysts and Researchers

BlockHub offers a valuable resource for data analysts and researchers who need comprehensive access to historical block
data. By leveraging BlockHub, they can collect reliable data for analysis, research, and development purposes.

# Accessing Block Data with BlockHub

BlockHub supports BSC now and its API is fully compatible with Ethereum API specifications, ensuring ease of integration for
developers. Detailed information about supported networks and endpoints can be found in [network and endpoints](../network-endpoint/endpoints.md#BlockHub). For more details
about the API spec, please refer to [BlockHub API](https://github.com/bnb-chain/greenfield-bsc-archiver/?tab=readme-ov-file#BlockHub-api)

# Try It Out

Adopting this innovative solution ensures the integrity, accessibility, and longevity of blockchain data, supporting a more
resilient and transparent digital ecosystem. Join the Greenfield community today and set a new standard for blockchain data
reliability and security.
42 changes: 0 additions & 42 deletions docs/bnb-greenfield/for-developers/data-archive/greenfield-peer.md

This file was deleted.

39 changes: 39 additions & 0 deletions docs/bnb-greenfield/for-developers/data-archive/light-peer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Light Peer, a BSC data-seed By Greenfield
keywords: [ BNB Greenfield, NodeReal, Data Archive Layer, Light Peer]
---

# Light Peer

With the launch of the [block-hub](./block-hub.md), BSC historical block data is now accessible on Greenfield.
For those operating BSC nodes in fullsync mode, connecting to the Light peer is a beneficial choice. The Light peer
fetches block data from Greenfield and supplies it to BSC nodes via the P2P network.

## How The Light Peer Works

The diagram below illustrates the functionality of the Light peer. While the Light peer does not participate in
other operations within the BSC network, it solely provides block data to BSC nodes. It does not persist any data on its own;
instead, when it receives requests (`GetBodies` and `GetHeaders`) from other BSC nodes, it fetches a bundle of blocks (# of blocks determined
by the Block Indexer) from Greenfield and caches them in memory. This ensures the Light peer delivers block data
to BSC nodes efficiently.

![light peer](../../static/asset/light-peer.png)

## How to interact with Light Peer

Utilizing the Light Peer is straightforward. Configure your BSC node to connect to the Light peer by adjusting the
settings in your configuration file.

Navigate to the P2P section of your BSC node configuration file and specify the enode info of the Light peer.

```toml
# other configurations are omitted
...
[Node.P2P]
MaxPeers = 1
NoDiscovery = true
TrustedNodes = []
StaticNodes=["enode://a2c586f41d2cc6dc7445e32922305e92b4de7daad718744d12bf105a79715606330535cffae6a0d60c61567ff772796d906fcb72b9cbb578f10de3221bb34015@13.115.90.65:30303?discport=0"]
...
```

11 changes: 7 additions & 4 deletions docs/bnb-greenfield/for-developers/network-endpoint/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ order: 3
- **BSC:**
- `https://gnfd-blobhub-bsc.bnbchain.org`

### Block Hub
- **BSC:** coming soon

Refer to the [Block-Hub documentation](../data-archive/block-hub.md) for more details.


## Testnet
### Greenfield Testnet (chain-id: greenfield_5600-1)
Expand Down Expand Up @@ -92,8 +97,6 @@ order: 3

For more details, you can refer to [here](network-info.md).

### Block Archiver
### Block Hub
- **BSC:**
- `https://gnfd-bsc-archiver-testnet.bnbchain.org`

By accessing the above endpoints, you can retrieve historical block data from the BSC network. For comprehensive information, please refer to the [Block-Archiver documentation](../data-archive/block-archiver.md).
- `https://gnfd-bsc-archiver-testnet.bnbchain.org`
Binary file removed docs/bnb-greenfield/static/asset/gnfd-peer.png
Binary file not shown.
Binary file added docs/bnb-greenfield/static/asset/light-peer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/bnb-smart-chain/developers/node_operators/full_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ Opting for **full** sync mode means your node will only need block headers and b
consider utilizing the `Greenfield Peer`.
This data seed, offered by Greenfield, allows for a more efficient synchronization.
Configure your BSC node to connect with the Greenfield Peer by modifying your configuration file settings.
For comprehensive instructions, see [Greenfield Peer](../../../bnb-greenfield/for-developers/data-archive/greenfield-peer.md).
Configure your BSC node to connect with the Greenfield Light Peer by modifying your configuration file settings.
For comprehensive instructions, see [Light Peer](../../../bnb-greenfield/for-developers/data-archive/light-peer.md).
## Local Private Network
Please refer to [BSC-Deploy Tools](https://github.com/bnb-chain/node-deploy) to setup a local private network.
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ nav:
- Data Archive Layer:
- Overview: ./bnb-greenfield/for-developers/data-archive/data-archive-layer.md
- Blob Hub: ./bnb-greenfield/for-developers/data-archive/blob-hub.md
- Block Archiver: ./bnb-greenfield/for-developers/data-archive/block-archiver.md
- Greenfield Peer: ./bnb-greenfield/for-developers/data-archive/greenfield-peer.md
- Block HUb: ./bnb-greenfield/for-developers/data-archive/block-hub.md
- Light Peer: ./bnb-greenfield/for-developers/data-archive/light-peer.md
- Tutorials:
- Overview: ./bnb-greenfield/for-developers/tutorials/overview.md
- Basic File Management with CLI: ./bnb-greenfield/for-developers/tutorials/file-management-overview.md
Expand Down

0 comments on commit 55c026e

Please sign in to comment.