Compiling and deploying smart contracts using truffle _ ether Square

Source: Internet
Author: User
1, first download and install truffle client npm install-g Truffle Truffle is an Ethernet square intelligent contract Development Framework 2, create a truffle project root directory, take D:\truffle\truffle_java as an example. Open the CMD command line tool and navigate to the Truffle_java directory. Executes the Truffle init command. A file with the following directory structure appears in the directory:-comtracts--migrations.sol-migrations--1_initial_migration.js-test-truffle.js- Truffle-config.js 3, compiling the intelligent contract we create an intelligent contract file Test.sol under the Contracts folder, and the file reads as follows: pragma solidity ^0.4.17; After saving contract Test {function multiply (uint a) public returns (UINT) {return a * 7}}, the truffle compile command truffle The smart contract files under the Acts folder are compiled into JSON in a format saved under the Build\contracts folder, which is a newly generated folder. Truffle only compiles files that have been modified since the last compilation, to reduce unnecessary compilation, and if you want to compile all the files, you can use the--compile-all option: Truffle compile--compile-all 4, Configuration truffle-config.js file, because Truffle.js and truffle-config.js file conflict, so we need to delete truffle.js file, only use Truffle-config.js file. (If you're working on Windows, delete truffle.js, if you're working on another system, delete one or keep them at the same time, it doesn't matter.) The reason for this is that there is a naming problem on Windows, and when we want to execute the truffle command, it opens the Truffle.js configuration file instead of reading the data in it truffle-config.js the following: Module.exports = {

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.