美文网首页
零基础学习以太坊开发-solidity开发环境安装

零基础学习以太坊开发-solidity开发环境安装

作者: jerry的技术与思维 | 来源:发表于2018-09-14 21:36 被阅读0次

    介绍

    Solidity是一种语法类似JavaScript的高级语言。前面已经用Solidity演示过智能合约代码。没错,Solidity是以太坊开发智能合约的推荐开发语言了。

    Remix

    如果您只想尝试的Solidity到底是什么鬼,可以尝试 不需要任何安装的Remix。如果要在不连接Internet的情况下使用它,可以访问 https://github.com/ethereum/browser-solidity/tree/gh-pages并按照该页面上的说明下载.ZIP文件。

    安装

    • 访问基于浏览器的Solidity集成环境:
      http://remix.ethereum.org/
    • 离线使用,本地copy一份。
    • NPM / node.js安装Solidity 可能是最省事最轻量的方法
      安装命令如下:
    npm install solc  
    
    

    TIP:在基于浏览器的Solidity上,Emscripten提供了一个跨平台JavaScript库,把C++源码编译为JavaScript,同时也提供NPM安装包。

    • 二进制安装Solidity
      包括Mix IDE的二进制Solidity安装包在Ethereum网站C++ bundle中下载。
    • 五、从源码中构建
      在MacOS X、Ubuntu和其它类Unix系统中编译安装Solidity非常相似。
      • MacOS X系统需要安装Homebrew 和 Xcode,用homebrew神器,前面已经介绍过了,xcode在app store也很容易安装。
      brew update
        brew install boost --c++11               # 这需要等待一段时间
        brew install cmake cryptopp miniupnpc leveldb gmp libmicrohttpd libjson-rpc-cpp 
        # 仅仅安装Mix IDE和Alethzero
        brew install xz d-bus
        brew install llvm --HEAD --with-clang 
        brew install qt5 --with-d-bus 
        #这里需要长时间的等待,可添加--verbose输出信息会让等待显得不那么长
    
    
    • Ubuntus 系统
      编译(对于Ubbuntu 16以下版本的,需要安装支持包)
        #如果你只准备安装solidity,忽略末尾Alethzero和Mix的错误。
        git clone --recursive https://github.com/ethereum/webthree-umbrella.git
        cd webthree-umbrella
        ./webthree-helpers/scripts/ethupdate.sh --no-push --simple-pull --project solidity 
        # 更新Solidity库
        ./webthree-helpers/scripts/ethbuild.sh --no-git --project solidity --all --cores 4 -DEVMJIT=0 
        # 编译Solidity及其它
        # 在OS X系统加上DEVMJIT将不能编译,在Linux系统上则没问题  
    
    
    • Ubuntus 支持包安装
    #Ubuntu 14.04
        sudo apt-add-repository ppa:george-edison55/cmake-3.x
        #加入其他包
        sudo apt-get -y update
        sudo apt-get -y install language-pack-en-base
        sudo dpkg-reconfigure locales
        sudo apt-get -y install software-properties-common
        sudo add-apt-repository -y ppa:ethereum/ethereum
        sudo add-apt-repository -y ppa:ethereum/ethereum-dev
        sudo apt-get -y update
        sudo apt-get -y upgrade
    
    
    
    • Ubuntus 支持包安装
      如果你想帮助Solidity的开发,你需要分支(fork)Solidity并添加到你的私人远端分支:
        cd webthree-umbrella/solidity
        git remote add personal git@github.com:username/solidity.git
    
    

    相关文章

      网友评论

          本文标题:零基础学习以太坊开发-solidity开发环境安装

          本文链接:https://www.haomeiwen.com/subject/coyagftx.html