(datadir, i, chain, rpchost)
| 349 | |
| 350 | |
| 351 | def rpc_url(datadir, i, chain, rpchost): |
| 352 | rpc_u, rpc_p = get_auth_cookie(datadir, chain) |
| 353 | host = '127.0.0.1' |
| 354 | port = rpc_port(i) |
| 355 | if rpchost: |
| 356 | parts = rpchost.split(':') |
| 357 | if len(parts) == 2: |
| 358 | host, port = parts |
| 359 | else: |
| 360 | host = rpchost |
| 361 | return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, host, int(port)) |
| 362 | |
| 363 | |
| 364 | # Node functions |