Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_default_ipc_path(testnet=False):
- if testnet:
- testnet = "testnet"
- else:
- testnet = ""
- if sys.platform == 'darwin':
- ipc_path = os.path.expanduser(os.path.join(
- "~",
- "Library",
- "Ethereum",
- testnet,
- "geth.ipc"
- ))
- if os.path.exists(ipc_path):
- return ipc_path
- ipc_path = os.path.expanduser(os.path.join(
- "~",
- "Library",
- "Application Support",
- "io.parity.ethereum",
- "jsonrpc.ipc"
- ))
- if os.path.exists(ipc_path):
- return ipc_path
- elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
- ipc_path = os.path.expanduser(os.path.join(
- "~",
- ".ethereum",
- testnet,
- "geth.ipc"
- ))
- if os.path.exists(ipc_path):
- return ipc_path
- ipc_path = os.path.expanduser(os.path.join(
- "~",
- ".local",
- "share",
- "io.parity.ethereum",
- "jsonrpc.ipc"
- ))
- if os.path.exists(ipc_path):
- return ipc_path
- elif sys.platform == 'win32':
- ipc_path = os.path.join(
- "\\",
- ".",
- "pipe",
- "geth.ipc"
- )
- if os.path.exists(ipc_path):
- return ipc_path
- ipc_path = os.path.join(
- "\\",
- ".",
- "pipe",
- "jsonrpc.ipc"
- )
- if os.path.exists(ipc_path):
- return ipc_path
Add Comment
Please, Sign In to add comment