Skip to content

Commit

Permalink
Merge pull request #90 from filecoin-project/hook-up-miner-rpc-apis
Browse files Browse the repository at this point in the history
export both apis for miners
  • Loading branch information
nonsense authored Jul 2, 2020
2 parents 6d0c0b4 + 740741b commit b601fd1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lotus-soup/compositions/composition-k8s-10-3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions lotus-soup/compositions/composition-k8s-3-1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions lotus-soup/compositions/composition-k8s-3-2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions lotus-soup/compositions/composition-k8s.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions lotus-soup/compositions/composition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
[global.build_config]
enable_go_build_cache = true

[global.run_config]
exposed_ports = ["6060", "1234", "2345"]

[global.build]
selectors = ["testground"]

Expand Down
1 change: 1 addition & 0 deletions lotus-soup/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 9 additions & 3 deletions lotus-soup/testkit/role_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b601fd1

Please sign in to comment.