File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ import (
2222)
2323
2424type CosmosApp struct {
25- binaryPath string
26- isCosmovisor bool
27- homePath string
28- chainRest string
25+ binaryPath string
26+ isCosmovisor bool
27+ isStoryProtocol bool
28+ homePath string
29+ chainRest string
2930
3031 cmd * exec.Cmd
3132
@@ -86,6 +87,10 @@ func (app *CosmosApp) IsCosmovisor() bool {
8687 return app .isCosmovisor
8788}
8889
90+ func (app * CosmosApp ) IsStoryProtocol () bool {
91+ return app .isStoryProtocol
92+ }
93+
8994func (app * CosmosApp ) IsReset () bool {
9095 return app .ConsensusEngine .GetHeight () == 0
9196}
@@ -378,6 +383,7 @@ func (app *CosmosApp) LoadBinaryPath() error {
378383
379384 app .binaryPath = binaryPath
380385 app .isCosmovisor = strings .HasSuffix (binaryPath , "cosmovisor" )
386+ app .isStoryProtocol = strings .HasSuffix (binaryPath , "storyd" )
381387
382388 logger .Logger .Info ().Msgf ("loaded cosmos app at path \" %s\" from app binary" , binaryPath )
383389 return nil
@@ -461,6 +467,16 @@ func (app *CosmosApp) LoadConsensusEngine() error {
461467 }
462468 }
463469
470+ if app .isStoryProtocol {
471+ engine , err := cometbft_v38 .NewEngine (app .homePath )
472+ if err != nil {
473+ return fmt .Errorf ("failed to create engine: %w" , err )
474+ }
475+
476+ app .ConsensusEngine = engine
477+ return nil
478+ }
479+
464480 // we first try to detect the engine by checking the build dependencies
465481 // in the "version --long" command. If we don't find anything there we check
466482 // the "tendermint version" command. We prefer to detect it with the build
You can’t perform that action at this time.
0 commit comments