pub struct LakeConfigBuilder { /* private fields */ }
Expand description

Builder for LakeConfig.

Implementations

AWS S3 Bucket name

AWS S3 Region name

Defines the block height to start indexing from

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");

Builds a new LakeConfig.

Errors

If a required field has not been initialized.

Shortcut to set up LakeConfigBuilder::s3_bucket_name for mainnet

use near_lake_framework::LakeConfigBuilder;

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

Shortcut to set up LakeConfigBuilder::s3_bucket_name for testnet

use near_lake_framework::LakeConfigBuilder;

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

Trait Implementations

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