Pages:
Author

Topic: Bitcoin-qt is not opening - page 3. (Read 910 times)

HCP
legendary
Activity: 2086
Merit: 4318
October 23, 2020, 04:03:32 PM
#15
Code:
Changing the ports won't stop you from interacting with the "original blockchain" (I believe you mean Bitcoin Mainnet). It's entirely possible to run Bitcoin Core using whatever port number you like.

There is even a runtime argument that allows you to change it
[code]
-port=  Listen for connections on (default: 8333, testnet: 18333, regtest: 18444)


While I understand that compilation can take a long time, have you tried making one code modification at a time to figure out which modification is actually breaking your build? Huh If you're not able to use the "Debug" option provided by that error dialog, have you checked the windows error log (after clicking "close program") to see if there is an error output there that gives any more details about the reason for the error? Huh


Also, with regards to your compilations taking a long time, are you using "make clean" every time you build or something? Huh Seems odd that making a change to one particular component should require a full rebuild. Huh

Note, after making a code change, the only build commands you should need from the "Building for Windows" docs are:
Code:
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications.
make
sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status" # Enable WSL support for Win32 applications.

You should not need to do all the other config every time you need to compile.


EDIT: just did a test... after the initial compile (which admittedly took quite a long time, but less than an hour)... I edited chainparams.cpp (changed the genesis block string):
Quote
user@pc:~/bitcoin$ date
Sat Oct 24 02:07:00 UTC 2020
user@pc:~/bitcoin$ make
Making all in src
make[1]: Entering directory '/home/user/bitcoin/src'
make[2]: Entering directory '/home/user/bitcoin/src'
make[3]: Entering directory '/home/user/bitcoin'
make[3]: Leaving directory '/home/user/bitcoin'
  CXX      libbitcoin_common_a-chainparams.o
  AR       libbitcoin_common.a
  CXX      libbitcoin_util_a-clientversion.o
  AR       libbitcoin_util.a
  CXXLD    bitcoind.exe
  CXXLD    bitcoin-cli.exe
  CXXLD    bitcoin-tx.exe
  CXXLD    bitcoin-wallet.exe
  CXXLD    test/test_bitcoin.exe
  CXXLD    bench/bench_bitcoin.exe
  CXXLD    qt/bitcoin-qt.exe
  CXXLD    qt/test/test_bitcoin-qt.exe
make[2]: Leaving directory '/home/user/bitcoin/src'
make[1]: Leaving directory '/home/user/bitcoin/src'
Making all in doc/man
make[1]: Entering directory '/home/user/bitcoin/doc/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/user/bitcoin/doc/man'
make[1]: Entering directory '/home/user/bitcoin'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/user/bitcoin'
user@pc:~/bitcoin$ date
Sat Oct 24 02:08:02 UTC 2020
user@pc:~/bitcoin$

So, only about a minute to recompile a modification... my advice is that you don't blindly use build commands without understanding what it is that you're doing... if you run that entire section of build commands every single time you make a change, you're redoing a lot of unnecessary stuff which would probably explain your long "build" times.[/code]
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 23, 2020, 02:54:10 PM
#14
I changed the message because I'm creating an altcoin. Should I leave it as it is? Won't it have any interactions with the original blockchain?

I doubt since I've changed the ports.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
October 23, 2020, 02:42:22 PM
#13
On chainparams.cpp I change the exact things:

nDefaultPort: Same procedure, wherever it has "8", I set it to "7".
pchMessageStart: I just change the message, nothing important. For example, for the mainnet I set it to:
Code:
pchMessageStart[0] = 0xf4;
pchMessageStart[1] = 0xb5;
pchMessageStart[2] = 0xb6;
pchMessageStart[3] = 0xd7;

I think it this has to do with downloading the original blockchain.


Sounds like this is what's making your build crash, the magic value is supposed to be the same for all nodes, or else other bitcoin nodes will discard as invalid your messages that have different headers, and all kinds of bugs can happen after unexpected message rejection.

In fact pooya87 told you about the magic constant in your other thread:

2) this 4 byte value is the fixed "magic" that is used at the beginning of every P2P message that is sent between the nodes as a simply indication of the network the nodes are on and to help the nodes find the beginning of the message inside the stream of bytes they receive over TCP.
MainNet, TestNet and RegTest use different "magic" values to make them distinct and help nodes disconnect immediately from another node that sends them messages from a different network (or by extension from a different copycat altcoin).
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 23, 2020, 08:02:10 AM
#12
Okay, I agree with you, I will post my changes. First of all I want to say that these are the commands I insert on Ubuntu 18.04 LTS to build the source code:
Code:
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications.
cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make

