pub struct LakeConfig {
    pub s3_bucket_name: String,
    pub s3_region_name: String,
    pub start_block_height: u64,
    pub s3_config: Option<Config>,
}
Expand description

Configuration struct for NEAR Lake Framework NB! Consider using LakeConfigBuilder Building the LakeConfig example:

use near_lake_framework::LakeConfigBuilder;

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

Fields

s3_bucket_name: String

AWS S3 Bucket name

s3_region_name: String

AWS S3 Region name

start_block_height: u64

Defines the block height to start indexing from

s3_config: Option<Config>

Custom aws_sdk_s3::config::Config

Use-case: custom endpoint

You might want to stream data from the custom S3-compatible source () . In order to do that you’d need to pass aws_sdk_s3::config::Config configured

use aws_sdk_s3::Endpoint;
use http::Uri;
use near_lake_framework::LakeConfigBuilder;

    let aws_config = aws_config::from_env().load().await;
    let mut s3_conf = aws_sdk_s3::config::Builder::from(&aws_config);
    s3_conf = s3_conf
        .endpoint_resolver(
            Endpoint::immutable("http://0.0.0.0:9000".parse::<Uri>().unwrap()))
        .build();

    let config = LakeConfigBuilder::default()
        .s3_config(s3_conf)
        .s3_bucket_name("near-lake-data-custom")
        .start_block_height(1)
        .build()
        .expect("Failed to build LakeConfig");

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more