Author

Topic: Electrum appImage console (Read 153 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
February 28, 2021, 03:32:54 AM
#9
Or, do you think the the appimage is type of a 'virtual OS' and that the same is true for the wallet as such also.

At very least, AppImage can't be compared with Virtual OS/VirtualBox because AppImage bundle the application and it's dependency into single file. AppImage still can have direct access your hardware and files if you give it permission.

If you want isolation or security, use virtualization software (such as VirtualBox), linux kernel security module (such as AppArmor or SELinux) or at least sandbox software (such as mbox and firejail).
newbie
Activity: 5
Merit: 0
February 27, 2021, 02:45:26 PM
#8

This is a hard question and I am not quite sure I can give a good answer , because the thoughts have a tendency to live its own life without a good thinking behind.

However it started when I realised that installing an appImage was quite easy compared to other Linux installations where the screen is flashing with lines and lines and lines some of them in red which is very scary for an old fashioned Win user.
I also had in mind that the appimage could be kind of VirtualBox installation isolated from rest of the OS.

Further down the line of muddled thougths , wallet transactions would be sent at certain conditions such as date , time, low transaction fees........all this programmed into a wallet.

regards
HCP
legendary
Activity: 2086
Merit: 4363
February 27, 2021, 02:51:12 AM
#7
Can I ask why you need/want to be able to import modules on the Electrum console? Huh It's really not the place to be writing raw python code! Shocked

If you need to be creating a Python script, go ahead and create a Python script and then run it using Python... Tongue
newbie
Activity: 5
Merit: 0
February 26, 2021, 10:03:05 AM
#6
Thanks for your curiosity and efforts . I will definetely wait for some explanations.

Do you think an standard install without not using the appImage wallet would give other import possibilities.
Or, do you think the the appimage is type of a 'virtual OS' and that the same is true for the wallet as such also.

That was some questions and while on my way......

Can you locate some wallet program example  for me to look at.

Best regards
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
February 25, 2021, 08:27:57 AM
#5
You got me curious, so i downloaded Electrum 4.0.9 AppImage and tried importing few library and here's the result

1. Importing built-in library shows no problem

Code:
>>> import sqlite3
>>> import datetime

2. Importing library required by Electrum (https://github.com/spesmilo/electrum/blob/master/contrib/requirements/requirements.txt) shows no problem either

Code:
>>> import qrcode
>>> import bitstring

3. Importing library installed with pip command shows same error

Code:
>>> import jellyfish
Traceback (most recent call last):
    import jellyfish
         ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electrGXmrQe/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "", line 1, in
ModuleNotFoundError: No module named 'jellyfish'
>>> import pandas
Traceback (most recent call last):
    import pandas
         ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electrGXmrQe/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "", line 1, in

However trying same thing with Electrum installed with pip from source code shows no problem.

Code:
>>> import jellyfish
>>> import pandas

I think Electrum AppImage have it's own python and isolated from python or python library installed your OS.
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
February 25, 2021, 01:36:32 AM
#4
that is, in fact, a good question.... To be honest, i've never tried to import modules from electrum's console.
When trying right now, i had a similar experience, so you're probably correct in saying you cannot import external modules in electrum's console... Maybe we can leave this thread open to see if ThomasV has some additional info about this?
newbie
Activity: 5
Merit: 0
February 24, 2021, 12:31:23 PM
#3
It comes from a try to do
Pip install bitcoin
from bitcoin import *

Maybe stupid but anyhow a try.

Is the cause of the missing function that this console can not import other libraries
or
is the appimage as such that not allow importing.

regards
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
February 24, 2021, 08:01:34 AM
#2
Where did you get the console function random_key()?
It doesn't seems to be a function from electrum...

https://github.com/spesmilo/electrum/search?q=random_key

Code:
>>>commands()
"add_lightning_request add_peer add_request addtransaction broadcast changegaplimit clear_invoices clear_ln_blacklist clear_requests close_channel close_wallet commands convert_xkey create createmultisig createnewaddress decode_invoice decrypt deserialize dumpgraph dumpprivkeys enable_htlc_settle encrypt export_channel_backup freeze get get_channel_ctx get_ssl_domain get_tx_status get_watchtower_ctn getaddressbalance getaddresshistory getaddressunspent getalias getbalance getconfig getfeerate getinfo getmasterprivate getmerkle getminacceptablegap getmpk getprivatekeyforpath getprivatekeys getpubkeys getrequest getseed getservers gettransaction getunusedaddress help import_channel_backup importprivkey inject_fees is_synchronized ismine lightning_history list_channels list_invoices list_peers list_requests list_wallets listaddresses listcontacts listunspent lnpay load_wallet make_seed nodeid normal_swap notify onchain_history open_channel password payto paytomany removelocaltx restore reverse_swap rmrequest searchcontacts serialize setconfig setlabel signmessage signrequest signtransaction stop sweep unfreeze validateaddress verifymessage version"
newbie
Activity: 5
Merit: 0
February 24, 2021, 07:53:52 AM
#1
Hej
I have a running Electrum Wallet and have started the Console and I have a prompt
Please give me some explanation of what is the explanation of the text ans its meaning.
Please use as simple/basic answer as possible.

regards

>>> 1+2
3
>>>
then I do, with less success

>>> my_private_key = random_key()
 
Traceback (most recent call last):
    my_private_key = random_key()
                   ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electr163Txz/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "", line 1, in
NameError: name 'random_key' is not defined
>>>
Jump to: