Skip to content

Instantly share code, notes, and snippets.

@crowjdh
Last active January 15, 2020 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crowjdh/58df8d47d106f6a10a3c672870d60856 to your computer and use it in GitHub Desktop.
Save crowjdh/58df8d47d106f6a10a3c672870d60856 to your computer and use it in GitHub Desktop.
This may contain numerous errors. DO NOT treat this article as a reliable source of learning.

Ethereum

Overview

  • Blockchain
    • What it is: Hash-based growing list of blocks, commonly implemented using merkle-tree
    • Why: Data integrity, no double-spending, no central point of failure
    • How: Using public-private cryptography. Using public key as an identity of asset owner and private key as a proof of ownership(right to do action on the asset)
  • EVM
    • Public blockchain-based distributed computing platform using smart contract.
  • Solidity and smart contract

Tools

  • Ganache, dev env EVM
  • Truffle, dev env framework
  • Web3, Ethereum api for Javascript

References

BigchainDB

Overview

Database backed by MongoDB, communicate between nodes using Tendermint. Application comminucates with BigchainDB using BigchainDB Driver which then propagated to MongoDB.

References

Swarm

Overview

TODO: Describe purpose, usage and workflow Used to deploy and manage services on distributed hosts.

  • Setup for dev env

    • docker machine
  • Jargons

    Node

    A Docker daemon. Multiple nodes could run on single physical host(using virtualization or what not), or on physically distributed hosts.

    Service

    Same as service we use inside docker compose file format. Equivalent to a container without using scaling(typical way to think what service is), but multiple containers spawned from same service are considered to be a same service.

    Stack

    Group of services. You can think this as a whole application afchitecture, taking scaling into consideration.

    Manager node

    Nodes which manages worker nodes in swarm and manages stacks. It can also be a worker node at the same time.

    Worker node

    Pretty much what it says.

  • Commands

    • docker node: Manage nodes in swarm
      • ls: List nodes
      • ps: List processes running on certain node. Current node by default.
      • update
        • --availability: active/pause/drain(See here)
        • --role: Manager/Worker
    • docker service: Manage a service in swarm
      • ls: List services running on swarm(not a current host)
      • ps: List the tasks of one or more services
      • update: Update a single service. Useful for updating a service with newer image.
      • rollback: Revert changes to a service's configuration
      • scale: Scale one or multiple replicated services
    • docker stack
      • deploy: Deploy a new stack or update an existing stack
      • ls: List stacks
      • ps: List the tasks in the stack
      • rm: Remove one or more stacks
      • services: List the services in the stack

Stack, Service and container

dist-web Stack Node
Services Curl service dist-web_curl.1 host3
Web services dist-web_web.1 host3
dist-web_web.2 host2
dist-web_web.3 host1

Ingress routing mash

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment