wangby511 / block-chain Goto Github PK
View Code? Open in Web Editor NEW区块链 基于Truffle框架 Blockchain-Truffle
区块链 基于Truffle框架 Blockchain-Truffle
Block-Chain 工程文件夹为payroll $ node -v //check the version of node.js $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash $ nvm $ nvm -v $ nvm install 6.11.3 $ nvm use 6.11.3 $ nvm ls $ nvm alias default v6 安装truffle框架 $ npm install -g [email protected] (-g 全局安装) $ truffle version (check) 新建truffle工程: $ mkdir payroll $ cd payroll ~payroll $ truffle init $ code (打开VS code) $ rm -rf * $ truffle unbox react $ truffle compile 部署客户端: $ npm install -g ethereum-testrpc 新建一个terminal:$ testrpc $ truffle migration $ npm run start 可以看到localhost:3000上访问网页 ./payroll/src/utils/getWeb3.js line 24 : var provider = new Web3.providers.HttpProvider('http://127.0.0.1:8545') 做修改 和: ./payrol/truffle.js保持一致: //file start: module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> // to customize your Truffle configuration! networks:{ development:{ host:"127.0.0.1", port:8545, network_id:"*" } } }; //file end. 修改 ./payroll/src/App.js line 59: return simpleStorageInstance.set(89, {from: accounts[0]}) 访问 localhost:3000 可以看到更改的值 The html page shows as follows: "Good to Go! Your Truffle Box is installed and ready. Smart Contract Example If your contracts compiled and migrated successfully, below will show a stored value of 5 (by default). Try changing the value stored on line 59 of App.js. The stored value is: 89"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.