Bitcoin Forum
May 05, 2024, 10:43:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: generate more than 20 adresses  (Read 383 times)
Mbidox (OP)
Full Member
***
Offline Offline

Activity: 212
Merit: 108


View Profile
July 18, 2017, 07:58:28 PM
 #1

As I wanted to generate new addresses behind the gap limit. So I changed in Electrum into the console Tab.

Then I typed in

Code:
for x in range(0, 50):
print wallet.create_new_address(False)

and pressed "enter".

My expectation was now, that in the adresse tab I have now additional adresses. But I did not found any change in the adress tab.

No idea how I have to use the console and the code above suggesfully.

Can you help me?
1714949025
Hero Member
*
Offline Offline

Posts: 1714949025

View Profile Personal Message (Offline)

Ignore
1714949025
Reply with quote  #2

1714949025
Report to moderator
1714949025
Hero Member
*
Offline Offline

Posts: 1714949025

View Profile Personal Message (Offline)

Ignore
1714949025
Reply with quote  #2

1714949025
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714949025
Hero Member
*
Offline Offline

Posts: 1714949025

View Profile Personal Message (Offline)

Ignore
1714949025
Reply with quote  #2

1714949025
Report to moderator
1714949025
Hero Member
*
Offline Offline

Posts: 1714949025

View Profile Personal Message (Offline)

Ignore
1714949025
Reply with quote  #2

1714949025
Report to moderator
HI-TEC99
Legendary
*
Offline Offline

Activity: 2772
Merit: 2846



View Profile
July 18, 2017, 10:05:01 PM
Last edit: July 18, 2017, 10:25:24 PM by HI-TEC99
 #2

These instructions should work. Remember to restart electrum afterwards because the extra addresses won't show without a restart. If you ever restore your wallet from seed you will have to increase the gap limit again to see those extra addresses.

Quote

Click the console tab to open the console window, then paste the line of text below into it, then press your enter key.

wallet.change_gap_limit(50)

Restart electrum to view the extra addresses.

Adjust the number shown in red to increase or decrease the number of addresses you want.

If you ever restore your wallet from seed you will have to repeat that process to view those addresses.

john2231
Hero Member
*****
Offline Offline

Activity: 924
Merit: 1001



View Profile
July 18, 2017, 10:22:28 PM
 #3

Looks like i receive an error when typing this the same code..

Code:
>> for x in range(0, 50):
print wallet.create_new_address(False)
Traceback (most recent call last):
    nt wallet.create_new_address(False)
            ^
SyntaxError: invalid syntax

Let me know what version of electrum you are using?
6Asmodeus6
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
July 18, 2017, 10:27:01 PM
 #4

Looks like i receive an error when typing this the same code..

Code:
>> for x in range(0, 50):
print wallet.create_new_address(False)
Traceback (most recent call last):
    nt wallet.create_new_address(False)
            ^
SyntaxError: invalid syntax

Let me know what version of electrum you are using?

Weird syntax error. Can you try to write it only using one line?
Code:
for i in range(0, 50): print wallet.create_new_address(False)

Like this and if it doesn't work can you try using this and restarting the app :

Code:
wallet.storage.put('gap_limit',50)
john2231
Hero Member
*****
Offline Offline

Activity: 924
Merit: 1001



View Profile
July 18, 2017, 10:46:05 PM
Last edit: July 18, 2017, 11:04:01 PM by john2231
 #5

Looks like i receive an error when typing this the same code..

Code:
>> for x in range(0, 50):
print wallet.create_new_address(False)
Traceback (most recent call last):
    nt wallet.create_new_address(False)
            ^
SyntaxError: invalid syntax

Let me know what version of electrum you are using?

Weird syntax error. Can you try to write it only using one line?
Code:
for i in range(0, 50): print wallet.create_new_address(False)

Like this and if it doesn't work can you try using this and restarting the app :

Code:
wallet.storage.put('gap_limit',50)

This one works great but i type first the gap limit code before the generate new address above..
But i just notice that they are marked as red well this method should be work with the op since its work fine with me.  and generate almost 50 new address.
I restarted the electrum wallet but why the other addresses generated was marked as red?
HI-TEC99
Legendary
*
Offline Offline

Activity: 2772
Merit: 2846



View Profile
July 18, 2017, 11:04:31 PM
 #6

...This one works great but i type first the gap limit code before the generate new address above..
But i just notice that they are marked as red well this method should be work with the op since its work fine with me.  and generate almost 50 new address.
I restarted the electrum wallet but why the other address generated was marked as red?


That's expected behaviour and nothing to worry about. Electrum will always show the extra addresses in red until the gap is filled. The electrum documentation explains it.



The electrum documentation explains the gap limit. After setup electrum has a default number of addresses it shows, that default number is the gap limit. You can make electrum show more new unused addresses using console commands, but any it shows will have a red background until the gap is filled.

http://docs.electrum.org/en/latest/faq.html#how-can-i-pre-generate-new-addresses

Quote
Electrum will generate new addresses as you use them, until it hits the gap limit

If you need to pre-generate more addresses, you can do so by typing wallet.create_new_address(False) in the console. This command will generate one new address. Note that the address will be shown with a red background in the address tab, to indicate that it is beyond the gap limit. The red color will remain until the gap is filled.


HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
July 19, 2017, 04:43:51 AM
 #7

Looks like i receive an error when typing this the same code..

Code:
>> for x in range(0, 50):
print wallet.create_new_address(False)
Traceback (most recent call last):
    nt wallet.create_new_address(False)
            ^
SyntaxError: invalid syntax

Let me know what version of electrum you are using?

The reason for the error is that the console is a sort of pseudo Python console... Python relies on "indentation" to form code blocks... so you need to indent the "print" statement for it to be considered part of the "for x in range" statement:

Code:
for x in range(0, 50):
    print wallet.create_new_address(False)

Note the extra spaces at the beginning of the print line! This is why you need to be very careful when using copy/paste on Python code... it can lead to unexpected results... you should always copy/paste each line (including the leading whitespace!!) one at a time...

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Mbidox (OP)
Full Member
***
Offline Offline

Activity: 212
Merit: 108


View Profile
July 19, 2017, 03:05:00 PM
 #8

Thank you.

Remember to restart electrum afterwards because the extra addresses won't show without a restart.

I found out, that it is not enough to close the Electrum account in which I generated the additional addresses, if there is at the same time still another account open. I have to close all open accounts before I restart.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!