Git Product home page Git Product logo

ansible-collection-blockchain's Introduction

Ansible Collection - trustwallet.blockchain

๐Ÿ›ก๏ธ Trust Wallet is a most trusted & secure non-custodial crypto wallet.

The Trust Wallet's Ansible Galaxy collection of roles to configure blockchain nodes.

NOTE: These roles set up non-validator nodes. Please check the requirements and an additional configuration at the chain's documentation if the validator or other node type is required.

List of the collection roles:

Ansible Collection Usage

Install the collection using the following command:

ansible-galaxy collection install trustwallet.blockchain

Example setting up Ethereum Full Node with the collection role:

# playbook.yml
---
- hosts: "all"
  gather_facts: true
  become: true
  
  pre_tasks:
    - name: "Install apt packages"
      ansible.builtin.apt:
        update_cache: true
        cache_valid_time: 86400
        pkg: python3
  
  roles:
    - role: trustwallet.blockchain.ethereum
      data_dir: /mnt/data
      geth_config:
        Eth:
          SyncMode: full

Concept

Ansible Roles consists of few phases (not every role contains all phase though):

  • load variables
  • install binaries
  • init blockchain node
  • set configuration
  • sync chain data from public backup

Contributing

The best way to submit feedback and report bugs is to open a GitHub issue.

Development

Molecule Testing Framework

Development/integration of the roles are configured with Molecule and EC2 driver.

It's recommended to develop inside Virtual environment

virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
ansible-galaxy install -r requirements.yml

Provide AWS credentials to allow Molecule provision ephemeral EC2 instance.

export AWS_PROFILE=
# or 
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_KEY=

Also provide the target region, image AMI and VPC subnet identifier

export AWS_REGION=us-east-1
export MOLECULE_VPC_SUBNET_ID=subnet-...
export MOLECULE_IMAGE=ami-... # ubuntu
export MOLECULE_IMAGE_DEBIAN=ami-... # debian for blockbook 

For each role there is a /molecule/<role> directory with configuration files.

Execute full integration scenario which includes steps to install all dependencies, create EC2 instance, execute role, test, cleanup and finally destroy EC2 instance run the following command (e.g. ethereum role).

molecule test -s ethereum

Or launch instance and execute a role

molecule converge -s ethereum

And verify

molecule verify -s ethereum

Jump to the node

molecule login -s ethereum

Finally, cleanup and destroy

molecule destroy -s ethereum

Build Ansible Galaxy Locally

To build the local version of the Ansible Galaxy collection:

ansible-galaxy collection build --force

The trustwallet-blockchain-x.x.x.tar.gz file will appear at the root of the project.

It can be installed for local testing by executing the following command:

ansible-galaxy collection install trustwallet-blockchain-0.x.x.tar.gz --force

References

License

Ansible Collection trustwallet.blockchain is available under the MIT license.

ansible-collection-blockchain's People

Contributors

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