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

Merged
merged 8 commits into from
Nov 6, 2024
Merged
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/) and [Near Data Server](https://github.com/fastnear/neardata-server/) to get more details about provider.

### Breaking Change

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

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

Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ categories = ["asynchronous", "api-bindings", "network-programming"]
keywords = ["near", "near-lake", "near-indexer"]
authors = ["Near Inc <[email protected]>"]
edition = "2021"
rust-version = "1.75.0"
rust-version = "1.81.0"

# cargo-workspaces
[workspace.metadata.workspaces]
version = "0.7.9"
version = "0.7.10"

[dependencies]
anyhow = "1.0.79"
Expand All @@ -25,14 +25,15 @@ 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"
near-indexer-primitives = "0.27.0"

[lib]
doctest = false
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,42 @@ $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/)
- [Near Data Server](https://github.com/fastnear/neardata-server/)

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.
kobayurii marked this conversation as resolved.
Show resolved Hide resolved

### 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