Merge pull request #90 from filecoin-project/hook-up-miner-rpc-apis
export both apis for miners
This commit is contained in:
commit
b601fd12f7
@ -15,6 +15,9 @@
|
|||||||
go_proxy_url="http://localhost:8081"
|
go_proxy_url="http://localhost:8081"
|
||||||
registry_type="aws"
|
registry_type="aws"
|
||||||
|
|
||||||
|
[global.run_config]
|
||||||
|
exposed_ports = ["6060", "1234", "2345"]
|
||||||
|
|
||||||
[global.run.test_params]
|
[global.run.test_params]
|
||||||
clients = "10"
|
clients = "10"
|
||||||
miners = "3"
|
miners = "3"
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
go_proxy_url="http://localhost:8081"
|
go_proxy_url="http://localhost:8081"
|
||||||
registry_type="aws"
|
registry_type="aws"
|
||||||
|
|
||||||
|
[global.run_config]
|
||||||
|
exposed_ports = ["6060", "1234", "2345"]
|
||||||
|
|
||||||
[global.run.test_params]
|
[global.run.test_params]
|
||||||
clients = "3"
|
clients = "3"
|
||||||
miners = "1"
|
miners = "1"
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
go_proxy_url="http://localhost:8081"
|
go_proxy_url="http://localhost:8081"
|
||||||
registry_type="aws"
|
registry_type="aws"
|
||||||
|
|
||||||
|
[global.run_config]
|
||||||
|
exposed_ports = ["6060", "1234", "2345"]
|
||||||
|
|
||||||
[global.run.test_params]
|
[global.run.test_params]
|
||||||
clients = "3"
|
clients = "3"
|
||||||
miners = "2"
|
miners = "2"
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
go_proxy_url="http://localhost:8081"
|
go_proxy_url="http://localhost:8081"
|
||||||
registry_type="aws"
|
registry_type="aws"
|
||||||
|
|
||||||
|
[global.run_config]
|
||||||
|
exposed_ports = ["6060", "1234", "2345"]
|
||||||
|
|
||||||
[global.run.test_params]
|
[global.run.test_params]
|
||||||
clients = "1"
|
clients = "1"
|
||||||
miners = "1"
|
miners = "1"
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
[global.build_config]
|
[global.build_config]
|
||||||
enable_go_build_cache = true
|
enable_go_build_cache = true
|
||||||
|
|
||||||
|
[global.run_config]
|
||||||
|
exposed_ports = ["6060", "1234", "2345"]
|
||||||
|
|
||||||
[global.build]
|
[global.build]
|
||||||
selectors = ["testground"]
|
selectors = ["testground"]
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ instances = { min = 1, max = 100, default = 5 }
|
|||||||
|
|
||||||
# Params relevant to pubsub tracing
|
# Params relevant to pubsub tracing
|
||||||
enable_pubsub_tracer = { type = "bool", default = false }
|
enable_pubsub_tracer = { type = "bool", default = false }
|
||||||
|
mining_mode = { type = "enum", default = "synchronized", options = ["synchronized", "natural"] }
|
||||||
|
|
||||||
[[testcases]]
|
[[testcases]]
|
||||||
name = "drand-halting"
|
name = "drand-halting"
|
||||||
|
@ -170,6 +170,7 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
|
|||||||
node.Online(),
|
node.Online(),
|
||||||
node.Repo(nodeRepo),
|
node.Repo(nodeRepo),
|
||||||
withGenesis(genesisMsg.Genesis),
|
withGenesis(genesisMsg.Genesis),
|
||||||
|
withApiEndpoint("/ip4/127.0.0.1/tcp/1234"),
|
||||||
withListenAddress(minerIP),
|
withListenAddress(minerIP),
|
||||||
withBootstrapper(genesisMsg.Bootstrapper),
|
withBootstrapper(genesisMsg.Bootstrapper),
|
||||||
withPubsubConfig(false, pubsubTracer),
|
withPubsubConfig(false, pubsubTracer),
|
||||||
@ -191,7 +192,7 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
|
|||||||
node.Online(),
|
node.Online(),
|
||||||
node.Repo(minerRepo),
|
node.Repo(minerRepo),
|
||||||
node.Override(new(api.FullNode), n.FullApi),
|
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),
|
withMinerListenAddress(minerIP),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +283,12 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
|
|||||||
|
|
||||||
m := &LotusMiner{n, t}
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -358,7 +364,7 @@ func (m *LotusMiner) RunDefault() error {
|
|||||||
return nil
|
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()
|
mux := mux.NewRouter()
|
||||||
|
|
||||||
rpcServer := jsonrpc.NewServer()
|
rpcServer := jsonrpc.NewServer()
|
||||||
|
Loading…
Reference in New Issue
Block a user