### Install go-execution-abci Source: https://github.com/evstack/ev-abci/blob/main/README.md Installs the go-execution-abci library using the Go package manager. This command fetches the latest version of the library and makes it available for use in your Go projects. ```bash go get github.com/rollkit/go-execution-abci ``` -------------------------------- ### Integrate go-execution-abci into Cosmos SDK Chain Source: https://github.com/evstack/ev-abci/blob/main/README.md This diff shows how to integrate the go-execution-abci server into a Cosmos SDK chain's command-line interface. It modifies the initialization of the root command to include ABCI server flags and a custom start command handler, enabling the ABCI adapter to run with the chain. ```diff diff --git a/cmd/gmd/cmd/commands.go b/cmd/gmd/cmd/commands.go index 310b195..19abe36 100644 --- a/cmd/gmd/cmd/commands.go +++ b/cmd/gmd/cmd/commands.go @@ -2,6 +2,7 @@ package cmd import ( "errors" + "gm/app" "io" "github.com/spf13/cobra" @@ -24,7 +25,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "gm/app" + abciserver "github.com/rollkit/go-execution-abci/server" + rollconf "github.com/rollkit/rollkit/pkg/config" ) func initRootCmd( @@ -32,8 +34,18 @@ func initRootCmd( txConfig client.TxConfig, basicManager module.BasicManager, ) { + + gensisCmd := genutilcli.InitCmd(basicManager, app.DefaultNodeHome) + rollconf.AddFlags(genesisCmd) + genesisCmdRunE := genesisCmd.RunE + genesisCmd.RunE = func(cmd *cobra.Command, args []string) error { + if err := genesisCmdRunE(cmd, args); err != nil { + return err + } + return abciserver.InitRunE(cmd, args) + } + rootCmd.AddCommand( - genutilcli.InitCmd(basicManager, app.DefaultNodeHome), + genesisCmd, NewInPlaceTestnetCmd(), NewTestnetMultiNodeCmd(basicManager, banktypes.GenesisBalancesIterator{}), debug.Cmd(), @@ -43,7 +55,10 @@ func initRootCmd( ) server.AddCommandsWithStartCmdOptions(rootCmd, app.DefaultNodeHome, newApp, appExport, server.StartCmdOptions{ - AddFlags: addModuleInitFlags, + AddFlags: func(cmd *cobra.Command) { + abciserver.AddFlags(cmd) + }, + StartCommandHandler: abciserver.StartHandler(), }) ``` -------------------------------- ### Build and Test Commands Source: https://github.com/evstack/ev-abci/blob/main/README.md Provides essential commands for setting up dependencies, running tests, and generating protocol buffer code required for development. ```Bash # Install dependencies make deps # Run tests make test # Generate protocol buffer code (for modules) make proto-gen ``` -------------------------------- ### System Architecture Diagram Source: https://github.com/evstack/ev-abci/blob/main/README.md Visualizes the relationships and components of the ev-abci system, including the Adapter, Executor interface, ABCI interface, Mempool, and Store. ```Mermaid classDiagram class Adapter { +App ABCI +Store Store +Mempool Mempool +P2PClient Client +TxGossiper Gossiper +InitChain() +ExecuteTxs() +GetTxs() +SetFinal() } class Executor { <> +InitChain() +ExecuteTxs() +GetTxs() +SetFinal() } class ABCI { <> +InitChain() +PrepareProposal() +ProcessProposal() +FinalizeBlock() +Commit() } class Mempool { +CheckTx() +ReapMaxBytesMaxGas() } class Store { +Get() +Set() +Height() } Executor <|.. Adapter : implements Adapter o-- ABCI : uses Adapter o-- Mempool : uses Adapter o-- Store : uses ``` -------------------------------- ### Transaction Flow Diagram Source: https://github.com/evstack/ev-abci/blob/main/README.md Illustrates the sequence of operations for transaction submission and processing through the system components, from client submission to ABCI app finalization. ```Mermaid sequenceDiagram participant Client participant P2P Network participant Mempool participant Adapter participant ABCI App Client->>P2P Network: Submit Tx P2P Network->>Mempool: Gossip Tx Mempool->>Adapter: CheckTx Adapter->>ABCI App: CheckTx ABCI App-->>Adapter: Response Note over Adapter: Block Creation Time Adapter->>Adapter: GetTxs Adapter->>ABCI App: PrepareProposal ABCI App-->>Adapter: Txs Note over Adapter: Block Execution Adapter->>ABCI App: ProcessProposal ABCI App-->>Adapter: Accept/Reject Adapter->>ABCI App: FinalizeBlock ABCI App-->>Adapter: AppHash Adapter->>ABCI App: Commit ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.