您的位置:新葡亰496net > 电脑系统 > 新葡亰496net:比特币开发

新葡亰496net:比特币开发

发布时间:2019-11-24 07:18编辑:电脑系统浏览(94)

    官方网址配置步骤:

    安装Docker环境

    什么是Docker?

    Docker 归于 Linux 容器的豆蔻梢头种包装,提供简单易用的容器使用接口。它是当前最盛行的 Linux 容器技术方案。
    Docker 将应用程序与该程序的依附,打包在一个文本之中。运转那些文件,就能变动一个虚构容器。程序在这里个编造容器里运营,就恍如在真实的物理机上运维相仿。有了 Docker,就绝不担激情况难题。

    全体来说,Docker 的接口特简单,客户能够一本万利地开创和利用容器,把本身的接受放入容器。容器还足以开展版本管理、复制、共享、更改,如同拘禁平日的代码同样。
    Docker 的首要用场,近来有三大类。

    (1卡塔尔提供三次性的条件。比方,当地质度量试外人的软件、持续集成的时候提供单元测量试验和塑造的景况。

    (2卡塔尔国提供弹性的云服务。因为 Docker 容器能够随开随关,很合乎动态扩大体量和缩容。

    (3卡塔 尔(阿拉伯语:قطر‎创立微服务框架结构。通过多少个容器,意气风发台机器可以跑三个劳务,因而在本机就能够效仿出微服务架构。

    安装Docker
    正文以ubuntu系统为例

    centos7安装docker

    文章参谋自:docker官方文书档案

    ubuntu 安装docker-ce

    设置Docker社区版饭馆

    1. Update the apt package index:

      $ sudo apt-get update
      
    2. Install packages to allow apt to use a repository over HTTPS:

      $ sudo apt-get install 
          apt-transport-https 
          ca-certificates 
          curl 
          software-properties-common
      
    3. Add Docker’s official GPG key:

      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      
    4. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.

      $ sudo add-apt-repository 
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
         $(lsb_release -cs) 
         stable"
      

    Install using the repository

    Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

    还足以参考新手教程,中文,比较轻易,新手教程

    - Install using the repository

    1. Update the apt package index:
    $ sudo apt-get update
    
    1. Install packages to allow apt to use a repository over HTTPS:
    $ sudo apt-get install 
        apt-transport-https 
        ca-certificates 
        curl 
        software-properties-common
    
    1. Add Docker’s official GPG key:
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    $ sudo apt-key fingerprint 0EBFCD88
    
    1. Use the following command to set up the stable repository.
    $ sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    

    安装Docker社区版

    1. Update the apt package index.

      $ sudo apt-get update
      
    2. Install the latest version of Docker CE, or go to the next step to install a specific version:

      $ sudo apt-get install docker-ce
      

       3.Verify that Docker CE is installed correctly by running the hello-world image.

        $ sudo docker run hello-world
    

    Set up the repository

    1. Update the apt package index:

      $ sudo apt-get update
      
    2. Install packages to allow apt to use a repository over HTTPS:

      $ sudo apt-get install 
          apt-transport-https 
          ca-certificates 
          curl 
          software-properties-common
      
    3. Add Docker’s official GPG key:

      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      

      Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

      $ sudo apt-key fingerprint 0EBFCD88
      
      pub   4096R/0EBFCD88 2017-02-22
            Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
      uid                  Docker Release (CE deb) <docker@docker.com>
      sub   4096R/F273FCD8 2017-02-22
      
    4. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.

      Note: The lsb_release -cs sub-command below returns the name of your Ubuntu distribution, such as xenial. Sometimes, in a distribution like Linux Mint, you might need to change $(lsb_release -cs) to your parent Ubuntu distribution. For example, if you are using Linux Mint Rafaela, you could use trusty.

      • x86_64 / amd64
      • armhf
      • IBM Power (ppc64le)
      • IBM Z (s390x)
      $ sudo add-apt-repository 
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
         $(lsb_release -cs) 
         stable"
      

      Note: Starting with Docker 17.06, stable releases are also pushed to the edge and test repositories.

      Learn about stable and edge channels.

    一、Install using the repository

    是因为作者利用的是Tencent云centos服务器,仿效生手教程的设置进度中现身了could not resolve host mirrors.tencentyun.com no address associated with hostname trying other mirror错误,所以先肃清掉此报错后就一向看官方文书档案了

    - INSTALL DOCKER CE

    1. Update the apt package index.
    $ sudo apt-get update
    
    1. Install the latest version of Docker CE, or go to the next step to install a specific version. Any existing installation of Docker is replaced.
    $ sudo apt-get install docker-ce
    
    1. On production systems, you should install a specific version of Docker CE instead of always using the latest. This output is truncated. List the available versions.
    $ apt-cache madison docker-ce
    docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
    

    The contents of the list depend upon which repositories are enabled. Choose a specific version to install. The second column is the version string. The third column is the repository name, which indicates which repository the package is from and by extension its stability level. To install a specific version, append the version string to the package name and separate them by an equals sign (=):

    $ sudo apt-get install docker-ce=<VERSION>
    

    The Docker daemon starts automatically.

    1. Verify that Docker CE is installed correctly by running the hello-world image.
    $ sudo docker run hello-world
    

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

    截图如下

       新葡亰496net 1

     

     
    

    Install Docker CE

    1. Update the apt package index.

      $ sudo apt-get update
      
    2. Install the 新葡亰496net,latest version of Docker CE, or go to the next step to install a specific version:

      $ sudo apt-get install docker-ce
      

      Got multiple Docker repositories?

      If you have multiple Docker repositories enabled, installing or updating without specifying a version in the apt-get install or apt-get update command always installs the highest possible version, which may not be appropriate for your stability needs.

    3. To install a specific version of Docker CE, list the available versions in the repo, then select and install:

      a. List the versions available in your repo:

      $ apt-cache madison docker-ce
      
      docker-ce | 18.03.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
      

      b. Install a specific version by its fully qualified package name, which is the package name (docker-ce) plus the version string (2nd column) up to the first hyphen, separated by a an equals sign (=), for example, docker-ce=18.03.0.ce新葡亰496net:比特币开发。.

      $ sudo apt-get install docker-ce=<VERSION>
      

      The Docker daemon starts automatically.

    4. Verify that Docker CE is installed correctly by running the hello-world image.

      $ sudo docker run hello-world
      

    windows系统和Mac系统下载安装包点击安装就能够了。

    1. Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.

    1. 借使此前有安装过docker但战败了,能够先remove以前版本:

    Uninstall old versions:

    $ sudo yum remove docker 
                      docker-common 
                      docker-selinux 
                      docker-engine
    

    image文件

    Docker 把应用程序及其信任,打包在 image 文件之中。独有经过这么些文件,技巧生成 Docker 容器。image 文件能够充当是容器的沙盘。Docker 依照 image 文件生成容器的实例。同三个image 文件,能够转移多个同一时间运维的容器实例。

    image 是二进制文件。实际付出中,二个 image 文件一再因此持续另三个 image 文件,加上有的天性化设置而生成。比释迦牟尼佛讲,你能够在 Ubuntu 的 image 基本功上,往里面插足 Apache 服务器,形成你的 image。

    # 列出本机的所有 image 文件。
    $ docker image ls
    
    # 删除 image 文件
    $ docker image rm [imageName]
    

         yum install -y yum-utils device-mapper-persistent-data lvm2

    2. Install Docker CE 安装docker:

    • Install using the repository
      Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
    $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    
    • Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well.
    $ sudo yum-config-manager 
        --add-repo 
        https://download.docker.com/linux/centos/docker-ce.repo
    
    • Optional: Enable the edge and test repositories. These repositories are included in the docker.repo file above but are disabled by default. You can enable them alongside the stable repository.
    $ sudo yum-config-manager --enable docker-ce-edge
    $ sudo yum-config-manager --enable docker-ce-test
    

    获取iamge

    docker image pull library/hello-world
    

    查阅本机的image

    docker image ls
    

    2.Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well.

    3. INSTALL DOCKER CE

    • Update the yum package index
    $ sudo yum makecache fast
    
    • Install the latest version of Docker CE, or go to the next step to install a specific version.
    $ sudo yum install docker-ce
    
    • On production systems, you should install a specific version of Docker CE instead of always using the latest. List the available versions. This example uses the sort -r command to sort the results by version number, highest to lowest, and is truncated.
    $ yum list docker-ce.x86_64  --showduplicates | sort -r
    
    docker-ce.x86_64  17.06.0.el7                               docker-ce-stable  
    

    运行image

    docker container run hello-world
    

       yum-config-manager

    4. Start Docker.

    $ sudo systemctl start docker
    
    • Verify that docker is installed correctly by running the hello-world image.
    $ sudo docker run hello-world
    

    容器文件

    image 文件生成的器皿实例,本身也是四个文书,称为容器文件。

    列出本机正在运作的容器

    docker container ls
    

    列出本机全数容器,包含结束运维的器皿

    docker container ls --all
    

    移除容器

    docker container rm [containerID]
    

    --add-repo

    安装比特币测量试验网络

     

    下载比特币测量检验互连网镜像

    sudo docker pull freewill/bitcoin-testnet-box
    

    运行Docker镜像

    sudo docker run -it -p 19001:19001 -p 19011:19011 freewil/bitcoin-testnet-box
    

    上述命令中的19051 和 一九零一1是铺排给三个节点提供RPC服务的端口。
    -t:在新容器内钦赐三个伪终端或终点。

    -i:允许你对容器内的正统输入 (STDIN) 举行人机联作。

    起首比特币测试网络

    make start
    

    起首成功后,将在本土模拟运转四个比特币测验钱袋节点,组成三个私有范围的比特币测量检验互联网。

    二、INSTALL DOCKER CE

    翻看节点信息

    make getinfo
    
    bitcoin-cli -datadir=1  getinfo
    {
      "version": 130200,
      "protocolversion": 70015,
      "walletversion": 130000,
      "balance": 0.00000000,
      "blocks": 0,
      "timeoffset": 0,
      "connections": 1,
      "proxy": "",
      "difficulty": 4.656542373906925e-10,
      "testnet": false,
      "keypoololdest": 1523007398,
      "keypoolsize": 100,
      "paytxfee": 0.00000000,
      "relayfee": 0.00001000,
      "errors": ""
    }
    bitcoin-cli -datadir=2  getinfo
    {
      "version": 130200,
      "protocolversion": 70015,
      "walletversion": 130000,
      "balance": 0.00000000,
      "blocks": 0,
      "timeoffset": 0,
      "connections": 1,
      "proxy": "",
      "difficulty": 4.656542373906925e-10,
      "testnet": false,
      "keypoololdest": 1523007399,
      "keypoolsize": 100,
      "paytxfee": 0.00000000,
      "relayfee": 0.00001000,
      "errors": ""
    }
    

    1.Update the yum package index.

    爆发二个区块

    make generate
    

       $ sudo yum makecache fast

    产生100个区块

    make generate BLOCKS=100
    

    2.Install the latest version of Docker CE, or go to the next step to install a specific version.

    查看节点状态

    bitcoin-cli -datadir=1  getinfo
    {
      "version": 130200,
      "protocolversion": 70015,
      "walletversion": 130000,
      "balance": 5050.00000000,
      "blocks": 201,
      "timeoffset": 0,
      "connections": 1,
      "proxy": "",
      "difficulty": 4.656542373906925e-10,
      "testnet": false,
      "keypoololdest": 1523009413,
      "keypoolsize": 100,
      "paytxfee": 0.00000000,
      "relayfee": 0.00001000,
      "errors": ""
    }
    

    能够看看卡包节点中有5055个比特币

       $ sudo yum install docker-ce

    翻开钱袋地址

    比特币参考顾客端维护了叁个地址池,地址池的深浅能够用 getinfo 命令keypoolsize 参数获取。那一个地址是自动生成的,能够被看做公开接收地址或零花钱地址。使用 getnewaddress 命令能够拿走个中的一个地方:

    bitcoin-cli -datadir=2 getnewaddress
    mg1xSmdUdwGpwQTYaKLRnoG6pN1rCv6NhM
    

    或者

    make address2
    bitcoin-cli -datadir=2  getnewaddress
    mzHTLmnduaHZrTWpt2zJXrRSiqX1aoPqek
    

    查看地址私钥

    bitcoin-cli -datadir2  dumpprivkey 'mg1xSmdUdwGpwQTYaKLRnoG6pN1rCv6NhM'
    

    给钱包2转账

    make sendfrom1   ADDRESS=mg1xSmdUdwGpwQTYaKLRnoG6pN1rCv6NhM  AMOUNT=10
    

    在乎这里测验地点以m最初,和正式地址以1或3从头是有分别的。

    确认交易

    发出12个区块,让地点的贸易获得丰富的料定

    make generate BLOCKS=10
    

    然后查看节点二

    bitcoin-cli -datadir=2 getinfo
    

    能够见见 里面有11个比特币

    tester@965cf497fb58:~/bitcoin-testnet-box$ bitcoin-cli -datadir=2 getinfo
    {
      "version": 130200,
      "protocolversion": 70015,
      "walletversion": 130000,
      "balance": 10.00000000,
      "blocks": 210,
      "timeoffset": 0,
      "connections": 1,
      "proxy": "",
      "difficulty": 4.656542373906925e-10,
      "testnet": false,
      "keypoololdest": 1523019944,
      "keypoolsize": 100,
      "paytxfee": 0.00000000,
      "relayfee": 0.00001000,
      "errors": ""
    }
    

    查阅第二个节点

    tester@965cf497fb58:~/bitcoin-testnet-box$ bitcoin-cli -datadir=1 getinfo
    {
      "version": 130200,
      "protocolversion": 70015,
      "walletversion": 130000,
      "balance": 5489.99996160,
      "blocks": 210,
      "timeoffset": 0,
      "connections": 1,
      "proxy": "",
      "difficulty": 4.656542373906925e-10,
      "testnet": false,
      "keypoololdest": 1523019944,
      "keypoolsize": 100,
      "paytxfee": 0.00000000,
      "relayfee": 0.00001000,
      "errors": ""
    }
    tester@965cf497fb58:~/bitcoin-testnet-box$
    

    发觉 balance 由 5500 造成了 5489.99996160,转账给节点2 10BTC,其他部分 0.0000384 正是开辟给矿工记账的手续费。

    三、INSTALL DOCKER CE

    1.Update the yum package index.

       $ sudo yum makecache fast

    2.Install the latest version of Docker CE, or go to the next step to install a specific version.

       $ sudo yum install docker-ce

    1. Start Docker.

       $ sudo systemctl start docker

    4.Verify that docker is installed correctly by running the hello-world image.

       $ sudo docker run hello-world

    本文由新葡亰496net发布于电脑系统,转载请注明出处:新葡亰496net:比特币开发

    关键词:

上一篇:新葡亰496netnginx安装手册,nginx安装景况

下一篇:没有了