HashBridge

HashBridge节点搭建过程

  • go 安装
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    wget https://golang.google.cn/dl/go1.14.9.linux-amd64.tar.gz
    tar -xzvf go1.14.9.linux-amd64.tar.gz -C /usr/local
    mkdir -p /data/gopath
    vim /etc/profile
    export GOROOT=/usr/local/go
    export GOPATH=/data/gopath
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    source /etc/profile
    go version
    go env
  • nvm 、nodejs、yarn 安装
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    yum  install -y git
    git --version
    git clone git://github.com/creationix/nvm.git ~/nvm
    echo "source ~/nvm/nvm.sh" >> ~/.bashrc
    source ~/.bashrc
    nvm --version
    nvm list-remote
    nvm install 12.18 && nvm use 12.18
    nvm ls
    node --version
    npm install -g yarn
  • postgresql安装
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    sudo yum install -y postgresql11-server
    sudo /usr/pgsql-11/bin/postgresql-11-setup initdb
    sudo systemctl enable postgresql-11
    sudo systemctl start postgresql-11
    vim /var/lib/pgsql/11/data/postgresql.conf
    listen_addresses = '*'
    port = xxxx
    vim /var/lib/pgsql/11/data/pg_hba.conf
    host all all 127.0.0.1/32 md5
    systemctl restart postgresql-11
    systemctl status postgresql-11
    su - postgres
    psql -U postgres
    ALTER USER postgres WITH PASSWORD 'xxx';
    CREATE DATABASE xxxx OWNER postgres;
    GRANT ALL PRIVILEGES ON DATABASE postgres_t1 to postgres;
  • hashbridge安装
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    拷贝源码
    yarn
    make install
    hashbridge help
    mkdir -p /hbdata/bridge_deploy
    sudo chmod 0755 -R /hbdata/bridge_deploy
    cd /hbdata/bridge_deploy
    vi .password
    vi .env
    hashbridge node start --password .password
    hashbridge admin login
    hashbridge keys eth list
  • adapter 安装
    1
    2
    nohup ./newbi-adapter &
    curl -X POST -H "content-type:application/json" "http://127.0.0.1:8080/v1/hash/adapter" --data '{ "jobRunID": "1", "data": { "from": "ETH", "to": "USDT"} }'