Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fastnear as an alternative provider of NEAR blockchain data #109

Draft
wants to merge 6 commits into
base: 0.7.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/near/near-lake-framework/compare/v0.7.9...HEAD)
## [Unreleased](https://github.com/near/near-lake-framework/compare/v0.7.10...HEAD)

## [0.7.10](https://github.com/near/near-lake-framework/compare/v0.7.9...0.7.10)

* Upgrade `near-indexer-primitives` to `0.27.0` (nearcore-2.3.0)
* Added new provider `fastnear` - a new way to get the data from NEAR Protocol. It is a separate service that provides the data in a more efficient way. Check the [FastNear](https://fastnear.com/) provider for more details.

### Breaking Change

* `s3_fetchers` rename to `fetchers` and move to the `providers` module. New usage example:
```rust
use near_lake_framework::providers::s3::fetchers::fetch_streamer_message;
use near_lake_framework::providers::fastnear::fetchers::fetch_streamer_message;
```
* `s3_client` rename to `client` and move to the `providers` module. New usage example:
```rust
use near_lake_framework::providers::s3::client::S3Client;
use near_lake_framework::providers::fastnear::client::FastNearClient;
```

## [0.7.9](https://github.com/near/near-lake-framework/compare/v0.7.7...0.7.9)

Expand Down
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories = ["asynchronous", "api-bindings", "network-programming"]
keywords = ["near", "near-lake", "near-indexer"]
authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2021"
rust-version = "1.75.0"
rust-version = "1.79.0"

# cargo-workspaces
[workspace.metadata.workspaces]
Expand All @@ -25,14 +25,18 @@ async-stream = "0.3.5"
async-trait = "0.1.77"
derive_builder = "0.13.0"
futures = "0.3.30"
reqwest = { version = "0.12.7", features = ["json"] }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
thiserror = "1.0.56"
tokio = { version = "1.35.1", features = ["sync", "time", "rt", "macros"] }
tokio-stream = { version = "0.1.14" }
tracing = "0.1.40"

near-indexer-primitives = "0.23.0"
# Bug with deserialization of the transactions it should be fixed in the next release 0.27.0
# near-indexer-primitives = "0.26.0"
# for now we use the forked version
near-indexer-primitives = { git = 'https://github.com/kobayurii/nearcore.git', branch = "2.2.1-fork1" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: this is the blocker from merging this change into the 0.7.x branch and releasing a new version


[lib]
doctest = false
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,41 @@ $5.7 + $14.1 = $19.8

The price depends on the number of shards

## FastNear provider

FastNear provides a service to access the NEAR Protocol data

- [FastNear](https://fastnear.com/)

FastNear provider is a new way to get the data from NEAR Protocol. It is a separate service that provides the data in a more efficient way.

### How to use it:

```rust
use futures::StreamExt;
use near_lake_framework::FastNearConfigBuilder;

#[tokio::main]
async fn main() {

let config = FastNearConfigBuilder::default()
.testnet()
.start_block_height(82422587)
.build()
.expect("Failed to build LakeConfig");

let (_, stream) = near_lake_framework::streamer(config);

while let Some(streamer_message) = stream.recv().await {
eprintln!("{:#?}", streamer_message);
}
}
```
### How to migrate from Lake to FastNear:

- Replace `LakeConfigBuilder` with `FastNearConfigBuilder`
- Replace `LakeConfig` with `FastNearConfig`

## Future plans

We use Milestones with clearly defined acceptance criteria:
Expand Down
Loading
Loading