Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
def get_jsonrpc_cli(jrpc_url):
return jsonrpcclient.HTTPClient(jrpc_url)
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)
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)