mirror of
https://github.com/alexgo-io/gaze-indexer.git
synced 2026-04-29 12:15:13 +08:00
22
core/datasources/bitcoin_node.go
Normal file
22
core/datasources/bitcoin_node.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package datasources
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gaze-network/indexer-network/core/indexers"
|
||||
"github.com/gaze-network/indexer-network/core/types"
|
||||
)
|
||||
|
||||
// Make sure to implement the BitcoinDatasource interface
|
||||
var _ indexers.BitcoinDatasource = (*BitcoinNodeDatasource)(nil)
|
||||
|
||||
type BitcoinNodeDatasource struct{}
|
||||
|
||||
func (d *BitcoinNodeDatasource) Fetch(ctx context.Context, from, to int64) ([]*types.Block, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (d *BitcoinNodeDatasource) FetchAsync(ctx context.Context, from, to int64) (chan<- []*types.Block, func(), error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
return nil, cancel, nil
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/btcsuite/btcd/rpcclient"
|
||||
"github.com/cockroachdb/errors"
|
||||
"github.com/gaze-network/indexer-network/common/errs"
|
||||
"github.com/gaze-network/indexer-network/core"
|
||||
"github.com/gaze-network/indexer-network/core/types"
|
||||
"github.com/gaze-network/indexer-network/pkg/logger"
|
||||
)
|
||||
@@ -18,6 +19,9 @@ type (
|
||||
BitcoinDatasource Datasource[*types.Block]
|
||||
)
|
||||
|
||||
// Make sure to implement the IndexerWorker interface
|
||||
var _ core.IndexerWorker = (*BitcoinIndexer)(nil)
|
||||
|
||||
// BitcoinIndexer is the indexer for sync Bitcoin data to the database.
|
||||
type BitcoinIndexer struct {
|
||||
Processor BitcoinProcessor
|
||||
|
||||
Reference in New Issue
Block a user