以太坊智能合约-环境搭建

智能合约开发环境搭建

进行智能合约开发环境搭建前,建议自行搭建一遍以太坊私有链

官方链接:
REMIX-IDE GitHub
remix-ide
参考链接:
以太坊智能合约开发 - 环境搭建
待续:
基于以太坊构建私有区块链网络教程指南
Ethereum以太网搭建本地开放环境简明教程

Remix

Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions

安装

Install npm and node.js

安装nmp和nodejd请参考另一篇文章

npm Install

Remix-ide has been published as an npm module:

1
$ npm install -g remix-ide

切换为国内的源,没有安装成功

source code Install

1
npm config set registry https://registry.npm.taobao.org

clone the github repository(wget need to be installed first) :

1
2
3
4
5
$ git clone https://github.com/ethereum/remix-ide.git
$ cd remix-ide
$ npm install #很久
$ npm run setupremix # this will clone https://github.com/ethereum/remix for you and link it to remix-ide. Only execute this step if you want to contribute on Remix development
$ npm start

现在可以通过
Run 浏览器访问 http://127.0.0.1:8080

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
> remix-ide@0.7.2 start /home/sun/remix-ide
> npm-run-all -lpr serve watch onchange remixd

[serve ]
[serve ] > remix-ide@0.7.2 serve /home/sun/remix-ide
[serve ] > execr --silent http-server .
[serve ]
[watch ]
[watch ] > remix-ide@0.7.2 watch /home/sun/remix-ide
[watch ] > watchify src/index.js -dv -p browserify-reload -o build/app.js --exclude solc
[watch ]
[onchange]
[onchange] > remix-ide@0.7.2 onchange /home/sun/remix-ide
[onchange] > onchange build/app.js -- npm-run-all lint
[onchange]
[remixd ]
[remixd ] > remix-ide@0.7.2 remixd /home/sun/remix-ide
[remixd ] > ./node_modules/remixd/bin/remixd -s ./contracts
[remixd ]
[watch ] WS server listening on 33703
[remixd ] example: --dev-path /home/devchains/chain1 --mist --geth --frontend /home/frontend --frontend-port 8084 --auto-mine
[remixd ] Usage: remixd -s <shared folder>
[remixd ]
[remixd ] Provide a two ways connection between the local computer and Remix IDE
[remixd ]
[remixd ] Options:
[remixd ]
[remixd ] -s, --shared-folder <path> Folder to share with Remix IDE
[remixd ] -m, --mist start mist
[remixd ] -g, --geth start geth
[remixd ] -p, --dev-path <dev-path> Folder used by mist/geth to start the development instance
[remixd ] -f, --frontend <front-end> Folder that should be served by remixd
[remixd ] -p, --frontend-port <front-end-port> Http port used by the frontend (default 8082)
[remixd ] -a, --auto-mine mine pending transactions
[remixd ] -r, --rpc <cors-domains> start rpc server. Values are CORS domain
[remixd ] -rp, --rpc-port rpc server port (default 8545)
[remixd ] --profiler start profiler service
[remixd ] -h, --help output usage information
[remixd ] [WARN] Any application that runs on your computer can potentially read from and write to all files in the directory.
[remixd ] [WARN] Symbolinc links are not forwarded to Remix IDE
[remixd ]
[remixd ] [WARN] Symbolic link modification not allowed : ./contracts | /home/sun/remix-ide/contracts
[remixd ] Tue Sep 18 2018 19:23:38 GMT+0900 (KST) Remixd is listening on 127.0.0.1:65520
[watch ] NOW ASKING FOR CLIENT TO RELOAD
[watch ] 24493914 bytes written to build/app.js (27.32 seconds) at 19:24:04
[onchange]
[onchange] > remix-ide@0.7.2 lint /home/sun/remix-ide
[onchange] > standard | notify-error
[onchange]

一个简单的智能合约

部署一个ERC20的合约

---本文结束感谢您的阅读---
北岸冷若冰霜 wechat
欢迎使用微信扫一扫上面的二维码,订阅我的公众号!
坚持原创分享,点击下方打赏,您的支持将鼓励我继续创作!