diff --git a/internal/syncer/eventprocessor.go b/internal/syncer/eventprocessor.go deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/eventprocessor/processor.go b/pkg/eventprocessor/processor.go new file mode 100644 index 000000000..33b71026c --- /dev/null +++ b/pkg/eventprocessor/processor.go @@ -0,0 +1 @@ +package eventprocessor diff --git a/pkg/syncer/ethsyncer/ethsyncer.go b/pkg/syncer/ethsyncer/ethsyncer.go new file mode 100644 index 000000000..413d83b99 --- /dev/null +++ b/pkg/syncer/ethsyncer/ethsyncer.go @@ -0,0 +1,11 @@ +package ethsyncer + +import ( + "github.com/0xPolygon/cdk/pkg/dataavailability" + "github.com/0xPolygon/cdk/pkg/syncer/storage" +) + +type EthSyncer struct { + Storage storage.Storage + DataAvailability dataavailability.DataAvailability +} diff --git a/pkg/syncer/storage/storage.go b/pkg/syncer/storage/storage.go index 29e826c47..c485ecb64 100644 --- a/pkg/syncer/storage/storage.go +++ b/pkg/syncer/storage/storage.go @@ -1,6 +1,7 @@ -package syncer +package storage -type Storage interface { +// Storage is an interface for the storage of the syncer +type StorageService interface { GetData() []byte GetLatestVerifiedBlock() uint64 } diff --git a/pkg/syncer/syncer.go b/pkg/syncer/syncer.go index e69de29bb..fab1add8e 100644 --- a/pkg/syncer/syncer.go +++ b/pkg/syncer/syncer.go @@ -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 { +}