Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: AlexMerced on April 25, 2013, 12:09:18 PM



Title: Code Editing Questions
Post by: AlexMerced on April 25, 2013, 12:09:18 PM
I'm editing the SmallChange source code which is a liteocoin fork, I'm following the exact changes made to the litecoin source as shown here:

https://github.com/bfroemel/smallchange/commit/947a0fafd8d033f6f0960c4ff0748f76a3d58326



I ran into this piece of code and it raised a few questions...

  // Try a dual IPv6/IPv4 socket, falling back to separate IPv4 and IPv6 sockets
     const bool loopback = !mapArgs.count("-rpcallowip");
     asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any();
-    ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 9332));
+    ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 9031));
 
     boost::signals2::signal<void ()> StopRequests;
 
@@ -3165,7 +3165,7 @@ Object CallRPC(const string& strMethod, const Array& params)
     asio::ssl::stream<asio::ip::tcp::socket> sslStream(io_service, context);
     SSLIOStreamDevice<asio::ip::tcp> d(sslStream, fUseSSL);
     iostreams::stream< SSLIOStreamDevice<asio::ip::tcp> > stream(d);
-    if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", "9332")))
+    if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", "9031")))
         throw runtime_error("couldn't connect to server");


- Do I have to create a server?, I thought these currencies were decentralized
- If so do I need a static IP, or can I change "9031" to anything?




Second Question:

I want the currency address codes to start with the letter H, here is the code to change it but I can't find a table showing which numbers correspond with which letter:

-        PUBKEY_ADDRESS = 48, // Litecoin addresses start with L
+        PUBKEY_ADDRESS = 62, // addresses start with S


Title: Re: Code Editing Questions
Post by: kjj on April 25, 2013, 04:27:31 PM
The server mentioned is the RPC server that lets you interact with the daemon.

9031 is just the default port.  You can change it, and probably should.  The rpcport option in the config file or on the command line will override your default port either way.

Either 40 or 41 will give an initial character of H.


Title: Re: Code Editing Questions
Post by: AlexMerced on April 25, 2013, 04:55:42 PM
super thanks, does it matter what I change the port number too, could i just add 1 to it.


Title: Re: Code Editing Questions
Post by: kjj on April 25, 2013, 05:10:04 PM
It doesn't matter a whole lot.  You will want to avoid ports that people might be using for other things.  Most things based on the bitcoin source use two sequential ports, so you may want to go up by at least 2, and change both.


Title: Re: Code Editing Questions
Post by: AlexMerced on April 25, 2013, 07:49:52 PM
sweet thanks, can the same code be used to compile for unix/pc/windows

I have a windows PC, but I think this smallchange code was originally compiled for unix, didn't know if there was something I need to different if I plan on compiling it for a windows client.

Like the code doesn't scare me more than compiling it later does.