基本语法: 其中: ganache-cli基于JS编写,通过npm安装 安装命令: ganache-cli命令: Options参数同真实节点geth的参数基本一致,可以自定义端口等,一般无需设置。 truffle是Solidity语言的一套开发框架,本身基于js。 安装: truffle init # 初始化代码环境 Remix,基本web的编程环境 安装: 启动调试: 安装: 调试: VS code : https://code.visualstudio.com/ 参考链接:https://phoenixnap.com/kb/install-latest-node-js-and-nmp-on-ubuntu Node.js is an open-source cross-platform JavaScript (JS) runtime environment. It is used for building fast and scalable network applications. In addition to offering various JS modules, it is also lightweight, efficient and supports consistent and integrated development. Another way to install Node.js and NPM is with the Node Version Manager (NVM). NVM is a tool practical for managing multiple Node.js versions. 这一步结束之后需要根据提示重启终端,然后将NVM导入到环境变量,即执行: 然后检查是否安装成功: 一旦安装完成nvm,就可以从所有可用的Node.js版本中选择安装: Once you have Node.js and NPM setup, install the development tools. This automation tool kit allows compiling and installing native add-ons from the NPM. 这个步骤一般不会出现问题。 启动调试之后会出现127.0.0.1:8545的URL,说明安装正常。使用ctrl+C关闭调试 这个过程中问题较多。 2 问题:Error: Cannot find module spawn-sync/postinstall 具体参考:https://github.com/serverless/serverless/issues/4319
以太坊编程环境构建
以太坊编程环境介绍
以太坊编程涉及语言
各类以太坊网络
基本编程测试环境要求
Npm/nodejs环境
Npm基本使用
npm install <Module Name>
注意:在package.json所在目录下使用npm.installGanache环境
ganache是在本地使用内存模拟的一个以太坊环境
为测试提供很多便捷功能,如自动生成账号等
开发测试专用。一般都是在ganache调式完成后,再部署到真实以太坊节点Ganache基本使用
npm install -g ganache-cli #node的版本需要>6.11.5
ganache-cli <options>
Truffle环境
客户端做了深度集成。开发,测试,部署一行命令都可以搞定
提供自动化项目构建机制
提供了合约抽象接口,对web3.js进行了进一步封装,简化开发流程Truffle基本使用
sudo npm install -g truffle
truffle compile # 编译
truffle deploy # 部署
truffle test # 测试
truffle console # 命令行工具编辑器IDE
SublimeText
Emacs Solidity
Atom Solium Linter
Visual Studio Code
这里使用VS Code。Linux环境开发
node安装完成后,应当同时安装了node.js和npmGanache环境安装调试
sudo npm install -g ganache-cli
ganache-cli
Truffle安装调试
sudo npm install -g truffle
truffle init
编辑器下载
安装solidity插件。安装过程
安装node.js和npm
(直接阅读英文就好)引言
Node Package Manager (NPM) is Node’s official package manager, used for installing and managing package dependencies.
In this tutorial, learn three (3) different options for installing Node.js and NPM on Ubuntu 18.04.3种方式在Ubuntu上安装NPM
方法1:从Ubuntu仓库安装Node.js和NPM
sudo apt update sudo apt install nodejs nodejs -v sudo apt install npm npm -v
方法2:使用NVM安装Node.js和NPM
sudo apt install curl curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
nvm --version
nvm ls-remote nvm ls node -v nvm use 8.11.1
方法3:从NodeSource仓库中安装Node.js
sudo apt install curl curl -sL https://deb.nodesource.com/setup_11.x | sudo bash - sudo apt install nodejs nodejs --version npm --version
安装开发工具
sudo apt install gcc g++ make
安装ganache
sudo npm install -g ganache-cli ganache-cli
安装truffle
正常步骤:sudo npm install -g truffle truffle init
可能出现的问题:
解决方案:使用root用户安装
具体参考:https://stackoverflow.com/questions/57031399/error-eacces-permission-denied-open-root-config-truffle-config-json
解决方案:npm install -g try-thread-sleep npm install -g serverless --ignore-scripts spawn-sync
3 问题:npm ERR! truffle@5.1.21 postinstall: node ./scripts/postinstall.js
解决方案:使用–unsafe-perm=true
具体参考:https://stackoverflow.com/questions/48298361/npm-install-failed-at-the-node-sass4-5-0-postinstall-script
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算