GithubHelp home page GithubHelp logo

cardano's Introduction

如何从源码构建连到cardano主网的可执行文件 connect-to-mainnet

  • cardano 源码github下载 cardano-sl

    git clone https://github.com/input-output-hk/cardano-sl.git
    cd cardano-sl
    
  • nix 安装

    sudo apt-get install curl       //安装curl
    curl https://nixos.org/nix/install | sh    //使用curl安装nix
    
  • 之后使用签名的IOHK二进制缓存,创建nix的配置文件

    sudo mkdir -p /etc/nix
    sudo gedit /etc/nix/nix.conf     //可以使用vi,vim 等编辑工具
    
  • 向其中添加下面两行

    binary-caches            = https://cache.nixos.org https://hydra.iohk.io
    binary-cache-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
    
  • 构造可执行文件 cardano-node-master

    nix-build -A cardano-sl-node-static --cores 0 --max-jobs 2 --no-build-output --out-link master
    
  • 使用git checkout master切换到master分支,然后构建可执行文件

    nix-build -A connectScripts.mainnetWallet -o connect-to-mainnet
    
  • 最后在cardano-sl目录下,会有可执行文件connect-to-mainnet,通过./connect-to-mainnet连接到主网,如果运行出现yaml exception,说明配置文件路径不对,进入编辑connetc-to-mainnet可执行文件,按照下图修改配置文件路径即可

如何构建daedalus钱包

  1. 下载daedalus源码

    $ git clone https://github.com/input-output-hk/daedalus.git
    $ cd daedalus
    
  2. 首先安装nodejs(8.0.0) 与 npm(yarn)

    $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash  //安装npm的版本管理器 
    $ sudo nvm install x.y.z                         // x,y,z 为node版本号,此命令来安装node与npm
    $ node -v                                        //测试node是否安装成功
    $ npm -v                                         //测试npm 是否安装成功
    
  3. daedalus 目录下有package.json,它是一个模块的配置文件,在项目目录下使用下面的命令来安装模块,安装的模块将位于node_modules目录下:

    $ npm install(yarn install)
    
  4. 在connect-to-mainnet脚本运行的前提下,通过下面的命令来运行钱包应用

    $ npm run dev(yarn run dev)
    

    上面的命令其实执行的是package.json里面设置的一些命令(scripts),在package.json中script被定义为dev,可通过上述命令运行

相关资料:

cardano's People

Contributors

jiabinc avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.