Exemplo n.º 1
0
    def __init__(self, lnd_node: LndNode):
        super().__init__()
        self.lnd_node = lnd_node
        self.layout = QGridLayout()

        self.lnd_version = SelectableText(
            f'LND '
            f'version {self.lnd_node.software.release_version}')
        self.layout.addWidget(self.lnd_version)

        self.alias_layout = AliasLayout()
        self.alias_layout.new_color.connect(
            lambda x: self.set_conf_value('color', x))
        self.alias_layout.alias_editor.textEdited.connect(
            lambda x: self.set_conf_value('alias', x))
        self.layout.addLayout(self.alias_layout)

        self.layout.addWidget(HorizontalLine())

        self.restart_layout = LndRestartLayout(lnd=self.lnd_node)
        self.layout.addLayout(self.restart_layout)

        self.tls_layout = TlsLayout(lnd=self.lnd_node)
        self.layout.addLayout(self.tls_layout)

        self.show_lnd_conf = QPushButton('Show lnd.conf')
        self.show_lnd_conf.clicked.connect(
            lambda: reveal(self.lnd_node.file.directory))
        self.layout.addWidget(self.show_lnd_conf)

        self.setLayout(self.layout)
    def __init__(self, node_set: NodeSet):
        super(VersionsLayout, self).__init__()
        self.node_set = node_set

        self.columns = 2

        self.node_launcher_version = SelectableText(
            f'Node Launcher version {NODE_LAUNCHER_RELEASE}')

        self.litecoin_version = SelectableText(
            f'Litecoin Core '
            f'version {self.node_set.litecoin.software.release_version}')

        self.lnd_version = SelectableText(
            f'LND '
            f'version {self.node_set.lnd.software.release_version}')

        self.addWidget(self.node_launcher_version, column_span=self.columns)
        self.addWidget(self.litecoin_version, column_span=self.columns)
        self.addWidget(self.lnd_version, column_span=self.columns)
Exemplo n.º 3
0
class LndPortsLayout(QGridLayout):
    def __init__(self, lnd: Lnd):
        super(LndPortsLayout, self).__init__()
        self.lnd = lnd

        self.network_ports = SectionName(
            f'Network Ports (for <a '
            f'href="https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router"'
            f'>port forwarding</a>)'
        )
        self.addWidget(self.network_ports)

        self.lnd_network_port = SelectableText(
            f'LND network peer port: {self.lnd.node_port}'
        )
        self.addWidget(self.lnd_network_port)

        self.addWidget(HorizontalLine())

        self.client_ports = SelectableText(
            f'Client Ports (you can lose money port forwarding these!)'
        )
        self.addWidget(self.client_ports)

        self.grpc_port = SelectableText(
            f'LND gRPC port: {self.lnd.grpc_port}'
        )
        self.addWidget(self.grpc_port)

        self.rest_port = SelectableText(
            f'LND REST port: {self.lnd.rest_port}'
        )
        self.addWidget(self.rest_port)

        self.lnd_restart_required = WarningText(
            'Config file changed: Restart LND'
        )
        self.addWidget(self.lnd_restart_required)
        self.lnd_restart_required.hide()

        self.lnd.file.file_watcher.fileChanged.connect(self.refresh_lnd_ports)

    def refresh_lnd_ports(self):
        self.lnd_network_port.setText(
            f'LND network peer port: {self.lnd.node_port}'
        )
        self.grpc_port.setText(
            f'LND gRPC port: {self.lnd.grpc_port}'
        )
        self.rest_port.setText(
            f'LND REST port: {self.lnd.rest_port}'
        )
        self.check_restart_required()

    def check_restart_required(self):
        if self.lnd.restart_required:
            self.lnd_restart_required.show()
        else:
            self.lnd_restart_required.hide()
