Skip to content

Commit

Permalink
Merge pull request #54 from TRON-US/fix-remoteapi
Browse files Browse the repository at this point in the history
BTFS-2405: Add missing RemoteAPI config
  • Loading branch information
Eric Chen authored Oct 6, 2020
2 parents b8fe6db + c34a8d2 commit 5c7c0cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func addressesConfig() Addresses {
NoAnnounce: []string{},
API: Strings{"/ip4/127.0.0.1/tcp/5001"},
Gateway: Strings{"/ip4/127.0.0.1/tcp/8080"},
RemoteAPI: Strings{"/ip4/127.0.0.1/tcp/5101"},
}
}

Expand Down
9 changes: 9 additions & 0 deletions migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ func migrate_14_TestnetBootstrapNodes(cfg *Config) bool {
return doMigrateNodes(cfg, obns, peers)
}

func migrate_15_MissingRemoteAPI(cfg *Config) bool {
if len(cfg.Addresses.RemoteAPI) == 0 {
cfg.Addresses.RemoteAPI = Strings{"/ip4/0.0.0.0/tcp/5101"}
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 @@ -239,5 +247,6 @@ func MigrateConfig(cfg *Config, inited, hasHval bool) bool {
updated = migrate_12_FullnodeDomain(cfg) || updated
updated = migrate_13_HostContractManager(cfg) || updated
updated = migrate_14_TestnetBootstrapNodes(cfg) || updated
updated = migrate_15_MissingRemoteAPI(cfg) || updated
return updated
}

0 comments on commit 5c7c0cc

Please sign in to comment.