From d29f0feb6a43611264d8b8cfdf49fb6fbeefc74b Mon Sep 17 00:00:00 2001 From: Himitsuko Date: Mon, 28 Nov 2022 23:01:54 +0700 Subject: [PATCH] add: README.md --- .local/main.go | 32 -------------------------------- README.md | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 32 deletions(-) delete mode 100644 .local/main.go create mode 100644 README.md diff --git a/.local/main.go b/.local/main.go deleted file mode 100644 index 50468a0..0000000 --- a/.local/main.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "fmt" - "github.com/depocket/near-lake-framework-go/core" -) - -func main() { - config := core.DefaultLakeConfigBuilder(). - Mainnet().SetStartBlockHeight(79075963).SetBlocksPreloadPoolSize(100).Build() - channel := core.Streamer(*config) - for { - select { - case message := <-channel: - fmt.Println(message.Shards[0].Chunk.Receipts) - } - } - //s3Fetcher := core.S3Fetcher{} - //awsSession, _ := session.NewSession(&aws.Config{ - // Region: aws.String("eu-central-1"), - //}) - //objects, err := s3Fetcher.ListBlocks(s3.New(awsSession), "near-lake-data-mainnet", 79075963, 100) - //if err != nil { - // fmt.Println(err) - //} - //fmt.Println(objects[0]) - //result, err := s3Fetcher.FetchStreamerMessage(s3.New(awsSession), "near-lake-data-mainnet", objects[0]) - //if err != nil { - // return - //} - //fmt.Println(result) -} diff --git a/README.md b/README.md new file mode 100644 index 0000000..433ab70 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Near lake framework on Golang +## How to install +``` +go get github.com/depocket/near-lake-framework-go +``` + +## How to use +```golang +config := core.DefaultLakeConfigBuilder(). + Mainnet(). + SetStartBlockHeight(79075963). + SetBlocksPreloadPoolSize(100). + Build() +channel := core.Streamer(*config) +for { + select { + case message := <-channel: + fmt.Println(message.Shards[0].Chunk.Receipts) + } +} +``` \ No newline at end of file