Code Monkey home page Code Monkey logo

nkn-ansible's Introduction

nkn-ansible

This project provide a set of ansible script to install nkn[https://github.com/nknorg/nkn] to nodes. This project provide following ways to run nknd as daemon service.

  • Via docker
  • Via systemd unit service

Currently this project is tested to be used with following VPS/Cloud computing service.

  • Alibaba cloud
  • Vultr
  • Digital Ocean
  • Hosten

Usage

Prerequisites

You need manually prepare wallet file, nknc and nknd to corresponding location

Install nkn with systemd

  • Put wallet file to nkn/roles/nkn-systemd/files/wallet.dat
  • Put nknc binary to nkn/roles/nkn-systemd/files/nknc
  • Put nknd binary to nkn/roles/nkn-systemd/files/nknd

Install nkn with docker

  • Put wallet file to nkn/roles/nkn-docker/files/wallet.dat

Then you should have an inventory file that holds info of your nodes. A sample host file inventory/host.yml looks like something bellow

---
all:
  vars:
    version: v1.0.1b-beta
    arch: linux-amd64
    nkn:
      image: zhtangsh/nkn:{{version}}
      binary: https://github.com/nknorg/nkn/releases/download/{{ version }}/{{ arch }}.zip
      addr: NKNP9dmeY9cuWdYkJzRkFcdJGrpWyGmJWrrA
      batchSize: 256
  children:
    centos:
      vars:
        ansible_ssh_port: 22
      hosts:
        135.181.245.82:
          ansible_ssh_user: root
          ansible_ssh_pass: root

Installation

Run following ansible command to install nkn service via systemd service.

Alibaba cloud with inventory file inventory/ali.yml

ansible-playbook -i inventory/ali.yml playbook/nkn-systemd.yml

Hosten with inventory file inventory/hosten.yml

ansible-playbook -i inventory/hosten.yml playbook/nkn-systemd.yml

Run following ansible command to install nkn service via docker.

Vultr with inventory file inventory/vultr.yml

ansible-playbook -i inventory/vultr.yml playbook/nkn-docker.yml

Digital Ocean with inventory file inventory/do.yml

ansible-playbook -i inventory/do.yml playbook/nkn-docker.yml

Status check

For nkn installed with systemd, run following command to perform status check

ansible-playbook -i inventory/ali.yml playbook/nkn-check-systemd.yml

For nkn installed with docker, run following command to perform status check

ansible-playbook -i inventory/vultr.yml playbook/nkn-check-docker.yml

This check script will collect infomation via nknc info -s. A sample output looks like bellow.

ok: [95.179.156.213] => {
    "msg": "version=v0.7.6-alpha, syncState:PersistFinished, height:625034, relayCount:19.9033, upTime:22h56m3s"
}
ok: [95.179.156.213] => {
    "msg": "Mined 0"
}

Community

nkn-ansible's People

Contributors

zhtangsh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.