Cryptocurrency All-in-One For Dummies. Peter Kent
Чтение книги онлайн.

Читать онлайн книгу Cryptocurrency All-in-One For Dummies - Peter Kent страница 42

Название: Cryptocurrency All-in-One For Dummies

Автор: Peter Kent

Издательство: John Wiley & Sons Limited

Жанр: Личные финансы

Серия:

isbn: 9781119855828

isbn:

СКАЧАТЬ alt="Remember"/> Cryptocurrency can be in the regulatory gray zone in certain countries, and illegal in other countries. For example, in September 2021, China banned all cryptocurrency mining and transactions. On the flip side, El Salvador installed Bitcoin as an official currency! Buying and withdrawing cryptocurrency may not be available in the future or within your country or region. If that’s the case, you may want to move on to Chapter 5 of this minibook. There, you’ll be able to mine on the test net and receive test Ether.

      Private blockchains hold the promise of having both the benefits of a private database and the security of blockchains. The idea is most appealing for two reasons:

       Private blockchains are great for developers because they allow them to test ideas without using cryptocurrency. The developers’ ideas can remain a secret as well, because the data has not been published publicly.

       Large institutions can capitalize on the security and permanence of blockchain technology without their transactions being public the way they are in traditional blockchains.

      

Most of this minibook assumes you’re just finding out about blockchain for the first time and have little to no programming skills, but this section requires some knowledge of GitHub, Docker, and how to use your computer’s terminal. If you need a quick recap on coding before you dive in, Coding For Dummies by Nikhil Abraham (John Wiley & Sons, Inc.) provides a great overview on coding for nontechnical people. If you don’t plan to ever be hands-on with blockchain technology, you might want to skip the rest of this chapter.

      In this section, you dive into building your first blockchain. You build it in two steps. The first step is to prepare your computer to create your private blockchain. Don’t worry — it’s made easier with tools from Docker and work that has been done by talented developers on GitHub. The second step is building your blockchain inside your Docker terminal.

      Preparing your computer

      You need to download some software on to your computer in order to try this blockchain project. Start by downloading Docker Desktop. Go to https://www.docker.com/get-started to download the correct version for your operating system.

      Next, download GitHub Desktop from http://desktop.github.com. After you’ve installed GitHub Desktop, a pop-up screen asks you if you want to sign in to GitHub.com (if you already have an account). If you’re new to GitHub, click Create Your Free Account.

      Now you need to create a place to store your blockchain data. Create a folder on your computer’s desktop called ethereum. You’ll use this folder to hold your future repository and other files. After you sign in or create a new GitHub account, GitHub Desktop presents you with a Let’s Get Started welcome screen. Click Create a New Repository on your Hard Drive, and then follow these steps to complete the process:

      1 Name your repository ethereum, and give it a description of your choosing.

      2 Point the Local Path to your desktop’s ethereum folder.

      3 Click the Create Repository button.

      4 Return to your web browser and go to www.github.com/Capgemini-AIE/ethereum-docker.You see the page shown in Figure 3-1.

      5 Click the Code button.You’re given three choices: Clone, Open with GitHub Desktop, or Download Zip (see Figure 3-2).

      6 Select the Open with GitHub Desktop option.The GitHub Desktop application reopens.In the GitHub Desktop application pop-up window, make sure the Local Path points to the project folder ethereum that you created on your desktop, and then click Clone.

Snapshot shows Navigate to this page at GitHub.

      FIGURE 3-1: Navigate to this page at GitHub.

Snapshot shows Open with GitHub Desktop.

      FIGURE 3-2: Open with GitHub Desktop.

      Building your blockchain

      You’re going to use the free Docker Desktop tool to build your blockchain. This tool gives you access to a virtual machine, cutting down the time required to set up and debug your system. Because of these features, it lets you create a stable environment for your blockchain, so you don’t have to worry about the settings on your machine, and you can get up and running faster.

      Follow these steps:

      1 Launch Docker Desktop on your computer. The Docker Desktop application launches a terminal you will use to build your blockchain.

      2 Change directories in the terminal to ethereum.The files you create making the new blockchain will go into the desktop file you made in the preceding section. You need to give a command to your computer’s terminal in order to change directories. If you’re on a Mac or running Linux, enter the following command:cd ~/Desktop/ethereum/ethereum-docker/If you’re on a PC, enter the following command:cd ~\Desktop\ethereum\ethereum-docker\ If these commands don’t work for some reason, search the web for tutorials that explain how to change directories for your type of system.Now you can utilize the Ethereum–Docker files.

      3 Create one stand-alone Ethereum node by entering the following command into your terminal: docker-compose -f docker-compose-standalone.yml up -dThis one line of code creates the following:One Ethereum bootstrapped containerOne Ethereum container that connects to the bootstrapped containerOne Netstats container with a web UI to view activity in the cluster

      4 Take a look at your new blockchain by opening a web browser and going to http://$(docker-machine ip default):3000.

      Congratulations! You’ve built your own private blockchain. If you’re so inclined, say a word of thanks to Graham Taylor and Andrew Dong, who put a lot of time into creating the Ethereum–Docker integration.

      Beholding the Bitcoin Blockchain

      IN THIS CHAPTER

      

Understanding where the Bitcoin blockchain came from

      СКАЧАТЬ