Easy tricks in using cryptocurrency
How to make your own cryptocurrency basically is not so difficult, considering his own bitcoin is an open source. So far there have been thousands of types of crypto besides bitcoin, or known as Altcoin. Most of them are also not made from scratch, but rather take the same source code comes from bitcoin, then lowered into other types again.
While most of the others are in the form of a token, which is built above a certain blockchain. Though indeed there have been thousands of types of altcoin, apparently will remain a crypto names popping up recently, and continues to grow. People in the world seem so enjoy how easy it is to make money of their own versions, after the spaces were monopolized and manipulated by the world's central banks. They consecrate him as the ruler of gods creation of currency.
What happens if everyone in the world to make its currency? Where the position and role of the central bank later? Something like that is an idea that needs to be the prologue on this occasion. Rather than makin:D digress, let's try to start a discussion about how to make your own cryptocurrency.
As explained at the beginning, that of the thousands of types of crypto, most much taking from existing source code. In this discussion, we will utilize the existing source code. However, such means remains a good starting point to try to identify more in depth about cryptocurrency, bitcoin specifically, because it has become the world's bodyguard cryptocurrency.
Souce code we take later is Litecoin version 0.8, the reasoning, because it is still simple, and yet complex as today. For those who've been coding experience, maybe blockchain with C # programming reference can be useful for further exploration could.
Do not be taken seriously, because this is just the nature of the discussion, rather than aiming to make the new crypto like in General. Prepare snacks, coffee, because the process would take time which is pretty long. Yuk, let's start.
Part one – Install All the required Dependency
These dependencies are files needed when we want to install something. So how to make your own cryptocurrency this went smoothly, certainly require many dependency is required. Just go ahead, open a terminal in ubuntu, and then paste the following commands one by one:
sudo apt-get install git sudo apt-get install build-essential autotools-dev automake libtool pkg-config libevent-dev libssl-dev bsdmainutils sudo apt-get install libboost-dev libboost-system-filesystem-dev libboost-dev libboost-chrono-program-options-dev libboost-test-dev libboost-thread-dev sudo apt-get install libboost-all-dev sudo apt-get install software-properties-common sudo add-apt-repository ppa: bitcoin/bitcoin sudo apt-get update sudo apt-get install libdb-dev 4.8 4.8 libdb ++-dev sudo apt-get install libminiupnpc-dev sudo apt-get install libzmq3-dev sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler.
If you ask why we need a repository bitcoin? Correct, because Litecoin did indeed come from the same source, Bitcoin. Further we will find out for yourself how this Litecoin would not be much different with Bitcoin, besides some basic consensus that distinguish, as total supply and some other things.
Forward again the process by starting the clone Litecoin 0.8 version source code on github. To make it easier, we recommend that you save the file in the Litecoin folder of the clone Desktop on ubuntu you use. Paste the command below:
If (fTestNet) { block. nTime = 1518545988;
Next to timestamp mainnet enter on line 2794 (above testnet)
Next, remove the hash value of the root line 2809 markle so it becomes like this:
assert (hashMerkleRoot == block. uint256 ( "0 x "));
Save file main. cpp you.
Search for Hash Freitas Root Genesis a Valid Block
If it is, then the next try mengcompile returned to generate hash Freitas root genesis a valid block.
Do I still remember isn't it? The Paste command is a just like below:
make-f makefile. unix
The process may take time to 10-20 minutes. If the compile process is complete and successful, proceed with running the daemon your crypto cores. The later process will not succeed, because it is his goal to get valid root hash Freitas genesis block us. Make sure you are in the folder/ebina/src (Customize with your folder), and then type the following command:
./ebinad (adjust the name + d)
If you already got a report error "Aborted (core dumped) then in the debug file will automatically generate .log merkle hash a valid root. So you can just see it in the file debug. log that was in the folder. ebina.
You can press CTRL + h to display the file-system file or hidden. Open the file and look at the bottom line.
Bottom line, the part that is your root merkle hash is valid. You can use a hash to the hash that Freitas root block genesis you. See the image below:
Copy the lines of a hash of it, and then paste it in line 2809 file main. cpp you. Then save the file.
Setting up Block Genesis Testnet and Mainnet
Copy and paste the code below, right in the line of 2803 file main. cpp you (under the timestamp testnet).
if (true && block.GetHash() != hashGenesisBlock) { printf("Searching for genesis block...\n"); // This will figure out a valid hash and Nonce if you're // creating a different genesis block: uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256(); uint256 thash; char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
loop
{
#if defined(USE_SSE2)
// Detection would work, but in cases where we KNOW it always has SSE2,
// it is faster to use directly than to use a function pointer or conditional.
#if defined(_M_X64) || defined(x86_64) || defined(_M_AMD64) || (defined(MAC_OSX) && defined(i386))
// Always SSE2: x86_64 or Intel MacOS X
scrypt_1024_1_1_256_sp_sse2(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#else
// Detect SSE2: 32bit x86 Linux or Windows
scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#endif
#else
// Generic scrypt
scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#endif
if (thash <= hashTarget)
break;
if ((block.nNonce & 0xFFF) == 0)
{
printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
}
++block.nNonce;
if (block.nNonce == 0)
{
printf("NONCE WRAPPED, incrementing time\n");
++block.nTime;
}
}
printf("block.nTime = %u \n", block.nTime);
printf("block.nNonce = %u \n", block.nNonce);
printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());
}
The function of the code above is to be able to generate or generate a timestamp, the genesis and hash nounce block valid, while later we run our crypto core daemon. Because there are two genesis both on testnet nor mainnet, then we delete the first hash value genesis block who has been there (on testnet and mainnet).
Genesis the first block hash we delete the first in its line of 2749 testnet file main. cpp. Delete the value hashnya be something like this:
hashGenesisBlock = uint256 ( "0 x ");
Then also delete the next hash value block genesis mainnet at line number 38 (upper part). If already, save the file again, and then retry to compile it again.
Genesis Block Testnet
If compile it successfully, try running the daemon your core in advance testnet. Make sure you are inside the folder ebina/src, and then type the command like this:
./ebinad-testnet
Later you will receive a notification message error, and then open the file debug. log that is in the folder testnet3.
Search inside the testnet log debug., which looks like this:
nTime = 1518545988 block. block. nNonce = 386296394 block. GetHash = 7ae6f691f4809e42faf40be7beb937e1d3aa5735c51d1d586c49f385be95c6c6
Description:
386296394---> nonce value valid block genesis testnet you
7ae6f69xxxx--> hash value valid block genesis testnet you
Next you enter the nonce sojourn and hash block the testnet genesis on a location previously we delete appropriately. Don't get wrong, if wrong, later the build process will not succeed, because there is no block valid genesis.
Location detail information block genesis testnet is on line at 2749 on your cpp files main.php. While the location of the nonce and timestamp genesis block you are in row 2801. Save the file, then compile it again.
Genesis Block Mainnet
Repeat the previous step on mainnet, with commands./ebinad (Customize with your core daemon file name, without the "-testnet"). Wait for it to come out error messages, and then open the file debug. log your mainnet. Search similar line displays information about nonce and hash block, then paste in block genesis mainnet you.
Location hash block genesis mainnet is on line number 38 cpp file main.
Location of nonce block genesis mainnet located on line 2796
The latter need to change in the file main. cpp is replacing the value "true" to "false" in the extra code we put earlier in the file main. cpp. Search only "if (true & & block. GetHash ()! = hashGenesisBlock) ", change the value to true become false in that line.
Modify Data information Checkpoints. cpp
The next step, is to change the data in the file information checkpoints. cpp. Open the file in the/src
folder, and then navigate in lines 38, then replace as below:
(0, uint256 ( "0 xHASH BLOCK GENESIS MAINNET YOU"))
Continue below to become like this:
staticconst CCheckpointData {data = & mapCheckpoints, 1518546021,//<--REPLACE with TIMESTAMP MAINNET YOU 0,//* CONTENTS of ZERO // 1.0//* REPLACE SUCH };
The last checkpoint information also change in accordance with the information of the timestamp, nonce, and hash genesis block for your testnet. Customize with genesis information block testnet you you replace in the file main. cpp. Less PC that will look like this after everything changed.
Compile it.
Save all the files again. If you want to change a lot of things like image design for wallet, icon, and other images, you can edit it yourself in/src/qt/res. folder if it already, now living the last compile run. Make sure you are in the folder/ebina (Customize with your folder).
This time, try to run the compile command like this:
qmake make
Continue with running your core first in testnet. Type the following command:
./ebina-qt -testnet
To run it on, type the following command mainnet:
./ebina-qt
On other occasions, we will discuss the follow-up to the process of mining, and connect with other clients. Hopefully the discussion of how to make your own cryptocurrency this can make you more understand the workings of the bitcoin and cryptocurrency in General. So what if everyone in Indonesia make currency kriptonya own?