Skip to content

coherentdevs/evm-etl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM-ETL

EVM-ETL is a robust and high-performance library for executing ETL (Extract, Transform, Load) processes on EVM (Ethereum Virtual Machine) compatible blockchains. This library is designed to make ETL processes more efficient by providing ready-to-use drivers for each chain, such as Ethereum, located in the /drivers directory.

Installation

To install EVM-ETL, make sure you have Go installed on your machine. Then, run:

go get github.com/coherentdevs/evm-etl

Usage

After installation, you can use EVM-ETL by importing it in your Go project. Each chain has its own driver located in the /drivers directory. You can instantiate the desired driver and pass it into your service. Here's an example for initializing an Ethereum driver and passing it into a polling service:

package main

import (
	"github.com/coherentdevs/evm-etl/drivers/ethereum"
	"github.com/coherentdevs/chain-interactor/client/node"
	"github.com/coherentdevs/evm-etl/shared/storage"
	"github.com/coherentdevs/go-service-framework/util"
)

func mustInitEthereumDriver(
	node node.Client,
	store storage.Store,
	logger util.Logger,
) *ethereum.EthereumDriver {
	return ethereum.New(
		ethereum.MustParseConfig(logger),
		node,
		store,
		logger,
	)
}

Then, in your main function:

package main

import (
	"github.com/coherentdevs/evm-etl/drivers/ethereum"
	// ... other imports ...
)

func main() {
	// ... other setups ...

	driver := chains.MustInitializeDriver(cfg.Poller.Blockchain, nodeClient, gcsClient, mgr.Logger())

	p := poller.New(
		&cfg.Poller,
		driver,
		// ... other setups ...
	)

	// ... other setups ...
}