truffle3.0以上的项目目录结构中没有app目录怎么办

个人了解比较晚刚开始学习环境已经到3.0版本以后了,教程上大部分是2.0版本的项目目录,导致刚开始学的时候纠结了很久,通过网上查资料找到了答案。

初始化命令这样写就OK了

truffle init webpack 

用这个指令进行初始化然后编译启动就行了,这个初始化过程有点慢,可能是个人网络问题吧。操作如下:

houtongdeMac-mini:demobasic zhou$ truffle init webpack
Downloading project...
Installing dependencies...
Project initialized.

  Documentation: https://github.com/trufflesuite/truffle-init-webpack

Commands:

  Compile:        truffle compile
  Migrate:        truffle migrate
  Test:           truffle test
  Build Frontend: npm run build
  Run Linter:     npm run lint
  Run Dev Server: npm run dev

Hint: Run the dev server via `npm run dev` to have your changes rebuilt automatically.

Make sure you have an Ethereum client like the ethereumjs-testrpc running on http://localhost:8545.

初始化完成后提示出了Commands按照这个进行操作就可以了。
根据提示看出来运行的时候使用的指令是:

npm run dev

结果如下:

ZhoutongdeMac-mini:demobasic zhou$ npm run dev

> truffle-init-webpack@0.0.2 dev /Users/zhou/eth/demobasic
> webpack-dev-server

Project is running at http://localhost:8080/
webpack output is served from /
Hash: 7c7d6651ad8059c28eb8
Version: webpack 2.7.0
Time: 1827ms
     Asset       Size  Chunks                    Chunk Names
    app.js    1.35 MB       0  [emitted]  [big]  main
index.html  925 bytes          [emitted]         
chunk    {0} app.js (main) 1.32 MB [entry] [rendered]
   [82] ./~/web3/index.js 193 bytes {0} [built]
   [86] ./app/javascripts/app.js 3.64 kB {0} [built]
   [87] (webpack)-dev-server/client?http://localhost:8080 5.83 kB {0} [built]
   [88] ./build/contracts/MetaCoin.json 2.59 kB {0} [built]
  [127] ./~/loglevel/lib/loglevel.js 6.74 kB {0} [built]
  [161] ./~/strip-ansi/index.js 161 bytes {0} [built]
  [163] ./~/style-loader/addStyles.js 6.91 kB {0} [built]
  [164] ./app/stylesheets/app.css 905 bytes {0} [built]
  [171] ./~/truffle-contract/index.js 2.64 kB {0} [built]
  [206] ./~/url/url.js 23.3 kB {0} [built]
  [241] (webpack)-dev-server/client/overlay.js 3.6 kB {0} [built]
  [242] (webpack)-dev-server/client/socket.js 856 bytes {0} [built]
  [244] (webpack)/hot nonrecursive ^\.\/log$ 160 bytes {0} [built]
  [245] (webpack)/hot/emitter.js 77 bytes {0} [built]
  [247] multi (webpack)-dev-server/client?http://localhost:8080 ./app/javascripts/app.js 40 bytes {0} [built]
     + 233 hidden modules
webpack: Compiled successfully.

你可能感兴趣的:(区块链,truffle)