Let's go to the changes now. On chainparamsbase.cpp I change the ports. Wherever it has "8" I set it to "7". (e.g 8332 -> 7332).
On chainparams.cpp I change the exact things:

nDefaultPort: Same procedure, wherever it has "8", I set it to "7".
pchMessageStart: I just change the message, nothing important. For example, for the mainnet I set it to:
Code:
pchMessageStart[0] = 0xf4;
pchMessageStart[1] = 0xb5;
pchMessageStart[2] = 0xb6;
pchMessageStart[3] = 0xd7;

I think it this has to do with downloading the original blockchain.

On validation.cpp I change nMaxTipAge to be equal with DEFAULT_MAX_TIP_AGE * 4000. I do this to avoid changing the genesis block of my coin.

In consensus/consensus.h I change COINBASE_MATURITY = 10;

Then I save all 4 files with my notepad++, but because it changes permissions to the mentioned files I do sudo chmod 640 to pass this problem. I have made a thread about this issue.
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
October 23, 2020, 01:54:57 AM
#11
@mocacinno, it is now confirmed that there is some kind of mess during the code changes. I built Bitcoin Core (without any change) and it is normally opening. Once I make few changes on chainparams.cpp, chainparamsbase.cpp, consensus.h and validation.cpp I build it and the bitcoin-qt isn't opening. Do you propose me to do the same procedure on a virtual machine?

P.S: Is it normal or am I the only one that takes too long to compile the source code? Since I read your last post I started building the original source code. Then once I confirmed that it opens I tried with the changes and when it ended I started writing this post. One compilation takes about 2-3 hours.

I agree with NotATether, but wanted to give specific answers to these questions:

1) if you compiled the unmodified sourcecode and it works, but your modified sourcecode doesn't, it won't matter if you do a gitian build or build with visual studio...

2) i haven't done a gitian build in ages, nor do i usually build the qt gui (just the daemon). I haven't timed the time it needs to compile either, but 2-3 hours does sound like a long time... I guess my builds usually take less than 30 minutes (building linux binaries on linux, no gui).
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
October 22, 2020, 06:40:16 PM
#10
Whenever you get a Stop Working error in a Windows program, it means a C++ exception was thrown and nothing caught it so it broke up through the call stack and out of main(). So whatever change you made in the files broke Bitcoin Core and caused bitcoind to make an unknown exception, and bitcoin-qt probably caught the error and exited with a non-zero exit code which is why the window never opened.

If it didn't reach the statement/function that creates the Bitcoin folder in AppData, then the exception is thrown somewhere earlier than that statement.

You need to post the changes you made to each file so that we have a chance of knowing what is stopping the program from working.

