Ethereum installation and go language environment configuration
a total of 22 weeks, divided into five stages,
the first stage is 4 weeks, go language foundation and network concurrency, learning the introctory go language,
the second stage is 4 weeks, go language practical web development, crawler development, cryptography, consensus algorithm, realizing lightweight public chain, learning the website and crawler that can develop golang, Achieve lightweight blockchain
stage 3, 4-week Ethereum source code analysis and smart contract DAPP development, master Ethereum core and smart contract development, as well as blockchain,
stage 4, 4-week super ledger, bitcoin EOS, source code analysis and smart contract practice, master super ledger development, cat bitcoin, bifurcated EOS after learning, As well as DAPP development of smart contract
phase 5, 6-week project practice, five enterprise level projects, and one year of blockchain project experience after learning
from the characteristics of the language itself, go is a very efficient language, which highly supports concurrency. Go language itself pays more attention to distributed system, and concurrency processing is relatively good, such as advertising and search, That kind of high concurrency server
go language advantages:
excellent performance, can be directly compiled into machine code, does not rely on other libraries, go is extremely fast. Its performance is similar to Java or C + +
concurrency is supported at the language level, which is the biggest feature of go. It is born to support concurrency, and go is the concurrency supported in gene, which can make full use of multi-core and make it easy to use concurrency
the built-in runtime supports garbage collection, which is one of the features of dynamic language. Although GC is not perfect at present, it is enough to cope with most of the situations we can encounter, especially GC after go1.1
it's easy to learn. The authors of go language all have the gene of C, so go naturally has the gene of C. There are 25 go keywords, but the expressive ability is very strong. It almost supports most of the features you've seen in other languages: inheritance, overloading, object, etc
rich standard libraries, go has built a large number of libraries, especially the network library, which is also my favorite part< As like as two peas, br / > built-in powerful tools, Go language is built with many tools chain, the best should be gofmt tools, automatic formatting code, make team review become so simple, code format is exactly the same, it is very difficult to think differently.
cross platform compilation and fast compilation. Compared with the sluggish compilation speed of Java and C + +, the fast compilation time of go is a major efficiency advantage
disadvantages of go language:
package management: package management of go language is absolutely not perfect. By default, it has no way to make a specific version of the dependency library, nor can it create replicable builds. In contrast, python, node and Ruby all have better package management systems. However, with the right tools, the package management of go language can also perform well
lack of development framework: go language does not have a major framework, such as Ruby's rails framework, Python's Django framework or PHP's laravel. This is a heated discussion in the go language community, because many people think that we should not start with using frameworks. This is true in many cases, but if you just want to build a simple crud API, it's much easier to use Django / djrf, rails laravel, or Phoenix
exception handling: go language can help developers deal with compilation errors by simply returning errors (or call stack) through functions and expected calling codes. Although this method is effective, it is easy to lose the scope of the error, so it is difficult to provide meaningful error information to users. Error package can solve this problem by allowing us to add context and stack trace to return error
another problem is that we may forget to handle errors. Static analysis tools such as errcheck and megacheck can avoid these errors. Although these solutions are very effective, they may not be the right way.
as the name suggests, the first thing is to install go. Here are very detailed installation instructions, http://code.google.com/p/golang-china/wiki/Install perhaps http://golang.org/doc/install (golang.org goes to find hosts on its own). The official version of windows has been supported by
downloading and decompressing configuration environment variables
"environment variables" (my computer - & gt; Advanced system settings - & gt; Under the label of system variable, create and edit the following key value pairs in turn:
(1). New variable name: Gobin variable value: C: 92; go\ Bin
(2). New variable name: goarch variable value: 386
(3). New variable name: goos variable value: Windows
(4). New variable name: goroot variable value: C: 92; Go
(5). Edit path and add% Gobin%
1 at the end of the variable value of path. Download sublime text 2 at the following address: http://www.sublimetext.com/
2. After decompression, double-click sublime_ Text, you can use sublime text 2<
crack:
Edit sublime with WinHex_ text_ Backup.exe file, jump to the line 000cbb70, change 8A C3 to B0 01, and then save
successful crack registration
3. Install package control, after opening sublime text 2, press the shortcut key Ctrl + ', open the command window line (specifically in view show console), and enter:
Import urllib2, OS; pf=’Package Control.sublime-package’; ipp=sublime.installed_ packages_ path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_ opener(urllib2.build_ opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),’wb’).write(urllib2.urlopen(‘ http://sublime.wbond.net/ ’+pf.replace(‘ ‘,’%20′)).read()); Print 'Please restart sublime text to finish installation'
4. After restarting sublime text 2, you can find that there is an additional menu item package control in the Preferences menu
5. Now the gosublime plug-in is installed. Press and hold Ctrl + shilft + P, a dialog box will pop up. Enter install and enter to pop up an installation package dialog box
as above, enter gosublime and select gosublime and enter
this machine has been installed, so there is no option, Enter go build and select enter (this is optional)
to install gosublime successfully
6. Install gocode below,
first install git-1.7.11-preview20120710
open the console, Enter the following content:
go get github.com/nsf/gocode
go install github.com/nsf/gocode
go get github.com/disposaboy/margo
go install github.com/disposaboy/margo
you can also download it from GitHub https://github.com/nsf/gocode.git (to install Google's git version management tool)
after installation, We can find that there are more gocode files in the go / bin directory Modify gosublime configuration: under the Preferences menu, find package settings, then go to gosublime, and then go down to settings – default. In the open file, add the following configuration and save it:
& quot; env": {& quot; path":& quot; c:/go/bin;& quot; },
OK, so far, the development environment has been built
you can program freely. Ha ha
press the shortcut key Ctrl + B, and the following interface will appear at the bottom of the interface:
OK, by now, the development environment has been built<
the following contents can still be used if I don't use them:
sublime text 2 compilation configuration setting method
tools - & gt; build system-> New build system creates a new configuration file set to
{
"CMD": [& quot; go", & quot; run", & quot;$ file_ name"],< br />
“file_ regex”: “^[ ]*File \”(…*?) 92;”, line ([0-9]*)”,
“working_ dir”: “$file_ Path ",
" selector ":" source. Go "
}
then you can compile it with Ctrl + B and save it
-
download the zip file of go. And be sure to unzip the file to the C: go directory
-
configure advanced environment variables of windows. Including: goroot, goos, Gobin, goarch. In addition, in the path variable, add C:: ﹣ go ﹣ bin. So that you can run the go command directly from the command line
-
after completing the configuration of environment variables, open a command line window, directly enter go, and then press enter to see if the help information of go appears. If so, the basic environment of go is OK
-
(optional) in order to support import remote package, it is better to install gomingw. If the next is a compressed package, please unzip it to disk C. For example, C:: Gowin env. There is a console.bat, which is the environment to use go get in the future
go source code installation: This is a standard software installation method. For users who often use UNIX like systems, especially for developers, you can customize the installation from the source code
go standard package installation: go provides a convenient installation package, supporting windows, Linux, MAC and other systems. This method is suitable for fast installation. You can download the corresponding installation package according to your system number, and you can easily install it all the way to next** Recommend this method * *
third party tool installation: there are many convenient third-party package tools, such as apt get in Ubuntu, homebrew in MAC, etc. This installation method is suitable for those who are familiar with the corresponding system.
like all software installation packages, go language compilation and installation also need to accept the license agreement. Click the selection box in the red circle in the figure, agree to the license agreement, and then click "next"
in this step, you need to change the installation directory of go. By default, go is installed on disk C. too many files in Disk C will affect the system performance. Click the "change" button shown in the red circle to open the installation directory selection dialog box
in this dialog box, you select the directory where you want to install the go compiler. After selection, the directory you selected will be displayed in the red circle. If it is not the directory you expected, you can reselect it, and then click OK. The dialog box will return to the third step dialog box, but the directory and the directory you just selected will be changed, In this dialog box, click the "next" button
this step starts to install the go compiler. Click the "Install" button, and the system will automatically install the go compiler to the directory you just selected
if there is no accident, the installation program starts the file and displays the current angle in the form of progress bar. Generally, the installation will be finished in about 5 minutes
when the following interface appears, the go compiler has been installed. Click the finish button to end the installation
to configure some environment variables after installation, first put the bin directory under the go installation directory into the path environment variable<
next, create a gopath environment variable, which is very important. The code I wrote myself should be put into the directory configured in this variable, and then go compiler will find and compile
continue to create a root variable to cooperate with the directory installed by go compiler
after completing the steps, open the command line go verison and enter. If the configuration is correct, the go compiler version information will appear, as shown in the red circle in the figure below.
