Fix schema typo + config, dialyzer stuff, add some events
This commit is contained in:
parent
c57d89ba3d
commit
0dca4bfaf8
@ -1,6 +1,6 @@
|
||||
{application,gmhive_client,
|
||||
[{description,"Gajumaru Hive client"},
|
||||
{vsn,"0.1.4"},
|
||||
{vsn,"0.2.0"},
|
||||
{registered,[]},
|
||||
{applications,[kernel,stdlib,sasl,gproc,enoise,gmconfig,
|
||||
gmhive_protocol,gmhive_worker]},
|
||||
|
@ -2,10 +2,10 @@
|
||||
, pool_admin => #{url => <<"local">>}
|
||||
, pool => #{id => <<"ct_26xqeE3YKmZV8jrks57JSgZRCHSuG4RGzpnvdz6AAiSSTVbJRM">>,
|
||||
host => <<"127.0.0.1">>}
|
||||
, mining =>
|
||||
[#{executable => <<"mean15-generic">>}
|
||||
,#{executable => <<"mean15-generic">>}
|
||||
,#{executable => <<"mean15-generic">>}
|
||||
,#{executable => <<"mean15-generic">>}
|
||||
, workers =>
|
||||
[#{executable => <<"mean15-generic">>, <<"executable_group">> => <<"gmcuckoo">>}
|
||||
,#{executable => <<"mean15-generic">>, <<"executable_group">> => <<"gmcuckoo">>}
|
||||
,#{executable => <<"mean15-generic">>, <<"executable_group">> => <<"gmcuckoo">>}
|
||||
,#{executable => <<"mean15-generic">>, <<"executable_group">> => <<"gmcuckoo">>}
|
||||
]
|
||||
}.
|
||||
|
@ -9,7 +9,7 @@
|
||||
{enoise, {git, "https://git.qpq.swiss/QPQ-AG/enoise.git", {ref, "029292817e"}}},
|
||||
{gmhive_protocol,
|
||||
{git, "https://git.qpq.swiss/QPQ-AG/gmhive_protocol.git",
|
||||
{ref, "ea549141f5"}}},
|
||||
{ref, "818ce33"}}},
|
||||
{gmhive_worker, {git, "https://git.qpq.swiss/QPQ-AG/gmhive_worker", {ref, "708f1a6"}}},
|
||||
{gmconfig, {git, "https://git.qpq.swiss/QPQ-AG/gmconfig.git",
|
||||
{ref, "32c1ed5c4b"}}},
|
||||
@ -36,5 +36,5 @@
|
||||
|
||||
{dialyzer, [ {warnings, [unknown]}
|
||||
, {plt_apps, all_deps}
|
||||
, {base_plt_apps, [erts, kernel, stdlib]}
|
||||
, {base_plt_apps, [erts, kernel, stdlib, inets]}
|
||||
]}.
|
||||
|
@ -30,7 +30,7 @@
|
||||
1},
|
||||
{<<"gmhive_protocol">>,
|
||||
{git,"https://git.qpq.swiss/QPQ-AG/gmhive_protocol.git",
|
||||
{ref,"ea549141f5943b2b1b109a2653b8cd60778107c7"}},
|
||||
{ref,"818ce33cc1dec74c020515be48fb548a5207befd"}},
|
||||
0},
|
||||
{<<"gmhive_worker">>,
|
||||
{git,"https://git.qpq.swiss/QPQ-AG/gmhive_worker",
|
||||
|
@ -74,7 +74,7 @@ workers() ->
|
||||
"from faster CPU supporting AVX2 instructions).">>}),
|
||||
executable_group =>
|
||||
str(#{description => <<"Group of executable binaries of the worker.">>,
|
||||
enum => [ <<"aecuckoo">>, <<"aecuckooprebuilt">>, <<"gmcuckkoo">>, <<"cuda">>, <<"gajumine">> ],
|
||||
enum => [ <<"aecuckoo">>, <<"aecuckooprebuilt">>, <<"gmcuckoo">>, <<"cuda">>, <<"gajumine">> ],
|
||||
default => <<"aecuckoo">>}),
|
||||
extra_args =>
|
||||
str(#{description => <<"Extra arguments to pass to the worker executable binary. "
|
||||
|
@ -57,9 +57,9 @@ request(get, URL, []) ->
|
||||
HttpOpts = [{timeout, 15000}],
|
||||
Opts = [],
|
||||
Profile = default,
|
||||
request_result(httpc:request(get, {URL, Headers}, HttpOpts, Opts, Profile));
|
||||
request(post, URL, Body) ->
|
||||
post_request(URL, Body).
|
||||
request_result(httpc:request(get, {URL, Headers}, HttpOpts, Opts, Profile)).
|
||||
%% request(post, URL, Body) ->
|
||||
%% post_request(URL, Body).
|
||||
|
||||
expand_url(URL) ->
|
||||
case re:run(URL, <<"{[^}]+}">>, []) of
|
||||
@ -122,12 +122,12 @@ get_var_name(<<H, T/binary>>, Acc) ->
|
||||
|
||||
%% From gmplugin_web_demo_handler.erl ===================================
|
||||
|
||||
post_request(URL, Map) ->
|
||||
?LOG_DEBUG("Map = ~p", [Map]),
|
||||
Body = json:encode(Map),
|
||||
?LOG_DEBUG("Body = ~s", [Body]),
|
||||
PostRes = httpc:request(post, {URL, [], "application/json", Body}, [], []),
|
||||
request_result(PostRes).
|
||||
%% post_request(URL, Map) ->
|
||||
%% ?LOG_DEBUG("Map = ~p", [Map]),
|
||||
%% Body = json:encode(Map),
|
||||
%% ?LOG_DEBUG("Body = ~s", [Body]),
|
||||
%% PostRes = httpc:request(post, {URL, [], "application/json", Body}, [], []),
|
||||
%% request_result(PostRes).
|
||||
|
||||
%% ======================================================================
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
-type event() :: pool_notification
|
||||
| {pool_notification, atom()}
|
||||
| error
|
||||
| puzzle
|
||||
| result
|
||||
| connected
|
||||
| disconnected.
|
||||
|
||||
@ -61,6 +63,8 @@ debug() ->
|
||||
subscribe(pool_notification),
|
||||
subscribe({pool_notification, new_generation}),
|
||||
subscribe(connected),
|
||||
subscribe(puzzle),
|
||||
subscribe(result),
|
||||
subscribe(error),
|
||||
subscribe(disconnected),
|
||||
loop()
|
||||
|
@ -365,8 +365,10 @@ spawn_worker(#worker{pid = undefined, nonce = Nonce, config = Cfg} = W, Cand) ->
|
||||
|
||||
-spec init_worker(binary(), integer(), integer(), tuple(), pid()) -> no_return().
|
||||
init_worker(Data, Nonce, Target, Config, Parent) ->
|
||||
gmhc_events:publish(puzzle, {Data, Target, Nonce, Config}),
|
||||
Res = gmhc_workers:generate_from_hash(Data, Target, Nonce, Config, undefined),
|
||||
%% ?LOG_DEBUG("worker result: ~p", [Res]),
|
||||
gmhc_events:publish(result, Res),
|
||||
case Res of
|
||||
{ok, Solutions} when is_list(Solutions) ->
|
||||
worker_result(Parent, {solutions, Solutions});
|
||||
|
@ -1,10 +1,10 @@
|
||||
{name,"gmhive_client"}.
|
||||
{type,app}.
|
||||
{modules,[]}.
|
||||
{author,"Ulf Wiger, QPQ AG"}.
|
||||
{prefix,"gmhc"}.
|
||||
{desc,"Gajumaru Hive Client"}.
|
||||
{package_id,{"uwiger","gmhive_client",{0,1,4}}}.
|
||||
{author,"Ulf Wiger, QPQ AG"}.
|
||||
{package_id,{"uwiger","gmhive_client",{0,2,0}}}.
|
||||
{deps,[{"uwiger","gmhive_worker",{0,1,1}},
|
||||
{"uwiger","gmhive_protocol",{0,1,1}},
|
||||
{"uwiger","setup",{2,2,4}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user