Giter Club home page Giter Club logo

litecoin-container's Introduction

Build Status

Litecoin Docker container

Very simple Docker container running Litecoin daemon.

CI build and deployment

The Litecoin image is built on Travis CI. The built uses very simple workflow:

  • build & test on any branches,
  • build, test and deploy to Docker registry on the master branch.

Normally the workflow would be more sophisticated - e.g., GitFlow + release types in SemVer suffix + tag + immutable repository for releases, etc., but for now this is sufficient.

Build stages

The build has three stages:

  1. build - get all necessary binaries, build the Docker image, and it's BOM,
  2. test - perform all style and formal tests, check image security,
  3. deploy - push the image to the registry.

Deployment to Kubernetes cluster with Kustomize.io

Repository contains simple stateful set example of a deployment into a Kubernetes cluster.

Prerequisites:

  • litecoin namespace created,
  • litecoin secret created, containing litecoin.conf key with contents of the config file, including sensitive information like RPC auth,
  • 2x pvs created, with storage class of host-storage for persistence,
  • built litecoin image is available to the cluster,
  • kubectl installed and authenticated against the cluster.

For examples of creation of these resources with Terraform, please visit litecoin-tf repository.

To deploy to the cluster run

kubectl apply -k deploy
# Get stateful set info:
kubectl describe statefulset litecoin -n litecoin
# Watch pod logs:
kubectl logs litecoin-0 -n litecoin -f

Alternative Alpine image

The repository container also alternative alpine.dockerfile based on the latest Alpine image and glibc, which is smaller and more contained, but has its downfalls in sense of CVE vulnerabilities.

Litecoin trading processing scripts

Shell

The repository contains a simple script calculating hourly average trading prices for given currency pair. The script takes a path to the input CSV file and target date in YYYY-MM-DD format as arguments.

Example usage:

bin/trading-avg.sh resources/gemini_LTCUSD_1hr.csv 2021-06-22
at 23h 00m 00s the average price of LTCUSD was 119.215 with volume of 1981.5865455
at 22h 00m 00s the average price of LTCUSD was 120.56 with volume of 1067.2457715
at 21h 00m 00s the average price of LTCUSD was 120.82 with volume of 2029.6974064
at 20h 00m 00s the average price of LTCUSD was 121.245 with volume of 2424.3213983
...

Python

Python implementation of the same script.

Example usage:

poetry run python bin/trading_avg.py resources/gemini_LTCUSD_1hr.csv 2021-06-22
at 23h 00m 00s the average price of LTCUSD was 119.215 with volume of 1981.5865455
at 22h 00m 00s the average price of LTCUSD was 120.560 with volume of 1067.2457715
at 21h 00m 00s the average price of LTCUSD was 120.820 with volume of 2029.6974064
at 20h 00m 00s the average price of LTCUSD was 121.245 with volume of 2424.3213983
...

Formal test:

pylint bin/trading_avg.py
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Prerequisites

  • Python 3.6+

litecoin-container's People

Contributors

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