Skip to content

Commit

Permalink
fix(eibc): eibc existing roller config (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Nov 20, 2024
1 parent 25d0dd6 commit 77f3bf5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
5 changes: 3 additions & 2 deletions cmd/eibc/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func Cmd() *cobra.Command {

var runForExisting bool
var raID string
rollerConfigFilePath := filepath.Join(home, consts.RollerConfigFileName)
rollerConfigFilePath := filepath.Join(roller.GetRootDir(), consts.RollerConfigFileName)
var rollerData roller.RollappConfig

_, err = os.Stat(rollerConfigFilePath)
Expand All @@ -321,7 +321,8 @@ func Cmd() *cobra.Command {
if rollerRaID != "" {
msg := fmt.Sprintf(
"the retrieved RollApp ID is: %s, would you like to initialize the eibc client for this RollApp?",
rollerRaID,
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprint(rollerRaID),
)
rlyFromRoller, _ = pterm.DefaultInteractiveConfirm.WithDefaultText(msg).Show()
if rlyFromRoller {
Expand Down
2 changes: 1 addition & 1 deletion cmd/eibc/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Cmd() *cobra.Command {
c := eibcutils.GetStartCmd()
err = bash.ExecCmdFollow(c, nil)
if err != nil {
pterm.Error.Println("failed to create mongodb container:", err)
pterm.Error.Println("failed to start the eibc client:", err)
return
}
},
Expand Down
19 changes: 8 additions & 11 deletions utils/eibc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ type Config struct {
NodeAddress string `yaml:"node_address"`

OperatorConfig operatorConfig `yaml:"operator"`
OrderPolling OrderPollingConfig `yaml:"order_polling"`
Rollapps map[string]RollappConfig `yaml:"rollapps"`
OrderPolling orderPollingConfig `yaml:"order_polling"`
Rollapps map[string]rollappConfig `yaml:"rollapps"`

SlackConfig slackConfig `yaml:"slack"`
Validation validationConfig `yaml:"validation"`
}

type OrderPollingConfig struct {
type orderPollingConfig struct {
IndexerURL string `yaml:"indexer_url"`
Interval time.Duration `yaml:"interval"`
Enabled bool `yaml:"enabled"`
}

type RollappConfig struct {
type rollappConfig struct {
FullNodes []string `yaml:"full_nodes"`
MinConfirmations string `yaml:"min_confirmations"`
}

type GasConfig struct {
Prices string `yaml:"prices"`
Fees string `yaml:"fees"`
}

type fulfillerConfig struct {
Expand All @@ -53,12 +53,9 @@ type operatorConfig struct {
}

type validationConfig struct {
FallbackLevel string `yaml:"fallback_level"`
ValidationWaitTime string `yaml:"validation_wait_time"`
}

type fulfillCriteria struct {
MinFeePercentage minFeePercentage `yaml:"min_fee_percentage"`
FallbackLevel string `yaml:"fallback_level"`
WaitTime string `yaml:"wait_time"`
Interval string `yaml:"wait_time"`
}

type minFeePercentage struct {
Expand Down

0 comments on commit 77f3bf5

Please sign in to comment.