Skip to content

Commit

Permalink
Merge pull request #1 from 0xPolygon/initial
Browse files Browse the repository at this point in the history
Folder scaffolding
  • Loading branch information
vcastellm authored May 29, 2024
2 parents 879e76e + 3223a98 commit 45509ce
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 0 deletions.
Empty file added aggregatormanager/.gitkeep
Empty file.
Empty file added build/docker-compose.yml
Empty file.
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main
Empty file added dataavailability/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/0xPolygon/cdk

go 1.22
Empty file added go.sum
Empty file.
Empty file added scripts/.gitkeep
Empty file.
Empty file added sequencermanager/.gitkeep
Empty file.
Empty file added sequencesender/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions syncer/ethprovider/ethprovider.go
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
}
9 changes: 9 additions & 0 deletions syncer/interfaces.go
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
}
1 change: 1 addition & 0 deletions syncer/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package syncer
8 changes: 8 additions & 0 deletions syncer/storage/inmem/inmem.go
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")
}
7 changes: 7 additions & 0 deletions syncer/storage/storage.go
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
}
23 changes: 23 additions & 0 deletions syncer/syncer.go
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 {
}
1 change: 1 addition & 0 deletions test/e2e.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package e2e

0 comments on commit 45509ce

Please sign in to comment.