Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add trongrid ip #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func DefaultServicesConfig() Services {
SolidityDomain: "grpc.trongrid.io:50052",
FullnodeDomain: "grpc.trongrid.io:50051",
TrongridDomain: "https://api.trongrid.io",
TrongridIp: "http://13.127.47.162",
EscrowPubKeys: []string{"CAISIQPAfB2Mt2ic+n3JcL4vrKXxBCmB0iNh+5BYiXdJNWed/Q=="},
GuardPubKeys: []string{"CAISIQJ16EiwvGko4SaBEEUFyMdNZp1vKsTLgIXCY6fRa3/Obg=="},
}
Expand All @@ -231,6 +232,7 @@ func DefaultServicesConfigDev() Services {
SolidityDomain: "grpc.trongrid.io:50052",
FullnodeDomain: "grpc.trongrid.io:50051",
TrongridDomain: "https://api.shasta.trongrid.io",
TrongridIp: "http://13.127.47.162",
EscrowPubKeys: []string{"CAISIQJOcRK0q4TOwpswAkvMMq33ksQfhplEyhHcZnEUFbthQg=="},
GuardPubKeys: []string{"CAISIQJhPBQWKPPjYcuPWR9sl+QlN0wJSRbQs3yUKmggvubXwg=="},
}
Expand All @@ -247,6 +249,7 @@ func DefaultServicesConfigTestnet() Services {
SolidityDomain: "grpc.trongrid.io:50052",
FullnodeDomain: "grpc.trongrid.io:50051",
TrongridDomain: "https://api.shasta.trongrid.io",
TrongridIp: "http://13.127.47.162",
EscrowPubKeys: []string{"CAISIQJOcRK0q4TOwpswAkvMMq33ksQfhplEyhHcZnEUFbthQg=="},
GuardPubKeys: []string{"CAISIQJhPBQWKPPjYcuPWR9sl+QlN0wJSRbQs3yUKmggvubXwg=="},
}
Expand Down
10 changes: 10 additions & 0 deletions migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,15 @@ func migrate_16_TrongridDomain(cfg *Config) bool {
return false
}

func migrate_17_TrongridIp(cfg *Config) bool {
if len(cfg.Services.TrongridIp) == 0 {
ds := DefaultServicesConfig()
cfg.Services.TrongridIp = ds.TrongridIp
return true
}
return false
}

// MigrateConfig migrates config options to the latest known version
// It may correct incompatible configs as well
// inited = just initialized in the same call
Expand All @@ -266,5 +275,6 @@ func MigrateConfig(cfg *Config, inited, hasHval bool) bool {
updated = migrate_14_TestnetBootstrapNodes(cfg) || updated
updated = migrate_15_MissingRemoteAPI(cfg) || updated
updated = migrate_16_TrongridDomain(cfg) || updated
updated = migrate_17_TrongridIp(cfg) || updated
return updated
}
1 change: 1 addition & 0 deletions services.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Services struct {
SolidityDomain string
FullnodeDomain string
TrongridDomain string
TrongridIp string

EscrowPubKeys []string
GuardPubKeys []string
Expand Down