Pages:
Author

Topic: Altcoins and Checkpoins? (Read 2173 times)

member
Activity: 87
Merit: 10
May 19, 2013, 03: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?
member
Activity: 87
Merit: 10
May 18, 2013, 06: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?
member
Activity: 87
Merit: 10
May 18, 2013, 02: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.
sr. member
Activity: 308
Merit: 250
May 18, 2013, 09:23:35 AM
#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).
member
Activity: 87
Merit: 10
May 18, 2013, 12: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?
full member
Activity: 196
Merit: 100
May 18, 2013, 12: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".
member
Activity: 87
Merit: 10
May 17, 2013, 11:29:55 PM
#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.
newbie
Activity: 28
Merit: 0
May 17, 2013, 07:45:28 PM
#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.
member
Activity: 87
Merit: 10
May 17, 2013, 07:25:30 PM
#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.
newbie
Activity: 28
Merit: 0
May 17, 2013, 06: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.
newbie
Activity: 28
Merit: 0
May 17, 2013, 05: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.
member
Activity: 87
Merit: 10
May 17, 2013, 03: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.
member
Activity: 87
Merit: 10
May 17, 2013, 01:36:01 PM
#20
The port #'s are specified in the init.cpp file correct?
newbie
Activity: 28
Merit: 0
May 17, 2013, 01:26:55 PM
#19
Does it matter what port # I change it to? Does it have to be specific or can I just change like the last number in the sequence and it will work?

Do enough research to be reasonably sure you're not using a port number from any other coin. If you're not sure pick a random one between 10000 and 20000 -- only two coins I'm aware of have used numbers in that range (worldcoin and one other coin I forget the name of), so if you pick it randomly you probably won't pick the same one. Testnet would be that port plus 10000. RPC port is that port plus one.
member
Activity: 87
Merit: 10
May 17, 2013, 01:26:27 PM
#18
Do I have to have separate computers or will it work with different VM's?
sr. member
Activity: 308
Merit: 250
May 17, 2013, 12:57:59 PM
#17
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.
member
Activity: 87
Merit: 10
May 17, 2013, 12:49:56 PM
#16
Do I have to put the port # after the ip?
sr. member
Activity: 308
Merit: 250
May 17, 2013, 12:41:23 PM
#15
To get the first 2 nodes to connect, you'll have to do it manually. Once two nodes connect you'll be able to mine. It takes a few more than 2 connections before peerdiscovery starts via IRC or at least that's my experience. Just add -connect=x.x.x.x using the ip of the other machine to the start up line on 2 or more machines. You can also do -addnode= or add addnode= to your .conf.
member
Activity: 87
Merit: 10
May 17, 2013, 12:35:13 PM
#14
Okay so I did that and managed to execute without any errors so that fine. I just seem to have problems actually connecting to the network. The IRC (fond in the debug.log file) keeps telling me that the connection timed out. Is there anything wrong or is this normal?

Also when I try and start my program with the -daemon to start the server and get my client to connect to it it doesn't actually do anything. It writes in the terminal "Neucoin server starting" and then quickly changes back to the normal terminal. Is this normal? Do I need to change anything? My client says that there are no active connections to the Neucoin network so it can't be working right?
sr. member
Activity: 308
Merit: 250
May 17, 2013, 09:12:26 AM
#13
testnet doesn't neef checkpoints; that's why I wondered. do you have a valid genesis block?

yes I do... at least I think I do... I don't get any errors when I start up the client so I assume I have one.

Ok, then if you have a valid genesis block, use the hash of it in your checkpoints.cpp as checkpoint 0 (it likely won't be in there, if you used SMC, block 1 is the root checkpoint, just change this to 0) rebuild your client and bob's your uncle.
Pages:
Jump to: