Play on the CENTOS7 Ethereum block Chain (4): Preparation before experiment __ block chain

Source: Internet
Author: User
Tags dns2

on how to install TESTRPC, truffle, I assume that everyone has familiar, because there are a lot of block-chain teaching details on how to install and deploy ETH, truffle, and local contract tests on a single machine.

Here, we try to do a bit more interesting work by turning the entire test environment from a single point machine into a loose structure to explore how truffle works.


Next, we do two experiments in succession:

Experiment one: Deploy the TESTRPC to the Eth-host host and launch the ETH test Network service externally: http://eth-host:8545

Experiment two: Taking Webpack as an example, the intelligent contract is deployed on the Tru-host host (truffle), and the transfer service is provided externally: http://192.168.3.103:8080

After the completion of the above work, we actually estimate that we will have a clearer understanding of truffle.

Today, the construction of the experimental environment is completed first.


1. Deployment of Eth-host virtual machine

Host function: To build the virtual machine of the ether, for the Intelligent Contract Application server to provide the basis of books, bookkeeping and other basic Ethernet test network services.

(1) Virtual machine and network: VMware on the use of the simplest version of the CENTOS7 installation virtual machine can, after installation, for the convenience of LAN access, the virtual machine network is set to bridge the way.

Virtual machine Preparation can refer to: http://blog.csdn.net/xc70203/article/details/77983488

When this step is complete, the host is configured to:

ipaddr:192.168.3.102
gateway:192.168.3.1
dns1:8.8.8.8
dns2:114.114.114.114

(2) Configure host hosts: Define host names as Eth-host, as a reference to: http://blog.csdn.net/huangyanlong/article/details/45476569
To facilitate subsequent host access, add in the/etc/hosts file:

#当前本机名为eth-host
IP eth-host
# ready to deploy Tru-host host
192.168.3.103 tru-host
(3) Deploy ETHEREUMJS-TESTRPC and execute:
NPM install-g Ethereumjs-testrpc
After installation, direct execution:
Testrpc
You can start the ETH test Network Service with the initialization of 10 books.
(4) If you want to use a more flexible test network, you can directly deploy Geth, specific methods for details: http://blog.csdn.net/xc70203/article/details/77988473
After installing the Geth, start the way:
Geth--rpc--dev Console 2>> Geth.log
For Eth-host hosts, deployment Testrpc is the best choice for beginners, simplifying the creation of RPC services, accounts, unlock, miner-related series of operations. When it comes to geth, these actions are essential to creating a test network. So, everybody completes first (1) ~ (3) can.


2. Deployment of Tru-host virtual machine
Host function: Installs the deployment Dapp Intelligent Contract Application Server, provides the intelligent contract execution service for the Web service.
(1) Virtual machine and network: Using the CENTOS7 version with Gnome windows on VMware to install the virtual machine, the virtual machine network is set to bridge mode after the installation is complete. The configuration process can refer to the above not to repeat.
Attention: It is highly recommended that you deploy a centos7 with a desktop on the Tru-host, which can be a great convenience in the use of browsers in contract testing.
After the configuration is complete, the network parameters are as follows:
ipaddr:192.168.3.102
gateway:192.168.3.1
dns1:8.8.8.8
dns2:114.114.114.114

(2) Configuring host hosts:
#当前本机名为tru-host
IP tru-host
# deployed Eth-host host
192.168.3.102 eth-host
(3) Deployment of truffle projects:
Install truffle. A lot of previous Web site feedback said that the current latest truffle in the implementation of truffle serve will fail, it is recommended to downgrade the installation truffle@3.2.1. However, my test found that the most recent version of Truffle ran webpack without a bug (but the execution of truffle serve an error). So we can rest assured the installation of the latest version of the truffle to grope.
The installation method is as follows:

NPM Install-g Truffle
Once installed, create the work path t01 in the root directory and initialize the Webpack project:

CD && mkdir t01 && cd t01
truffle unbox webpack
When you are done, you should see the project directory structure as shown below.


After finishing the above work, the preparation of the experiment is finished.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.