Bitcoin Forum
December 12, 2024, 02:00:32 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Altcoins and Checkpoins?  (Read 2176 times)
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 17, 2013, 08:19:18 PM
 #21

I'm going to be honest with you I thought the hardest part of making an altcoin was finding the genesis block.

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
arjay45
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 17, 2013, 10:49:10 PM
 #22

Well I am a professional software developer. I do this for a living. I wouldn't be worth much if I couldn't take something as well written as the bitcoin client and figure out how to modify it.

The main protocol port is in protocol.h in a function called GetDefaultPort. You should also change init.cpp so the help message matches the port you choose in the GetDefaultPort. That's for the protocol port.

The default RPC port is found twice in bitcoinrpc.cpp in calls to GetArg("-rpcport", ####) where #### is the default port of whatever coin you're using as the original source. Like the protocol port, it's mentioned in the help strings in init.cpp so should be changed there too.
arjay45
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 17, 2013, 11:11:00 PM
 #23

I also found where the magic number is in the code. main.cpp pchMessageStart defined around line 2439 or so just before the definition of ProcessMessage. You should change that to be different than any existing coins or bad things.

Basically this number will allow your coin to ignore protocol messages from other coins thus ensuring your coin's chain won't become infected with transactions and/or blocks from other chains by accident.

You should choose values that are extremely unlikely to occur in normal valid messages. It suggests values above 0x80 since values below 0x80 are valid ascii.

Choosing random values between 0x80 and 0xfe would probably be okay. It's very unlikely two coins will choose the same random numbers. I suggest the first number be between 0xf0 and 0xfe but it doesn't have to be.

The testnet magic number should be different from the normal net. The testnet magic number is set in LoadBlockIndex at the top I think. Also main.cpp.
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 18, 2013, 12:25:30 AM
 #24

I'd do this, assuming I have 2 computers on 2 IPs, lets say 1.1.1.1 (pc1) and 2.2.2.2 (pc2):

pc1: ~/coin/src$ coind -connect 2.2.2.2 &

pc2: ~/coin/src$ coind -connect 1.1.1.1 &

now you can do:

pc1: ~/coin/src$  coind getinfo

and you should see 1 connection, do it from the other pc and make sure they see each other. Once you have a listed connection do:

pc1: ~/coin/src$ coind setgenerate true 4

and then

pc1: ~/coin/src$ coind showmininginfo

and you should see it begin generating coins. At this point, you can now edit your .conf to have rpcallow=2.2.2.2 or whatever, and point cgminer/minerd at that ip.

I tried this. All I got was a "could not connect to server" error.

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
arjay45
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 18, 2013, 12:45:28 AM
 #25

put an equals sign between -connect and the IP. so -connect=1.1.1.1 -- also make sure the IP is actually the IP of the machine in question.
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 18, 2013, 04:29:55 AM
 #26

I did this and everything ran fine. But I cannot enter any commands... I enter neucoind -connect=#.#.#.# and nothing happens. Well not nothing but it just turns into a blinking cursor and it does not let me enter any commands.

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
May 18, 2013, 05:20:26 AM
 #27

If you're in windows that's normal for a *coind.exe

You need to leave one command prompt running the daemon, then you can open a separate command prompt to interact with it.

Once you have browsed to the same directory where the executable is then you can execute it with an RPC command and it will query the daemon.

So if you have that blinking cursor at one prompt you just open another and run it with the command "neucoind getinfo"

Or "neucoind help" for a list of other commands.


if you type neucoind help while the daemon is running you get a different response from when you type neucoind --help for information on how to run the program.  If the daemon is not in the expected state you should see an error.

also I think you have to add the -connect=*.*.*.* to eother the initial command or the .conf file, it's not something you can tell the daemon to do "on the fly".
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 18, 2013, 05:35:12 AM
 #28

put an equals sign between -connect and the IP. so -connect=1.1.1.1 -- also make sure the IP is actually the IP of the machine in question.

Alright so I did this (in two VM's though... with different IP's) and it seemed to run fine but when I run neucoin getinfo it tells me that I have zero connections? Did I do something wrong? Do I have to have two different computers?

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
shakezula
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250



View Profile
May 18, 2013, 02:23:35 PM
 #29

I haven't tried it in 2 VMs, but I'd think that it should work if the VMs can ping and route to each other. Make sure you can ping them and the ports you assigned your coin are open (i.e.: turn off ufw if you're using Ubuntu).
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 18, 2013, 07:39:00 PM
 #30

I haven't tried it in 2 VMs, but I'd think that it should work if the VMs can ping and route to each other. Make sure you can ping them and the ports you assigned your coin are open (i.e.: turn off ufw if you're using Ubuntu).

The two VM's can ping each other but I do not think they can route to each other.

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 18, 2013, 11:46:29 PM
 #31

So is there any way to check and make sure they can route to each other? If they can't how can I make them route / connect to each other?

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
joehop67 (OP)
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
May 19, 2013, 08:31:16 PM
 #32

Alright so I got it to work and everything is fine (except I cannot mine any of my coins but thats another question for another day.) I just have two more questions:

How many connects will I have to force until my client automatically connects to the network?
and
How can I force the connections without having to type -addnode after my client in the terminal?

1KmVXSbnjwtvxXKLGyD145CWJzZs6afkxL
Pages: « 1 [2]  All
  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!