Pages:
Author

Topic: Bitcoin-qt is not opening - page 2. (Read 940 times)

HCP
legendary
Activity: 2086
Merit: 4361
November 08, 2020, 12:53:27 AM
#35
AFAIR, I've read somewhere that it works in mainnet.
It's just that the difficulty is too high that it'll surely fail after the default 'maxtries' (1000000 iterations).
Yep, "no" realistic chance with Bitcoin, but with difficulty set to 1 on these custom coins, it will eventually find a block or 2 Wink


No mining scripts. Just generatetoaddress with 1 billion max tries. (I think)
Ah yes, that and a bit of patience finally resulted in a block being produced... however I'm in the same boat, the 2nd node seems like it has received the "header" at least... but doesn't seem to be retrieving or syncing the generated block...



EDIT: after mining a couple of subsequent blocks, it seems the 2nd node was able to sync up properly... and I'm now able to send transactions between the 2 etc. So maybe mine some more blocks and see if that kicks things into action for you Wink





Note: I also dropped the maturity time to 5 blocks as mining on the VMs is very slow and I couldn't wait for 100 blocks! Wink
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
November 07, 2020, 10:47:30 PM
#34
Fairly sure that the generatetoaddress command only works in "regtest" mode.
AFAIR, I've read somewhere that it works in mainnet.
It's just that the difficulty is too high that it'll surely fail after the default 'maxtries' (1000000 iterations).

I'll try to find the post (from a Bitcoin Core developer) and update this later.

-edit-

Found it: /index.php?topic=5227792.msg53894613#msg53894613
Thanks google search.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 07, 2020, 05:19:51 PM
#33
Out of interest, how did you mine that block? Did you have to setup a standalone "miner" of some description? Or did you just use the generatetoaddress option? Huh
No mining scripts. Just generatetoaddress with 1 billion max tries. (I think)
HCP
legendary
Activity: 2086
Merit: 4361
November 07, 2020, 05:06:17 PM
#32
Out of interest, how did you mine that block? Did you have to setup a standalone "miner" of some description? Or did you just use the generatetoaddress option? Huh
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 07, 2020, 07:28:19 AM
#31
I added my local ip and it connected. (192.168.2.3:7333)
So yeah, right now on the network traffic tab I can see that the devices are sharing information.

Question, how difficult is finding a block below the target with difficulty = 1?



Edit: I made it!



The problem I face now is that it hasn't shared to my laptop the information that I mined it... What could be the fault?  Huh
(Once I run getblockcount on laptop I get 0)
HCP
legendary
Activity: 2086
Merit: 4361
November 07, 2020, 07:06:19 AM
#30
The problem is that when I run addnode "xx.xxx.xxx.xxx:7333" "add" it returns me null. I'm sending you a video of it via PM.
That is the correct response... it should return null...

Do you then see the "xx.xxx.xxx.xxx" machine appear in the "peers" tab after you use the addnode command? Huh If you don't then you might need to look into the IP addresses you're using and/or the network settings.

From the video you sent me, it looks like you're using external IP addresses... if they're both on the same network and plugged into the same router, then I'd expect you should be using addresses that start 192.168.x.x or 10.0.x.x etc... they're the most common "private" network type addresses... Also, it's possible that the Windows firewall is just being stupid and blocking things Roll Eyes

I ran my 2 nodes on 2 Linux VMs, connected in a network as 10.0.2.4 and 10.0.2.5... when I used the following from the first VM:
Code:
addnode 10.0.2.5 add

It took only 2 or 3 seconds and the connection was made and I could see it listed in the "Peers" tab.


I still haven't been able to mine a block, despite spending hours trying to get cgminer/bfgminer "solo" CPU mining... neither of them seem to want to connect the node via RPC, despite the fact that bitcoin-cli works fine (even from the 2nd node across the network) Undecided
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 07, 2020, 05:27:35 AM
#29
I've done what you said. I don't get any peers now. So it's a new coin right now. I also tried to run bitcoin core on 2 different devices as you said (from 2 different ip addresses).



The problem is that when I run addnode "xx.xxx.xxx.xxx:7333" "add" it returns me null. I'm sending you a video of it via PM.
HCP
legendary
Activity: 2086
Merit: 4361
November 07, 2020, 12:16:40 AM
#28
So now, bitcoin-qt opens without any errors. I've several queries right now, though. First of all, I connect with nodes. That shouldn't happen. I've deleted all “vSeeds.emplace_back” lines. There are no IP addresses on my source code. I've also changed the message signature of mainnet to:
Although, Bitcoin Core sends information somewhere.


