Skip to content

Commit

Permalink
Merge branch 'staging' into modify/datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
lpoli committed Jul 28, 2022
2 parents 104e32b + 145b0ea commit 29b68f4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-&-publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ jobs:
archive_results: true
run_flaky_tests: false
retry_failures: true
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}

- name: "Set PR status as ${{ job.status }}"
if: ${{ (success() || failure()) && steps.findPr.outputs.number }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/system_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ jobs:
DEV7KC: ${{ secrets.DEV7KC }}
DEV8KC: ${{ secrets.DEV8KC }}
DEV9KC: ${{ secrets.DEV9KC }}
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}
12 changes: 8 additions & 4 deletions code/go/0chain.net/blobber/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ func setupConfig(configDir string, deploymentMode int) {

transaction.MinConfirmation = config.Configuration.MinConfirmation

config.Configuration.Name = viper.GetString("name")
config.Configuration.WebsiteUrl = viper.GetString("website_url")
config.Configuration.LogoUrl = viper.GetString("logo_url")
config.Configuration.Description = viper.GetString("description")
config.Configuration.Name = viper.GetString("info.name")
config.Configuration.WebsiteUrl = viper.GetString("info.website_url")
config.Configuration.LogoUrl = viper.GetString("info.logo_url")
config.Configuration.Description = viper.GetString("info.description")

config.Configuration.Geolocation = config.GeolocationConfig{}
config.Configuration.Geolocation.Latitude = viper.GetFloat64("geolocation.latitude")
config.Configuration.Geolocation.Longitude = viper.GetFloat64("geolocation.longitude")

fmt.Print(" [OK]\n")
}
Expand Down
38 changes: 23 additions & 15 deletions code/go/0chain.net/validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func main() {
portString := flag.String("port", "", "port")
hostname := flag.String("hostname", "", "hostname")
configDir := flag.String("config_dir", "./config", "config_dir")
hostUrl := flag.String("hosturl", "", "register url on blockchain instead of [schema://hostname+port] if it has value")

flag.Parse()

Expand Down Expand Up @@ -76,20 +77,6 @@ func main() {
config.Configuration.NumDelegates = viper.GetInt("num_delegates")
config.Configuration.ServiceCharge = viper.GetFloat64("service_charge")

if *hostname == "" {
panic("Please specify --hostname which is the public hostname")
}

if *portString == "" {
panic("Please specify --port which is the port on which requests are accepted")
}

port, err := strconv.Atoi(*portString) //fmt.Sprintf(":%v", port) // node.Self.Port
if err != nil {
Logger.Panic("Port specified is not Int " + *portString)
return
}

//address := publicIP + ":" + portString
address := ":" + *portString

Expand All @@ -110,7 +97,28 @@ func main() {
publicKey, privateKey, _, _ := encryption.ReadKeys(reader)
reader.Close()
node.Self.SetKeys(publicKey, privateKey)
node.Self.SetHostURL("http", *hostname, port)

if len(*hostUrl) > 0 {
node.Self.URL = *hostUrl
} else {

if *hostname == "" {
panic("Please specify --hostname which is the public hostname")
}

if *portString == "" {
panic("Please specify --port which is the port on which requests are accepted")
}

port, err := strconv.Atoi(*portString) //fmt.Sprintf(":%v", port) // node.Self.Port
if err != nil {
Logger.Panic("Port specified is not Int " + *portString)
return
}

node.Self.SetHostURL("http", *hostname, port)
}

Logger.Info(" Base URL" + node.Self.GetURLBase())

config.SetServerChainID(config.Configuration.ChainID)
Expand Down

0 comments on commit 29b68f4

Please sign in to comment.