Exemplo n.º 4
0
    def __init__(self, node_set: NodeSet):
        super(PortsLayout, self).__init__()
        self.node_set = node_set

        self.network_ports = SectionName(
            f'Network Ports (for <a '
            f'href="https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router"'
            f'>port forwarding</a>)'
        )

        self.bitcoin_network_port = SelectableText(
            f'Bitcoin network peer port: {self.node_set.bitcoin.node_port}'
        )

        self.lnd_network_port = SelectableText(
            f'LND network peer port: {self.node_set.lnd.node_port}'
        )

        self.addWidget(self.network_ports)
        self.addWidget(self.bitcoin_network_port)
        self.addWidget(self.lnd_network_port)

        self.addWidget(HorizontalLine())

        self.client_ports = SelectableText(
            f'Client Ports (you can lose money port forwarding these!)'
        )
        self.addWidget(self.client_ports)

        self.zmq_ports = SelectableText(
            f'Bitcoin ZMQ block/tx ports:'
            f' {self.node_set.bitcoin.zmq_block_port}'
            f'/{self.node_set.bitcoin.zmq_tx_port}'
        )
        self.addWidget(self.zmq_ports)

        self.rpc_port = SelectableText(
            f'Bitcoin RPC port: {self.node_set.bitcoin.rpc_port}'
        )
        self.addWidget(self.rpc_port)

        self.grpc_port = SelectableText(
            f'LND gRPC port: {self.node_set.lnd.grpc_port}'
        )
        self.addWidget(self.grpc_port)

        self.rest_port = SelectableText(
            f'LND REST port: {self.node_set.lnd.rest_port}'
        )
        self.addWidget(self.rest_port)
Exemplo n.º 5
0
    def __init__(self, bitcoin: Bitcoin):
        super().__init__()

        self.bitcoin = bitcoin

        self.layout = QGridLayout()

        self.bitcoin_version = SelectableText(
            f'Bitcoin Core '
            f'version {self.bitcoin.software.release_version}')
        self.layout.addWidget(self.bitcoin_version)

        self.data_directory_group_box = DataDirectoryBox(bitcoin=self.bitcoin)
        self.data_directory_group_box.file_dialog.new_data_directory.connect(
            self.change_datadir)
        self.layout.addWidget(self.data_directory_group_box)
        self.layout.setAlignment(self.data_directory_group_box,
                                 Qt.AlignHCenter)

        self.enable_wallet_label = QLabel('Enable wallet')
        self.enable_wallet_widget = QCheckBox('Enable Wallet')
        self.enable_wallet_widget.setChecked(
            not self.bitcoin.file['disablewallet'])
        self.enable_wallet_widget.stateChanged.connect(
            lambda x: self.set_conf_value('disablewallet', not bool(x)))
        self.layout.addWidget(self.enable_wallet_widget)

        self.layout.addWidget(HorizontalLine())

        self.ports_layout = BitcoindPortsLayout(bitcoin=self.bitcoin)
        self.layout.addLayout(self.ports_layout)

        self.restart_layout = BitcoindRestartLayout(bitcoin=self.bitcoin)
        self.layout.addLayout(self.restart_layout)

        self.show_bitcoin_conf = QPushButton('Show bitcoin.conf')
        self.show_bitcoin_conf.clicked.connect(
            lambda: reveal(self.bitcoin.file.directory))
        self.layout.addWidget(self.show_bitcoin_conf)

        self.setLayout(self.layout)
Exemplo n.º 6
0
    def __init__(self, bitcoin: Bitcoin):
        super(BitcoindPortsLayout, self).__init__()
        self.bitcoin = bitcoin

        self.network_ports = SectionName(
            f'Network Ports (for <a '
            f'href="https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router"'
            f'>port forwarding</a>)'
        )

        self.bitcoin_network_port = SelectableText(
            f'Bitcoin network peer port: {self.bitcoin.node_port}'
        )

        self.addWidget(self.network_ports)
        self.addWidget(self.bitcoin_network_port)

        self.addWidget(HorizontalLine())

        self.client_ports = SelectableText(
            f'Client Ports (you can lose money port forwarding these!)'
        )
        self.addWidget(self.client_ports)

        self.zmq_ports = SelectableText(
            f'Bitcoin ZMQ block/tx ports:'
            f' {self.bitcoin.zmq_block_port}'
            f'/{self.bitcoin.zmq_tx_port}'
        )
        self.addWidget(self.zmq_ports)

        self.rpc_port = SelectableText(
            f'Bitcoin RPC port: {self.bitcoin.rpc_port}'
        )
        self.addWidget(self.rpc_port)

        self.bitcoin_restart_required = WarningText(
            'Config file changed: Restart Bitcoin'
        )
        self.addWidget(self.bitcoin_restart_required)
        self.bitcoin_restart_required.hide()

        self.bitcoin.file.file_watcher.fileChanged.connect(self.refresh_bitcoin_ports)