Spectrum Chain development Preparation-windows Environment cut pass test code, perform unit test

Source: Internet
Author: User

System Environment WIN10

Note: The installation process may be slightly different for different Windows release versions

Environmental dependencies:

Go, GCC

Go Download Address: https://golang.org/dl/

The author downloads the 1.10.2.64-bit version:

Full Download Address: Https://dl.google.com/go/go1.10.2.windows-amd64.msi

Installation:

The author installs the path to the C:\Go directory. Add the C:\Go\bin to the environment variable.

Go version is executed in any directory, and the installation configuration is successful when the version number is displayed.

C:\users\tangshua>go version

Go version go1.10.2 windows/amd64

MinGW Download Address: https://sourceforge.net/projects/mingw-w64/

I download the full GW download address: https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal% 20builds/mingw-builds/installer/mingw-w64-install.exe

Install MinGW:

The author installs in the D:\mingw-w64, after the installation completes as follows. Add the D:\mingw-w64\bin to the environment variable.

Spectrum installation

Download the source file

Https://github.com/SmartMeshFoundation/Spectrum

I put it on the D drive. Switch to the tests directory. Execute Go test-v


Other points:

To perform an error resolution:

1. Place the code in the Go directory.

C:\Go\src\github.com\SmartMeshFoundation\Spectrum

I found the following definition in the Block_test_util.go code, which may cause the corresponding class library can not be found and error.

Import ("bytes" "Encoding/hex" "Encoding/json" "FMT" "Math/big" "Github.com/smartmeshfoundation/spectrum/common" " Github.com/smartmeshfoundation/spectrum/common/hexutil "" Github.com/smartmeshfoundation/spectrum/common/math "" Github.com/smartmeshfoundation/spectrum/consensus/ethash "" Github.com/smartmeshfoundation/spectrum/core "" Github.com/smartmeshfoundation/spectrum/core/state "" Github.com/smartmeshfoundation/spectrum/core/types "" GITHUB.COM/SMARTMESHFOUNDATION/SPECTRUM/CORE/VM "" Github.com/smartmeshfoundation/spectrum/ethdb "" github.com/ Smartmeshfoundation/spectrum/params "" GITHUB.COM/SMARTMESHFOUNDATION/SPECTRUM/RLP ")

2. Create the TestData directory under the tests directory, and create it separately under the TestData directory

Blockchaintests,generalstatetests,transactiontests,vmtests,rlptests,basictests directory.

The author finds the following definition in the Init_test.go file:

var (baseDir = filepath. Join (".", "testdata") Blocktestdir = filepath. Join (BaseDir, "blockchaintests") Statetestdir = filepath. Join (BaseDir, "generalstatetests") Transactiontestdir = filepath. Join (BaseDir, "transactiontests") Vmtestdir = filepath. Join (BaseDir, "vmtests") Rlptestdir = filepath. Join (BaseDir, "rlptests") Difficultytestdir = filepath. Join (BaseDir, "basictests"))

But it was not found in the folder, so the folder was created manually.




Related Article

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.