Merge pull request #90 from filecoin-project/hook-up-miner-rpc-apis

export both apis for miners
This commit is contained in:
Anton Evangelatov 2020-07-02 14:20:10 +02:00 committed by GitHub
commit b601fd12f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 3 deletions

View File

@ -15,6 +15,9 @@
go_proxy_url="http://localhost:8081"
registry_type="aws"
[global.run_config]
exposed_ports = ["6060", "1234", "2345"]
[global.run.test_params]
clients = "10"
miners = "3"

View File

@ -15,6 +15,9 @@
go_proxy_url="http://localhost:8081"
registry_type="aws"
[global.run_config]
exposed_ports = ["6060", "1234", "2345"]
[global.run.test_params]
clients = "3"
miners = "1"

View File

@ -15,6 +15,9 @@
go_proxy_url="http://localhost:8081"
registry_type="aws"
[global.run_config]
exposed_ports = ["6060", "1234", "2345"]
[global.run.test_params]
clients = "3"
miners = "2"

View File

@ -15,6 +15,9 @@
go_proxy_url="http://localhost:8081"
registry_type="aws"
[global.run_config]
exposed_ports = ["6060", "1234", "2345"]
[global.run.test_params]
clients = "1"
miners = "1"

View File

@ -12,6 +12,9 @@
[global.build_config]
enable_go_build_cache = true
[global.run_config]
exposed_ports = ["6060", "1234", "2345"]
[global.build]
selectors = ["testground"]

View File

@ -42,6 +42,7 @@ instances = { min = 1, max = 100, default = 5 }
# Params relevant to pubsub tracing
enable_pubsub_tracer = { type = "bool", default = false }
mining_mode = { type = "enum", default = "synchronized", options = ["synchronized", "natural"] }
[[testcases]]
name = "drand-halting"

View File

@ -170,6 +170,7 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
node.Online(),
node.Repo(nodeRepo),
withGenesis(genesisMsg.Genesis),
withApiEndpoint("/ip4/127.0.0.1/tcp/1234"),
withListenAddress(minerIP),
withBootstrapper(genesisMsg.Bootstrapper),
withPubsubConfig(false, pubsubTracer),
@ -191,7 +192,7 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
node.Online(),
node.Repo(minerRepo),
node.Override(new(api.FullNode), n.FullApi),
withApiEndpoint("/ip4/127.0.0.1/tcp/1234"),
withApiEndpoint("/ip4/127.0.0.1/tcp/2345"),
withMinerListenAddress(minerIP),
}
@ -282,7 +283,12 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
m := &LotusMiner{n, t}
err = m.startStorageMinerAPIServer(minerRepo, n.MinerApi)
err = startClientAPIServer(nodeRepo, n.FullApi)
if err != nil {
return nil, err
}
err = startStorageMinerAPIServer(minerRepo, n.MinerApi)
if err != nil {
return nil, err
}
@ -358,7 +364,7 @@ func (m *LotusMiner) RunDefault() error {
return nil
}
func (m *LotusMiner) startStorageMinerAPIServer(repo *repo.MemRepo, minerApi api.StorageMiner) error {
func startStorageMinerAPIServer(repo *repo.MemRepo, minerApi api.StorageMiner) error {
mux := mux.NewRouter()
rpcServer := jsonrpc.NewServer()