How to use the jsonrpcclient.HTTPClient function in jsonrpcclient

To help you get started, we’ve selected a few jsonrpcclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github QuarkChain / pyquarkchain / quarkchain / tools / check_syncing_state.py View on Github external
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", default="localhost", type=str, help="Cluster IP")


    parser.add_argument("--bootstrapip", default="jrpc.testnet2.quarkchain.io", type=str, help="Bootstrap Cluster IP")

    parser.add_argument(
        "-i", "--interval", default=10, type=int, help="Query interval in second"
    )

    args = parser.parse_args()

    private_endpoint = "http://{}:38391".format(args.ip)
    private_client = jsonrpcclient.HTTPClient(private_endpoint)

    public_endpoint = "http://{}:38391".format(args.bootstrapip)
    public_client = jsonrpcclient.HTTPClient(public_endpoint)




    query_height(private_client, public_client, args)
github QuarkChain / pyquarkchain / quarkchain / tools / external_miner.py View on Github external
def get_jsonrpc_cli(jrpc_url):
    return jsonrpcclient.HTTPClient(jrpc_url)
github QuarkChain / pyquarkchain / quarkchain / tools / check_syncing_state.py View on Github external
parser.add_argument("--ip", default="localhost", type=str, help="Cluster IP")


    parser.add_argument("--bootstrapip", default="jrpc.testnet2.quarkchain.io", type=str, help="Bootstrap Cluster IP")

    parser.add_argument(
        "-i", "--interval", default=10, type=int, help="Query interval in second"
    )

    args = parser.parse_args()

    private_endpoint = "http://{}:38391".format(args.ip)
    private_client = jsonrpcclient.HTTPClient(private_endpoint)

    public_endpoint = "http://{}:38391".format(args.bootstrapip)
    public_client = jsonrpcclient.HTTPClient(public_endpoint)




    query_height(private_client, public_client, args)
github icon-project / loopchain / loopchain / baseservice / rest_client.py View on Github external
def _call_jsonrpc(self, target: str, method: RestMethod, params: Optional[NamedTuple], timeout):
        url = self._create_jsonrpc_url(target, method)
        http_client = HTTPClient(url)
        request = self._create_jsonrpc_params(method, params)
        return http_client.send(request, timeout=timeout)