Will probably be all the "fixed seeds" in chainparamsseeds.cpp

Shutdown your custom Core app, then delete peers.dat. After that, in chainaparams.cpp, find the "vFixedSeeds" lines... and make sure they're all "vFixedSeeds.clear();"... then recompile and restart Bitcoin-qt.exe... you should see no "peers" on the peers tab in "Windows -> Peers":



Second question. Why am I considered as asynchronized? I haven't changed the satoshi's genesis block and in order to work I've set nMaxTipAge to a large value, so it can mine without thinking that the block is way too old. (bad grammar)

validation.cpp:
Code:
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE * 10000;
Because there aren't any "blocks" to sync if you just start up with the Genesis block... until a block is mined, there will be nothing to sync


Quote
Third question. Why I can't mine? Difficulty is 1. Does it have to do with the previous question that I'm not "synchronized"?


Fairly sure that the generatetoaddress command only works in "regtest" mode. You'll need to connect a 2nd node, and then setup a solo miner of some description to create a block before you'll see the nodes "sync".


legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
November 05, 2020, 07:15:37 AM
#27
--snip--
And I cloned P2Pool and setup my own mining pool..
What's the point of cloning one if it's a small project? People can mine from their pc via Core. It must be hard, but according to your posts, you are an experienced miner so it wouldn't be that bad.

It's the same point as everything else in your thread: a learning experience... The point of setting up a pool for such a cloned coin is exactly the same point as having a block explorer or an spv wallet... After all: you can easily parse those couple of blocks manually instead of using an explorer, and you don't need an SPV wallet if the total size of your blockchain is only a couple Mb...
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 05, 2020, 06:28:08 AM
#26
Did you manage to figure out why the Windows version just crashed immediately on startup? Was there anything registered in the Windows Error Log that might indicate why it was crashing? Huh
Yes, I've figured it out what was the fault weeks now. I just didn't reply to your last post. You were right, it was the checkpointData.

Instead of:
Code:
checkpointData = {
            {
               
            }
        };

I should do it:
Code:
checkpointData = {
            {
                { 0, uint256S("0x0")}
            }
        };

So now, bitcoin-qt opens without any errors. I've several queries right now, though. First of all, I connect with nodes. That shouldn't happen. I've deleted all “vSeeds.emplace_back” lines. There are no IP addresses on my source code. I've also changed the message signature of mainnet to:
Code:
pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;

Although, Bitcoin Core sends information somewhere.



Second question. Why am I considered as asynchronized? I haven't changed the satoshi's genesis block and in order to work I've set nMaxTipAge to a large value, so it can mine without thinking that the block is way too old. (bad grammar)

validation.cpp:
Code:
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE * 10000;

Third question. Why I can't mine? Difficulty is 1. Does it have to do with the previous question that I'm not "synchronized"?



And I cloned P2Pool and setup my own mining pool..
What's the point of cloning one if it's a small project? People can mine from their pc via Core. It must be hard, but according to your posts, you are an experienced miner so it wouldn't be that bad.
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
November 05, 2020, 05:15:52 AM
#25
--snip--
  • Create an altcoin core with bitcoin core source code.
  • Create an altcoin wallet using electrum source code.
  • Create a block explorer for the altcoin.
--snip--

A long time ago, i have created my own (private) coins for learning purposes... So it's defenately possible.
I stared with litecoin's codebase since at that time it still had the code for a cpu miner, so that made things easyer to find the first couple of blocks. I had that network running between a couple of home computers for weeks...

I also setup a block explorer... Can't remember which one tough... And I cloned P2Pool and setup my own mining pool..

IIRC, the whole thing took me about a week... Including adapting litecoin's codebase for my own "coin", compiling linux and windows binaries, setting up an explorer and a pool... But since it was a private project I never applied any updates or improvements.

