Ejemplo n.º 1
0
    def __init__(self, network: str, node_launcher: NodeLauncher):
        super().__init__(network)
        self.network = network
        self.node_launcher = node_launcher

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(ImageLabel(f'bitcoin-{network}.png'))
        layout.addStretch(1)

        self.error_message = QErrorMessage(self)
        if OPERATING_SYSTEM == LINUX:
            self.error_message.showMessage(
                'Linux is not supported, please submit a pull request! '
                'https://github.com/PierreRochard/node-launcher')
            sys.exit(0)

        layout.addWidget(HorizontalLine())

        # Bitcoin-Qt button
        self.bitcoin_qt_button = QtWidgets.QPushButton('Launch Bitcoin')
        bitcoin_qt_launcher = getattr(node_launcher,
                                      f'{network}_bitcoin_qt_node')
        # noinspection PyUnresolvedReferences
        self.bitcoin_qt_button.clicked.connect(bitcoin_qt_launcher)
        layout.addWidget(self.bitcoin_qt_button)

        # LND button
        self.lnd_button = QtWidgets.QPushButton('Launch LND')
        lnd_launcher = getattr(node_launcher, f'{network}_lnd_node')
        # noinspection PyUnresolvedReferences
        self.lnd_button.clicked.connect(lnd_launcher)
        layout.addWidget(self.lnd_button)

        layout.addWidget(HorizontalLine())

        # Copy REST API URL button
        self.rest_url_copy_button = QtWidgets.QPushButton(
            'Copy LND REST Address')
        # noinspection PyUnresolvedReferences
        self.rest_url_copy_button.clicked.connect(self.copy_rest_url)
        layout.addWidget(self.rest_url_copy_button)

        # Show Macaroons button
        self.show_macaroons_button = QtWidgets.QPushButton('Show Macaroons')
        # noinspection PyUnresolvedReferences
        self.show_macaroons_button.clicked.connect(self.reveal_macaroons)
        layout.addWidget(self.show_macaroons_button)

        # Copy lncli command button
        self.lncli_copy_button = QtWidgets.QPushButton('Copy lncli Command')
        # noinspection PyUnresolvedReferences
        self.lncli_copy_button.clicked.connect(self.copy_lncli_command)
        layout.addWidget(self.lncli_copy_button)

        self.setLayout(layout)
Ejemplo n.º 2
0
    def __init__(self, parent: QWidget, node_set: NodeSet):
        super(LndWalletLayout, self).__init__()
        self.node_set = node_set
        self.password_dialog = QInputDialog(parent)
        self.error_message = QErrorMessage(parent)

        columns = 2
        self.addWidget(SectionName('LND Wallet'), column_span=columns)
        wallet_buttons_layout = QtWidgets.QHBoxLayout()
        # Unlock wallet button
        self.unlock_wallet_button = QtWidgets.QPushButton('Unlock')
        # noinspection PyUnresolvedReferences
        self.unlock_wallet_button.clicked.connect(self.unlock_wallet)
        wallet_buttons_layout.addWidget(self.unlock_wallet_button)

        # Create wallet button
        self.create_wallet_button = QtWidgets.QPushButton('Create')
        # noinspection PyUnresolvedReferences
        self.create_wallet_button.clicked.connect(self.create_wallet)
        wallet_buttons_layout.addWidget(self.create_wallet_button, same_row=True, column=2)

        # Recover wallet button
        self.recover_wallet_button = QtWidgets.QPushButton('Recover')
        # noinspection PyUnresolvedReferences
        self.recover_wallet_button.clicked.connect(self.recover_wallet)
        wallet_buttons_layout.addWidget(self.recover_wallet_button)
        self.addLayout(wallet_buttons_layout, column_span=columns)

        self.addWidget(HorizontalLine(), column_span=columns)
Ejemplo n.º 3
0
    def __init__(self, node_set: NodeSet):
        super(NodesLayout, self).__init__()
        self.node_set = node_set
        self.columns = 2
        image_label = ImageLabel(f'bitcoin-{self.node_set.network}.png')
        self.addWidget(image_label, row_span=5)

        self.addWidget(SectionName('Nodes'), column=self.columns)
        # Bitcoin-Qt button
        self.bitcoin_qt_button = QtWidgets.QPushButton('Launch Bitcoin')
        # noinspection PyUnresolvedReferences
        self.bitcoin_qt_button.clicked.connect(self.node_set.bitcoin.launch)
        self.addWidget(self.bitcoin_qt_button, column=self.columns)

        # LND button
        self.lnd_button = QtWidgets.QPushButton('Launch LND')
        # noinspection PyUnresolvedReferences
        self.lnd_button.clicked.connect(self.node_set.lnd.launch)
        self.addWidget(self.lnd_button, column=self.columns)

        self.addWidget(HorizontalLine(), column=self.columns)
Ejemplo n.º 4
0
    def __init__(self, node_set: NodeSet):
        super(ZapLayout, self).__init__()
        self.qrcode_label = None
        self.node_set = node_set
        columns = 2

        self.addWidget(SectionName(
            '<a href="https://github.com/LN-Zap/zap-desktop/blob/master/README.md">Zap Desktop Wallet</a>'
        ),
                       column_span=columns)

        self.open_zap_desktop_button = QtWidgets.QPushButton(
            'Open Zap Desktop')
        self.open_zap_desktop_button.clicked.connect(self.open_zap_desktop)
        self.addWidget(self.open_zap_desktop_button)

        self.show_zap_qrcode_button = QtWidgets.QPushButton('Show QR Code')
        self.show_zap_qrcode_button.clicked.connect(self.show_zap_qrcode)
        self.addWidget(self.show_zap_qrcode_button, same_row=True, column=2)

        self.addWidget(HorizontalLine(), column_span=columns)
Ejemplo n.º 5
0
    def __init__(self, node_set: NodeSet):
        super(ZapLayout, self).__init__()
        self.node_set = node_set
        columns = 3

        self.addWidget(SectionName('<a href="https://github.com/LN-Zap/zap-desktop/blob/master/README.md">Zap Desktop Wallet</a>'), column_span=columns)

        self.copy_grpc_url = CopyButton('Host gRPC', self.node_set.lnd.grpc_url)
        self.addLayout(self.copy_grpc_url)

        self.copy_tls_cert_path = CopyButton('TLS Cert Path',
                                             self.node_set.lnd.tls_cert_path)
        self.addLayout(self.copy_tls_cert_path, same_row=True, column=2)

        self.copy_admin_macaroon_path = CopyButton(
            'Macaroon Path',
            self.node_set.lnd.admin_macaroon_path
        )
        self.addLayout(self.copy_admin_macaroon_path, same_row=True, column=3)

        self.addWidget(HorizontalLine(), column_span=columns)
Ejemplo n.º 6
0
    def __init__(self, node_set: NodeSet):
        super(JouleLayout, self).__init__()
        self.node_set = node_set
        columns = 2

        self.addWidget(SectionName(
            '<a href="https://github.com/wbobeirne/joule-extension/wiki/How-to:-Install-Extension-Manually">Joule Chrome Extension</a>'
        ),
                       column_span=columns)

        self.copy_rest = CopyButton('Node URL (REST)',
                                    self.node_set.lnd.rest_url)
        self.addLayout(self.copy_rest)

        self.show_macaroons_button = QtWidgets.QPushButton('Show Macaroons')
        # noinspection PyUnresolvedReferences
        self.show_macaroons_button.clicked.connect(
            lambda: reveal(self.node_set.lnd.macaroon_path))
        self.addWidget(self.show_macaroons_button,
                       same_row=True,
                       column=columns)
        self.addWidget(HorizontalLine(), column_span=columns)