-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/0xPolygon/cdk | ||
|
||
go 1.22 |
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ethsyncer | ||
|
||
import ( | ||
"github.com/0xPolygon/cdk/syncer/storage" | ||
) | ||
|
||
type EthSyncer struct { | ||
Storage storage.StorageService | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package syncer | ||
|
||
type EventSyncer interface { | ||
GetData() []byte | ||
} | ||
|
||
type EventProcessor interface { | ||
Process(data []byte) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package syncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package inmem | ||
|
||
type Inmem struct { | ||
} | ||
|
||
func (inmem *Inmem) GetData() []byte { | ||
return []byte("Inmem") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package storage | ||
|
||
// Storage is an interface for the storage of the syncer | ||
type StorageService interface { | ||
GetData() []byte | ||
GetLatestVerifiedBlock() uint64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package syncer | ||
|
||
type Syncer interface { | ||
// Start starts the syncer | ||
Start() error | ||
// Stop stops the syncer | ||
Stop() error | ||
// Synced returns true if the syncer is synced | ||
Synced() bool | ||
// SyncedChan returns a channel that is closed when the syncer is synced | ||
SyncedChan() <-chan struct{} | ||
// LatestVerifiedBlock returns the latest verified block | ||
LatestVerifiedBlock() uint64 | ||
// LatestBlock returns the latest block | ||
LatestBlock() uint64 | ||
// SyncedBlock returns the latest block that is synced | ||
SyncedBlock() uint64 | ||
// SyncedBlockChan returns a channel that is closed when the latest block is synced | ||
SyncedBlockChan() <-chan struct{} | ||
} | ||
|
||
type Sync struct { | ||
} |