Did you press debug to see if it came up with anything (though I don't think it normally does). You could try checking the event manage to see if there's anything in there.
I did. It showed me to debug it with visual studio 2017. Should it work if I do it?

Debug mode doesn't magically make programs work, it's supposed to be used by developers to trace control flow of the program and inspect variables.

If it turns out something went wrong during compilation, you could always try to follow above steps... Just run a local vm with the correct version of debian and follow all steps... I haven't executed a gitian build in a long, long time... But i guess it should still worked as described.
Ahh here we go again with the virtual machines... And I loved the Ubuntu 18.04 LTS on my Win10  Cheesy
I wish that it will work without installing any VMs.

Compiling bitcoin core on native Windows is possible if you have Visual Studio 2017 or 2019, and there are instructions at https://github.com/bitcoin/bitcoin/blob/master/build_msvc/README.md

P.S: Is it normal or am I the only one that takes too long to compile the source code? Since I read your last post I started building the original source code. Then once I confirmed that it opens I tried with the changes and when it ended I started writing this post. One compilation takes about 2-3 hours.

I haven't personally compiled Bitcoin core but if it usually takes this long to compile, then messing with a few constants and functions does not change the compilation time at all. So chances are that's a completely normal time.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 22, 2020, 02:17:09 PM
#9
@mocacinno, it is now confirmed that there is some kind of mess during the code changes. I built Bitcoin Core (without any change) and it is normally opening. Once I make few changes on chainparams.cpp, chainparamsbase.cpp, consensus.h and validation.cpp I build it and the bitcoin-qt isn't opening. Do you propose me to do the same procedure on a virtual machine?

P.S: Is it normal or am I the only one that takes too long to compile the source code? Since I read your last post I started building the original source code. Then once I confirmed that it opens I tried with the changes and when it ended I started writing this post. One compilation takes about 2-3 hours.
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
October 22, 2020, 08:38:24 AM
#8
--snip--
Ahh here we go again with the virtual machines... And I loved the Ubuntu 18.04 LTS on my Win10  Cheesy
I wish that it will work without installing any VMs.

It might work... But in your case you're not 100% certain why your current build doesn't work... Personally, i wouldn't add to many unknown factors to the mix. If you follow their walktrough to the letter, you *should* end up with working binaries (at least, this was the case the last time i tried a gitian build).
If you start messing with linux natively under windows, and your build doesn't work, you'll never know if it is because you didn't follow the walktrough, or because you messed up the codechanges Smiley
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 22, 2020, 08:32:06 AM
#7
Did you try to compile before you started messing with the code? If not, i'd probably start there: see if you can clone the git repo and build core without any code changes... If it works: you messed up when changing the sourcecode; if it doesn't work: you have to find out what went wrong during the compilation.
Here it worked like a charm. I haven't changed anything important since then. I'm going to compile the bitcoin core without any changes and if there are no errors I'll try building with my configuration again. I hope I'll find errors with the original building, because if I don't it means that my changes mess the compilation.

chkdsk is the windows utility to check your hdd.
I have ssd, not hdd so I guess that's not the fault.

If it turns out something went wrong during compilation, you could always try to follow above steps... Just run a local vm with the correct version of debian and follow all steps... I haven't executed a gitian build in a long, long time... But i guess it should still worked as described.
Ahh here we go again with the virtual machines... And I loved the Ubuntu 18.04 LTS on my Win10  Cheesy
I wish that it will work without installing any VMs.
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
October 22, 2020, 08:16:45 AM
#6
chkdsk is the windows utility to check your hdd.

Did you try to compile before you started messing with the code? If not, i'd probably start there: see if you can clone the git repo and build core without any code changes... If it works: you messed up when changing the sourcecode; if it doesn't work: you have to find out what went wrong during the compilation.

Personally, i've crosscompiled core a couple of times in the past (eventough i now stopped running core on my work laptop, so i don't need the windows binary anymore). I usually did a gitian build: straightforeward and worked allmost always...

https://github.com/bitcoin-core/docs/blob/master/gitian-building.md

If it turns out something went wrong during compilation, you could always try to follow above steps... Just run a local vm with the correct version of debian and follow all steps... I haven't executed a gitian build in a long, long time... But i guess it should still worked as described.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 22, 2020, 08:07:40 AM
#5
Did you press debug to see if it came up with anything (though I don't think it normally does). You could try checking the event manage to see if there's anything in there.
I did. It showed me to debug it with visual studio 2017. Should it work if I do it?

Have you run chkdsk recently or had any other apps not work?
What is chkdsk? No I don't think so. Is there any way to find out?
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
October 22, 2020, 07:25:35 AM
#4
Bitcoind is the command line version of bitcoin core. They're essentially the same thing but one's a gui to help people understand how to use it.

Did you press debug to see if it came up with anything (though I don't think it normally does). You could try checking the event manage to see if there's anything in there.

Have you run chkdsk recently or had any other apps not work?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 22, 2020, 07:20:42 AM
#3
You're probably going to have to just reinstall it.

Can you launch it from the command line or try running it as an administrator (right click and run as admin)?


If that again doesn't work, you could try running the daemon (bitcoind) from the command line and also try "bitcoind - help" to see if the help screen loads.

The problem is that I've already reinstalled it. I have tried both command line and run as administrator. Once I open bitcoind.exe it stops working:



What is bitcoind used for?
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
October 22, 2020, 07:09:51 AM
#2
You're probably going to have to just reinstall it.

Can you launch it from the command line or try running it as an administrator (right click and run as admin)?


If that again doesn't work, you could try running the daemon (bitcoind) from the command line and also try "bitcoind - help" to see if the help screen loads.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 22, 2020, 07:06:24 AM
#1
So I've build bitcoin core (with a few changes on chainparams.cpp etc) but it seems that it doesn't work. Here's a video: https://youtu.be/6eSQM5AeyBc

No "Bitcoin" folder has been created on AppData.
Pages:
Jump to: