generated from rollkit/template-da-repo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add Execute interface * chore: add proto * feat: add grpc proxy and mocks * fix: go module path * feat: grpc proxy * feat: json rpc proxy * chore: change github org name * chore: change pkg path in mockery.yaml * chore: change go_package in execution.proto * chore: clean up proto * chore: remove rollkit as a dependency
- Loading branch information
Showing
27 changed files
with
3,837 additions
and
14 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,8 @@ | ||
with-expecter: true | ||
packages: | ||
github.com/rollkit/go-execution: | ||
interfaces: | ||
Execute: | ||
config: | ||
dir: mocks | ||
outpkg: mocks |
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
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,16 @@ | ||
version: v1beta1 | ||
|
||
# The plugins to run. | ||
plugins: | ||
# The name of the plugin. | ||
- name: | ||
gocosmos | ||
# The the relative output directory. | ||
out: types/pb | ||
# Any options to provide to the plugin. | ||
opt: | ||
- Mgoogle/protobuf/timestamp.proto=github.com/cosmos/gogoproto/types | ||
- Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration | ||
- Mgoogle/protobuf/wrappers.proto=github.com/cosmos/gogoproto/types | ||
- plugins=grpc | ||
- paths=source_relative |
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 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: cosmos | ||
repository: gogo-proto | ||
commit: 88ef6483f90f478fb938c37dde52ece3 | ||
digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba |
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,26 @@ | ||
version: v1beta1 | ||
deps: | ||
- buf.build/cosmos/gogo-proto | ||
build: | ||
roots: | ||
- proto | ||
lint: | ||
use: | ||
- STANDARD | ||
- COMMENTS | ||
- FILE_LOWER_SNAKE_CASE | ||
except: | ||
- COMMENT_ENUM | ||
- COMMENT_ENUM_VALUE | ||
- COMMENT_MESSAGE | ||
- COMMENT_RPC | ||
- COMMENT_SERVICE | ||
- COMMENT_FIELD | ||
- PACKAGE_VERSION_SUFFIX | ||
- RPC_REQUEST_STANDARD_NAME | ||
- SERVICE_SUFFIX | ||
- UNARY_RPC | ||
ignore: | ||
breaking: | ||
use: | ||
- FILE |
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,41 @@ | ||
package execution | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/rollkit/go-execution/types" | ||
) | ||
|
||
// Execute defines a common interface for interacting with the execution client. | ||
type Execute interface { | ||
// InitChain initializes the blockchain with genesis information. | ||
InitChain( | ||
genesisTime time.Time, | ||
initialHeight uint64, | ||
chainID string, | ||
) ( | ||
stateRoot types.Hash, | ||
maxBytes uint64, | ||
err error, | ||
) | ||
|
||
// GetTxs retrieves all available transactions from the execution client's mempool. | ||
GetTxs() ([]types.Tx, error) | ||
|
||
// ExecuteTxs executes a set of transactions to produce a new block header. | ||
ExecuteTxs( | ||
txs []types.Tx, | ||
blockHeight uint64, | ||
timestamp time.Time, | ||
prevStateRoot types.Hash, | ||
) ( | ||
updatedStateRoot types.Hash, | ||
maxBytes uint64, | ||
err error, | ||
) | ||
|
||
// SetFinal marks a block at the given height as final. | ||
SetFinal( | ||
blockHeight uint64, | ||
) 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 |
---|---|---|
@@ -1,3 +1,59 @@ | ||
module github.com/rollkit/template-da-repo | ||
module github.com/rollkit/go-execution | ||
|
||
go 1.21.0 | ||
go 1.22 | ||
|
||
toolchain go1.22.4 | ||
|
||
require ( | ||
github.com/celestiaorg/go-header v0.6.2 | ||
github.com/cosmos/gogoproto v1.5.0 | ||
github.com/stretchr/testify v1.9.0 | ||
google.golang.org/grpc v1.65.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/gorilla/websocket v1.5.3 // indirect | ||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect | ||
github.com/ipfs/go-cid v0.4.1 // indirect | ||
github.com/ipfs/go-log/v2 v2.5.1 // indirect | ||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect | ||
github.com/kr/pretty v0.3.1 // indirect | ||
github.com/libp2p/go-buffer-pool v0.1.0 // indirect | ||
github.com/libp2p/go-libp2p v0.35.0 // indirect | ||
github.com/libp2p/go-libp2p-pubsub v0.11.0 // indirect | ||
github.com/libp2p/go-msgio v0.3.0 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/minio/sha256-simd v1.0.1 // indirect | ||
github.com/mr-tron/base58 v1.2.0 // indirect | ||
github.com/multiformats/go-base32 v0.1.0 // indirect | ||
github.com/multiformats/go-base36 v0.2.0 // indirect | ||
github.com/multiformats/go-multiaddr v0.13.0 // indirect | ||
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect | ||
github.com/multiformats/go-multibase v0.2.0 // indirect | ||
github.com/multiformats/go-multicodec v0.9.0 // indirect | ||
github.com/multiformats/go-multihash v0.2.3 // indirect | ||
github.com/multiformats/go-multistream v0.5.0 // indirect | ||
github.com/multiformats/go-varint v0.0.7 // indirect | ||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
github.com/rogpeppe/go-internal v1.11.0 // indirect | ||
github.com/spaolacci/murmur3 v1.1.0 // indirect | ||
github.com/stretchr/objx v0.5.2 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.27.0 // indirect | ||
golang.org/x/crypto v0.25.0 // indirect | ||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect | ||
golang.org/x/net v0.27.0 // indirect | ||
golang.org/x/sys v0.22.0 // indirect | ||
golang.org/x/text v0.16.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect | ||
google.golang.org/protobuf v1.34.2 // indirect | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
lukechampine.com/blake3 v1.2.1 // indirect | ||
) | ||
|
||
// Add other dependencies as needed |
Oops, something went wrong.