Skip to content

Create docker file

ChMarina edited this page Feb 12, 2019 · 13 revisions

Create docker file

This doc will show you how to build container from Dockerfile. Docker will setup all depencies within container, download precompiled libraries and binaries.

Step 1. Preparation

mkdir /tmp/mhp
cd /tmp/mhp

Step2. Dockerfile

Use Dockerfile:

wget https://raw.githubusercontent.com/metahashorg/metahash-fullnode-client/master/pre_compiled/Dockerfile

Step3. Build

sudo docker build -t mh_proxy . --no-cache

Before running this command, install docker, if it isn't installed yet. Please see instruction in Docker installation to do this.

Step4. Running container

wget https://raw.githubusercontent.com/metahashorg/metahash-fullnode-client/master/pre_compiled/start_docker_mhp.sh
chmod +x start_docker_mhp.sh
sudo ./start_docker_mhp.sh mh_proxy main

where

mh_proxy - docker container name you’ve built on previous step,

main - network name (main|dev|v8). Default is main.

Step5. Example of using the MHC client

Once the installation is completed, MHC client is ready to be used, for example, for generating an address:

# curl -s -X POST --data '{"id":1,"version":"1.0.0","method":"generate"}' 0.0.0.0:9999
{
  "jsonrpc":"2.0",
  "id":1,
  "result":  
  {
    "address":"0x007699ec87ccec9d1aea7eb34d0bb9513c0bc19f6d35e638f2",
    "pub_key":"30563010...d8e2375bc812d91f60d0847e58b74358ce82fd8410148bab907f61d4e8b507bf6bc75bb74359a3",
    "prv_key":"3074020101042...e2375bc812d91f60d084...7e58b74358ce82fd8410148bab907f61d4e8b507bf6bc75bb74359a3"
  }
}

Generated keys can be found in the folder: ~/wallet.net/ where net - network name, for example ~/wallet.main/

For more information about the MHC client, available methods and capabilities, see https://github.com/metahashorg/metahash-fullnode-client/wiki/Usage

You can’t perform that action at this time.