Skip to content

Commit

Permalink
fix: icon port issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Dec 14, 2023
1 parent 11df5b5 commit 027ce79
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions cli/cmd/chains/utils/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,11 @@ func (sc *IconServiceConfig) LoadDefaultConfig() error {
sc.P2PAddress = "8080"
sc.Cid = "0xacbc4e"

if common.CheckPort(8090) {
sc.PublicPort = 8090
} else {
availablePort, err := common.GetAvailablePort()
if err != nil {
return err
}
sc.PublicPort = availablePort
availablePort, err := common.GetAvailablePort()
if err != nil {
return err
}
sc.PublicPort = availablePort

return nil

Expand Down Expand Up @@ -117,17 +113,11 @@ type HardhatServiceConfig struct {
}

func (sc *HardhatServiceConfig) LoadDefaultConfig() error {
sc.PublicPort = 8545
if common.CheckPort(8545) {
sc.PublicPort = 8545
} else {
availablePort, err := common.GetAvailablePort()
if err != nil {
return err
}
sc.PublicPort = availablePort
availablePort, err := common.GetAvailablePort()
if err != nil {
return err
}

sc.PublicPort = availablePort
return nil
}

Expand Down

0 comments on commit 027ce79

Please sign in to comment.