GithubHelp home page GithubHelp logo

joengelh / multichain-ansible-automation Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 94 KB

Automated rollout, permissioning, configuration and autostart of the multichain blockchain aswell as its explorer

License: The Unlicense

Jinja 100.00%
multichain ansible blockchain configuration-management

multichain-ansible-automation's Introduction

Multichain Ansible Automation

This project can be used to deploy and configure the distributed ledger Multichain based on the Bitcoin technology on as many hosts as required using the configuration engine Ansible. Afterwards all nodes are configured to open rpc and network port to everyone and have a getting_started script in the ansible´s home directory, which is also being copied back to the ansible master containing user and key. Thus it is not advised to deploy a multichain demo with this repository in a publicly accessible network.

A demo for this setup, fitting the existing inventory can be found on Github aswell.

grafik

Requirements

In order to deploy the multichain only the configurations hosts public SSH key has to be copied to the hosts root directory using the command:

ssh-copy-id root@<host_address>

and the inventory has to be adjusted according to the developers needs.

Therafer using the command

ansible-playbook deploy.yml -i inventory

installs, starts and permissions the blockchain on all nodes.

In Case the ansible_hosts are already set up and only the software needs to be installed, executing the following playbook like so:

ansible-playbook redeploy.yml -i inventory

will do the job in a faster manner.

Configuration

Some basic configuration of the node setup can be done by modifying the host_vars/all.yml file:

---
blockchainName: "supplyChain"
networkPort: 7700
rpcPort: 7755
explorerPort: 4444

The Inventory

In the Inventory there are 6 groups used to diffrentiate between the hosts.

  1. For security reasons, only the configuration of the network interface and the user configuration are done using the root user, neccecitating in the roottotal group. This group includes the root user aswell as the IP-Addresses of all hosts taking part in the distributed ledger.
  2. The serviceProvider group can only include one host, since a blockchain can only be created at one place, with the other nodes joining the network later.
  3. The readers group are members of the Blockchain network, who can only read from the blockchain, not write or issue assets.
  4. The writers group includes all members, who can read, write and issue assets on the blockchain
  5. The partners group simply is the combination if readers and writers
  6. The total group includes all hosts taking part in the network

The Roles

roles desription target hosts
user-add adds ansible user and passwordless sudo roottotal
network configures the network interfaces roottotal
yum-update updates all packages and repositories total
hostname-set sets hostname to be equal to inventory name total
time-set sets central european time zone total
multichain-install installs and configures the servers to run multichain total
multichain-deploy creates genesis block, starts blockchain & explorer serviceProvider
multichain-attach connects the partner servers and permissions them partners
multichain-getting-started deploys sample code with credentials for every member total

Tools

cleanup.yml

This tool uninstalls multichain from the participating nodes, removes the @reboot cronjobs, installation and blockchain data, then reboots the system to stop the processes. The tool can be run using

ansible-playbook cleanup.yml -i inventory

multichain explorer

Included in the role multichain-deploy is also the installation of the multichain explorer 2. This is a webaplication used to display broad metrics about the distributed ledger. It can be accessed at the serviceProviders address: <server_ip>:{{ explorerPort }}

getting_started.py

At the end of the Ansible Playbook run deploy.yml a pythonscript in the projects root directory is created containing an import of a python module and the connection details to the contractor node. With this script you can start developing your multichain solution right away.

multichain-ansible-automation's People

Contributors

joengelh avatar

Watchers

 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.