(wip) sample multiple method post on RPC
This commit is contained in:
parent
752bc0e05e
commit
03c74acc35
|
@ -91,14 +91,13 @@ sub prefix_module_output {
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $query_form_post_listening = { method => 'net_listening', params => [], id => "1", jsonrpc => "2.0" };
|
my $query_form_post = [ { method => 'net_listening', params => [], id => "1", jsonrpc => "2.0" },
|
||||||
my $result_listening = $options{custom}->request_api(method => 'POST', query_form_post => $query_form_post_listening);
|
{ method => 'net_peerCount', params => [], id => "2", jsonrpc => "2.0" } ];
|
||||||
|
|
||||||
my $query_form_post_peer = { method => 'net_peerCount', params => [], id => "1", jsonrpc => "2.0" };
|
my $result = $options{custom}->request_api(method => 'POST', query_form_post => $query_form_post);
|
||||||
my $result_peer = $options{custom}->request_api(method => 'POST', query_form_post => $query_form_post_peer);
|
|
||||||
|
|
||||||
$self->{network} = { listening => $result_listening->{result},
|
$self->{network} = { listening => @{$result}[0]->{result},
|
||||||
peers => hex($result_peer->{result}) }
|
peers => hex(@{$result}[1]->{result}) };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue