Truffle and Metamask

Truffle and Metamask

Prerequisites

truffle version: Truffle v3.2.1

npm version:

{ npm: '3.10.10',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '58.2',
  modules: '48',
  node: '6.10.2',
  openssl: '1.0.2k',
  uv: '1.9.1',
  v8: '5.1.281.98',
  zlib: '1.2.11' }

testrpc version: EthereumJS TestRPC v3.0.3
metamask version: 3.5.2

Truffle and Metamask_第1张图片

And you have to reveal your seed words, copy them.

Truffle and Metamask_第2张图片
Truffle and Metamask_第3张图片

Step by Step

cd Desktop/
mkdir truffle-test
cd truffle-test/

testrpc -m "your seed words"
Truffle and Metamask_第4张图片

On another terminal:truffle init webpack

Truffle and Metamask_第5张图片
truffle compile
truffle migrate
npm run dev
Truffle and Metamask_第6张图片
Truffle and Metamask_第7张图片

Open http://localhost:8080/

Truffle and Metamask_第8张图片
Truffle and Metamask_第9张图片

Now the account 1 has 10000 META, and account 2 has 0 META. Let's transfer 1000 META to account 2.

Truffle and Metamask_第10张图片

Transfer successfully. The account 1 now just have 9000META, and account 2 has 1000 META.


Truffle and Metamask_第11张图片
Truffle and Metamask_第12张图片

References

Truffle and Metamask
Developing Ethereum Dapps with Truffle and MetaMask
Dapp tutorial: Truffle 3.0, Metamask and EthereumExplorer
BUILDING & TESTING A FRONTEND APP WITH TRUFFLE 3.0
Truffle Docs

你可能感兴趣的:(Truffle and Metamask)