chris-belcher / electrum-personal-server

Maximally lightweight electrum server for a single user
MIT License
601 stars 110 forks source link

Error On Launch #294

Open devhumney opened 1 year ago

devhumney commented 1 year ago

I'm attempting to run an Electrum Personal Server on my Ubuntu Machine After reaching step 8 I get the following errors, here's a copy of my config.ini file with the appropriate credentials redacted:

config.ini:

Electrum Personal Server configuration file

Lines starting with # are called comments which are ignored.

For a line to have effect it must not start with

The most important options are towards the top of the file

[master-public-keys]

Add electrum wallet master public keys to this section

In electrum then go Wallet -> Information to get the mpk

wallet = xpub661My...

Multiple master public keys may be added by simply adding another line

my_second_wallet = xpubanotherkey

Multisig wallets use format required-signatures [list of master pub keys]

this example is a 2-of-3 multisig wallet

multisig_wallet = 2 xpub661MyMwAqRbcFseXCwRdRVkhVuzEiskg4QUp5XpUdNf2uGXvQmnD4zcofZ1MN6Fo8PjqQ5cemJQ39f7RTwDVVputHMFjPUn8VRp2pJQMgEF xpub661MyMwAqRbcFseXCwRdRVkhVuzEiskg4QUp5XpUdNf2uGXvQmnD4zcofZ1MN6Fo8PjqQ5cemJQ39f7RTwDVVputHMFjPUn8VRp2pJQMgEF xpub661MyMwAqRbcFseXCwRdRVkhVuzEiskg4QUp5XpUdNf2uGXvQmnD4zcofZ1MN6Fo8PjqQ5cemJQ39f7RTwDVVputHMFjPUn8VRp2pJQMgEF

[bitcoin-rpc] host = 127.0.0.1 port = 8332 rpcuser = * rpcpassword = ***

to be used with the multi-wallet feature

see https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.15.0.md#multi-wallet-support

empty means default file, for when using a single wallet file

wallet_filename =

how often in seconds to poll for new transactions when electrum not connected

poll_interval_listening = 30

how often in seconds to poll for new transactions when electrum is connected

poll_interval_connected = 1

Parameters for dealing with deterministic wallets

how many addresses to import first time, should be big because if you import too little you may have to rescan again

initial_import_count = 1000

number of unused addresses kept at the head of the wallet

gap_limit = 25

[electrum-server]

0.0.0.0 to accept connections from any IP

127.0.0.1 to accept from only localhost

host = 127.0.0.1 port = 50002

space-separated whitelist of IP addresses

accepts CIDR notation eg 192.168.0.0/16 or 2a01:4f8:1f1::/120

star (*) means all are accepted

generally requires host binding (above) to be 0.0.0.0

ip_whitelist = *

SSL certificate

uses the default one, which is fine because by default nobody should be

allowed to connect to your server or scan your packets

to generate another certificate see https://github.com/spesmilo/electrum-server/blob/ce1b11d7f5f7a70a3b6cc7ec1d3e552436e54ffe/HOWTO.md#step-8-create-a-self-signed-ssl-cert

certfile = certs/cert.crt keyfile = certs/cert.key

Option for disabling the fee histogram calculation

It improves server responsiveness but stops mempool-based Electrum features

This is useful on low powered devices at times when the node mempool is large

disable_mempool_fee_histogram = false

How often in seconds to update the mempool

this mempool is used to calculate the mempool fee histogram

mempool_update_interval = 60

Parameter for broadcasting unconfirmed transactions

Options are:

* tor-or-own-node (use tor if tor is running locally, otherwise own-node)

* own-node (broadcast using the connected full node)

* tor (broadcast to random nodes over tor)

* system %s (save transaction to file, and invoke system command

with file path as parameter %s)

broadcast_method = tor-or-own-node

For tor broadcasting (broadcast_method = tor) configure

the tor proxy host and port below

tor_host = localhost tor_port = 9050

= Notes on tor broadcasting =

If using tor broadcasting, make sure you set walletbroadcast=0 in

your bitcoin.conf file

If your full node is connected to the internet only via tor then you dont

need separate tor broadcasting

[watch-only-addresses]

Add individual addresses to this section, for example paper wallets

Dont use this section for adding entire wallets, instead use the

above section master-public-keys

addr = 1DuqpoeTB9zLvVCXQG53VbMxvMkijk494n

A space separated list is also accepted

my_test_addresses = 3Hh7QujVLqz11tiQsnUE5CSL16WEHBmiyR 1PXRLo1FQoZyF1Jhnz4qbG5x8Bo3pFpybz bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq

multiple addresses may also be added in separate lines (like master public keys above)

addr2 = 3anotheraddress

[logging]

Section for configuring the logging output

The log level. Logging messages less severe than this will not be displayed

options are 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'

Information printed to the log file is always at level DEBUG

log_level_stdout = INFO

Location of log file, leave empty to use the default location in temp dir

log_file_location =

Whether to append to log file or delete and overwrite on startup

append_log = false

Format to use for logging messages

see docs https://docs.python.org/3/library/logging.html#formatter-objects

log_format = %(levelname)s:%(asctime)s: %(message)s


ERRORS:

after removing the datadir section entirely

electrum-personal-server config.ini INFO:2023-07-10 15:01:11,515: Starting Electrum Personal Server 0.2.4 INFO:2023-07-10 15:01:11,516: Logging to /tmp/electrumpersonalserver.log Traceback (most recent call last): File "/usr/lib/python3.10/configparser.py", line 790, in get value = d[option] File "/usr/lib/python3.10/collections/init.py", line 986, in getitem return self.missing(key) # support subclasses that define missing File "/usr/lib/python3.10/collections/init.py", line 978, in missing raise KeyError(key) KeyError: 'rpc_user'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anonymous/.local/lib/python3.10/site-packages/electrumpersonalserver/server/common.py", line 413, in main rpc_u = config.get("bitcoin-rpc", "rpc_user") File "/usr/lib/python3.10/configparser.py", line 793, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'rpc_user' in section: 'bitcoin-rpc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/configparser.py", line 790, in get value = d[option] File "/usr/lib/python3.10/collections/init.py", line 986, in getitem return self.missing(key) # support subclasses that define missing File "/usr/lib/python3.10/collections/init.py", line 978, in missing raise KeyError(key) KeyError: 'datadir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anonymous/.local/bin/electrum-personal-server", line 8, in sys.exit(main()) File "/home/anonymous/.local/lib/python3.10/site-packages/electrumpersonalserver/server/common.py", line 417, in main cookie_path = obtain_cookie_file_path(config.get( File "/usr/lib/python3.10/configparser.py", line 793, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'datadir' in section: 'bitcoin-rpc'

ERRORS2:

after just commenting out datadir

electrum-personal-server config.ini INFO:2023-07-10 14:55:18,510: Starting Electrum Personal Server 0.2.4 INFO:2023-07-10 14:55:18,510: Logging to /tmp/electrumpersonalserver.log WARNING:2023-07-10 14:55:18,511: Unable to find .cookie file, try setting datadir config