Later on, i got fed up by the sheer amount of low-effort worthless altcoins flooding the market, so i made a proof-of-concept to prove anybody with some basic skills could push an altcoin to the market in a couple of hours, so i created mocacoin in a timespan of 3 or 4 hours (IIRC): https://www.mocacinno.com/mocacoin
It's based on monero's coinbase (or was it based on a clone of a clone of XMR... Don't remember)

So, if that's TL;DR; : sure, it's possible to create your own altcoin, as long as it's for learning purposes... an explorer: sure... a pool: sure.... electrum: sure (i haven't done this personally, but i don't see why not)...
HCP
legendary
Activity: 2086
Merit: 4361
November 04, 2020, 05:41:08 PM
#24
I admire your tenacity... you have a goal, and you're determined to reach it. So, kudos for that! Smiley

I guess the main problem you're likely to face is that, it's not just a quick "chain params" edit... as you have already discovered there are other factors at play like the ports used, version numbers etc. Obviously, with the proliferation of altcoins that have been spawned back in 2016-2017 etc, it clearly isn't a "mission impossible"... it'll just need a bit of work.

Did you manage to figure out why the Windows version just crashed immediately on startup? Was there anything registered in the Windows Error Log that might indicate why it was crashing? Huh
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 04, 2020, 04:52:22 PM
#23
otherwise it's like walking in the dark without a flashlight; you bump into things and it takes you longer to get to your destination.
You described it nice. Okay, I get that it needs time, effort and knowledge. As a beginner (about everything), I see the whole thing in a simple way, which is probably not. Changing few lines on chainparams.cpp and waiting that it's finished, could work in theory, but in action it is far from that. But how bitcoin's blockchain is the one that all nodes follow? Is it because of the pchMessageStart? If this change then am I a different node? A different "follower"?

"Anyone" is probably a bit of a stretch. Although given enough time and effort, most competent devs should be able to figure it out. It just probably won't happen "overnight".
I wrote a falsely phrase, you're right. What I wanted to say is that anyone is free to create a cryptocurrency. He can make it if he wants it! He doesn't have to spend money or take permission from a third party. Because, after all, bitcoin is just a bunch of code. Nothing special for the computer, but a huge step for mankind.

[1] yes, this is a terrible term... but it's early and I haven't had any coffee and my brain is still waking up Tongue
Good morning from Greece! Here it's 23:51. Going to sleep now.  Tongue
HCP
legendary
Activity: 2086
Merit: 4361
November 04, 2020, 04:32:45 PM
#22
There is no definite answer to your question, as a lot of it depends on things like:
- Your familiarity with cryptocurrency in general
- Your familiarity with C++
- Your familiarity with C++ software development methodologies and tools
- Your familiarity with the Bitcoin Core codebase
- Your familiarity with Linux
- Your familiarity with the various compilation tools and methods
- Your familiarity with cross-compiling Windows binaries on Linux

I'm sure that it would be relatively simple for one of the Bitcoin Core "main"[1] devs to rework the code to do exactly what it is you're trying to do. Someone with a "reasonable" level of C++ and the tools, but no experience with BTC or cryptocurrency in general, would probably be able to do it, but would most likely need a bit of time and research to figure out how to do it. You have admitted that your experience level in a number of the areas I've listed above is "low".

I just want to prove that anyone can create a cryptocurrency.
"Anyone" is probably a bit of a stretch. Although given enough time and effort, most competent devs should be able to figure it out. It just probably won't happen "overnight".



[1] yes, this is a terrible term... but it's early and I haven't had any coffee and my brain is still waking up Tongue
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
November 04, 2020, 04:22:24 PM
#21
There isn't even a complete list of consensus rules for Bitcoin (https://en.bitcoin.it/wiki/Protocol_rules comes close). Just figuring out the consensus rules and listing them all in one place is a full-time job for multiple people, and this applies to all altcoin projects, the serious ones of course.
That would be true if I wanted to create something completely different than bitcoin. I want to create a coin, following all the bitcoin rules but on a different chain. On a few words I want to remake bitcoin from block 1. I guess that since Bitcoin core or electrum are written in a way to follow the bitcoin's consensus rules, they can follow my coin's too.

I think that a "project" like that sounds simple enough. But is it? I thought that building bitcoin core (that reads a new blockchain), would be that easy but it seemed it wasn't.

Even if you're working on something where you don't have to worry about consensus rules, if you want to something like this to be accomplished quickly, and not slowly, you need to have:

- A couple hours you can spare each day for working on the project
- A fast workstation that doesn't make you wait so long for compilation to finish
- Lots of experience in C++ (or whatever language it's in), as in you need to have already written projects in it. There is no time to spend browsing language documentation.

And if you're modifying an existing project you also need to have studied the behavior of all the program variables at runtime, via debugging or some other means. I think you only read the source code about the chainparams.cpp file without attaching a debugger to a normal bitcoin-qt to see how the variables in that file are used in calculations which affect other variables. So before modifying a program you need to know how its internals work while it runs, at least for the section you are working on, otherwise it's like walking in the dark without a flashlight; you bump into things and it takes you longer to get to your destination.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 04, 2020, 04:06:02 PM
#20
There isn't even a complete list of consensus rules for Bitcoin (https://en.bitcoin.it/wiki/Protocol_rules comes close). Just figuring out the consensus rules and listing them all in one place is a full-time job for multiple people, and this applies to all altcoin projects, the serious ones of course.
That would be true if I wanted to create something completely different than bitcoin. I want to create a coin, following all the bitcoin rules but on a different chain. On a few words I want to remake bitcoin from block 1. I guess that since Bitcoin core or electrum are written in a way to follow the bitcoin's consensus rules, they can follow my coin's too.

I think that a "project" like that sounds simple enough. But is it? I thought that building bitcoin core (that reads a new blockchain), would be that easy but it seemed it wasn't.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
November 04, 2020, 03:54:43 PM
#19
Even if I've failed on creating my altcoin which would be exactly like bitcoin, I don't want to give up. I feel that I have to make it work! Probably, the above bitcoin experts that helped me on this thread must have made something similar in the past. So I would like to ask even if I get off-topic, do you consider difficult to do the following?

  • Create an altcoin core with bitcoin core source code.
  • Create an altcoin wallet using electrum source code.
  • Create a block explorer for the altcoin.

Should I keep trying succeeding on my "goal" or I'll get lost? There's nothing suspicious on why I want to do this. I just want to prove that anyone can create a cryptocurrency.

You are attempting to create two wallet softwares and a block explorer, that is definitely too much work to finish by yourself.

Software development bigger than simple programs is not a one-man job, it takes several people coordinating with each other to work on different parts of the program and continuously create updates for it when some of the developers are not available. Cryptocurrency software is no exception to the rule. In fact, there is more work involved in making a cryptocurrency than merely creating an open-source project because you need to decide on the consensus rules. Consensus rules are not clearly indicated in the codebase and are scattered all over the code. And if you don't make sure that your code follows your own consensus rules then you have a different altcoin from what you created, and it's difficult to diagnose the problem with a debugger.

There isn't even a complete list of consensus rules for Bitcoin (https://en.bitcoin.it/wiki/Protocol_rules comes close). Just figuring out the consensus rules and listing them all in one place is a full-time job for multiple people, and this applies to all altcoin projects, the serious ones of course.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 04, 2020, 03:35:07 PM
#18
Even if I've failed on creating my altcoin which would be exactly like bitcoin, I don't want to give up. I feel that I have to make it work! Probably, the above bitcoin experts that helped me on this thread must have made something similar in the past. So I would like to ask even if I get off-topic, do you consider difficult to do the following?

  • Create an altcoin core with bitcoin core source code.
  • Create an altcoin wallet using electrum source code.
  • Create a block explorer for the altcoin.

Should I keep trying succeeding on my "goal" or I'll get lost? There's nothing suspicious on why I want to do this. I just want to prove that anyone can create a cryptocurrency.
HCP
legendary
Activity: 2086
Merit: 4361
October 24, 2020, 03:13:30 AM
#17
My guess (without looking at the code) is that there is code that is attempting to reference something like checkpointData[0] or checkpointData[1] etc... and you've effectively set it as a null array... so any references to an index in the array will likely be generating an "array out of bounds" type error... EDIT: or maybe not... now that I think about it, C/C++ may not do array bounds checking? Huh I don't really remember, as I never did a lot of C/C++...


Did you check the Windows error log? Huh
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
October 24, 2020, 03:05:13 AM
#16
Update:

I forgot to mention some things that I change on chainparams.cpp. I changed only those little things and Bitcoin Core didn't start. Once I build it without making those changes it started successfully.

I set
Code:
checkpointData = { };
(on every checkpointData on chainparams.cpp)

I set
Code:
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000100010001");

In removed lines start with “vSeeds.emplace_back”.

Any ideas what's the fault?
Pages:
Jump to: