예제 #1
0
def main():
    cleanup_tmp_dir()

    config_options = {
        'verbose': is_debug_build(),
        'cmd': 'gui',
        'gui': 'ios_native',
        'cwd': os.getcwd(),
    }

    set_verbosity(config_options.get('verbose'),
                  timestamps=False,
                  thread_id=False)
    NSLogSuppress(not config_options.get('verbose'))

    MonkeyPatches.patch()

    #for k,v in config_options.items():
    #    print("config[%s] = %s"%(str(k),str(v)))

    config = SimpleConfig(config_options, read_user_dir_function=get_user_dir)

    gui = ElectrumGui(config)
    call_later(
        0.010, gui.main
    )  # this is required for the activity indicator to actually animate. Switch to a direct call if not using activity indicator on Splash2

    return "Bitcoin Cash FTW!"
예제 #2
0
파일: app.py 프로젝트: VitaeTeam/ViLight
def main():
    cleanup_tmp_dir()

    config_options = {
        'verbose': is_debug_build(),
        'cmd': 'gui',
        'gui': 'ios_native',
        'cwd': os.getcwd(),
        'whitelist_servers_only':
        True,  # on iOS we force only the whitelist ('preferred') servers only for now as a security measure
    }

    set_verbosity(config_options.get('verbose'),
                  timestamps=False,
                  thread_id=False)
    NSLogSuppress(not config_options.get('verbose'))

    MonkeyPatches.patch()

    config = SimpleConfig(config_options, read_user_dir_function=get_user_dir)

    gui = ElectrumGui(config)
    call_later(
        0.010, gui.main
    )  # this is required for the activity indicator to actually animate. Switch to a direct call if not using activity indicator on Splash2

    _printStats(
        config_options
    )  # Prints some startup/debug stats such as Python version and SSL version (this is done in another thread to hopefully not impact startup overhead too much, as importing ssl may be a bit heavy)

    return "Vitae FTW!"
예제 #3
0
    def __init__(self, config, daemon, plugins):

        self.config = config
        self.network = daemon.network
        storage = WalletStorage(config.get_wallet_path())
        if not storage.file_exists():
            print("Wallet not found. try 'electron-cash create'")
            exit()
        if storage.is_encrypted():
            password = getpass.getpass('Password:'******'')
        self.encoding = locale.getpreferredencoding()

        self.stdscr = curses.initscr()
        curses.noecho()
        curses.cbreak()
        curses.start_color()
        curses.use_default_colors()
        curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
        curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_CYAN)
        curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_WHITE)
        self.stdscr.keypad(1)
        self.stdscr.border(0)
        self.maxy, self.maxx = self.stdscr.getmaxyx()
        self.set_cursor(0)
        self.w = curses.newwin(10, 50, 5, 5)

        set_verbosity(False)
        self.tab = 0
        self.pos = 0
        self.popup_pos = 0

        self.str_recipient = ""
        self.str_description = ""
        self.str_amount = ""
        self.str_fee = ""
        self.history = None

        if self.network:
            self.network.register_callback(
                self.update, ['wallet_updated', 'blockchain_updated'])

        self.tab_names = [
            _("History"),
            _("Send"),
            _("Receive"),
            _("Addresses"),
            _("Contacts"),
            _("Banner")
        ]
        self.num_tabs = len(self.tab_names)
예제 #4
0
def main():
    cleanup_tmp_dir()
    
    config_options = {
            'verbose': True,
            'cmd': 'gui',
            'gui': 'ios_native',
            'cwd': os.getcwd(),
    }

    set_verbosity(config_options.get('verbose'))

    for k,v in config_options.items():
        print("config[%s] = %s"%(str(k),str(v)))

    config = SimpleConfig(config_options, read_user_dir_function = get_user_dir)

    gui = ElectrumGui(config)
    gui.main()

    return "Bitcoin Cash FTW!"
예제 #5
0
    def __init__(self, config, daemon, plugins):
        self.config = config
        self.network = daemon.network
        storage = WalletStorage(config.get_wallet_path())
        if not storage.file_exists:
            print(f"Wallet not found. try '{SCRIPT_NAME} create'")
            exit()
        if storage.is_encrypted():
            password = getpass.getpass('Password:', stream=None)
            storage.decrypt(password)

        self.done = 0
        self.last_balance = ""

        set_verbosity(False)

        self.str_recipient = ""
        self.str_description = ""
        self.str_amount = ""
        self.str_fee = ""

        self.wallet = Wallet(storage)
        self.wallet.start_threads(self.network)
        self.contacts = self.wallet.contacts

        self.network.register_callback(
            self.on_network,
            ["wallet_updated", "blockchain_updated", "banner"])
        self.commands = [
            _("[h] - displays this help text"),
            _("[i] - display transaction history"),
            _("[o] - enter payment order"),
            _("[p] - print stored payment order"),
            _("[s] - send stored payment order"),
            _("[r] - show own receipt addresses"),
            _("[c] - display contacts"),
            _("[b] - print server banner"),
            _("[q] - quit"),
        ]
        self.num_commands = len(self.commands)
예제 #6
0
def main():
    cleanup_tmp_dir()

    config_options = {
        'verbose': is_debug_build(),
        'cmd': 'gui',
        'gui': 'ios_native',
        'cwd': os.getcwd(),
        'testnet': 'EC_TESTNET' in os.
        environ,  # You can set the env when testing using Xcode "Scheme" editor
    }

    if config_options.get('testnet'):
        set_testnet()
    else:
        set_mainnet()

    set_verbosity(config_options.get('verbose'),
                  timestamps=False,
                  thread_id=False)
    NSLogSuppress(not config_options.get('verbose'))

    MonkeyPatches.patch()

    config = PatchedSimpleConfig(config_options,
                                 read_user_dir_function=get_user_dir)

    gui = ElectrumGui(config)
    call_later(
        0.010, gui.main
    )  # this is required for the activity indicator to actually animate. Switch to a direct call if not using activity indicator on Splash2

    _printStats(
        config_options
    )  # Prints some startup/debug stats such as Python version and SSL version (this is done in another thread to hopefully not impact startup overhead too much, as importing ssl may be a bit heavy)

    return "Bitcoin Cash FTW!"
예제 #7
0
config_options = {
    'testnet': os.getenv("TESTNET", "true") == "true",
    "rpcuser": os.getenv("ELECTRUM_USER", "electrum"),
    "rpcpassword": os.getenv("ELECTRUM_PASSWORD", "changeme"),
    "rpcport": 7000,
    "rpchost": "0.0.0.0",
    'cwd': os.getcwd(),
    'auto_connect': True,
    'verbose': False,
    'wallet_password': os.getenv("WALLET_PASSPHRASE"),
    "noonion": True,
}

if __name__ == '__main__':
    set_verbosity(config_options.get('verbose'))
    if config_options.get('testnet'):
        networks.set_testnet()

    config = SimpleConfig(config_options)
    storage = WalletStorage(config.get_wallet_path())

    if not storage.file_exists():
        print_msg("Wallet doesn't exist, creating...")
        data = create_new_wallet(path=storage.path,
                                 config=config,
                                 password=config_options['wallet_password'],
                                 encrypt_file=True)
        storage = WalletStorage(storage.path)

    if storage.is_encrypted() is False: