Code Monkey home page Code Monkey logo

bismuthplugins's Introduction

BismuthPlugins

Plugin API Documentation and demo plugins for Bismuth Nodes.

Bismuth is the first cryptocurrency and platform written from scratch, in Python.
https://github.com/bismuthfoundation/Bismuth

Need for plugin

Since Bismuth is entirely written in Python, it's easy to tweak, add features and test without compilation step.
However this makes upgrades harder since the core code has to be modified and then edits have to be carefully merged.

The Bismuth plugin system, although very lightweight, allows for action and filter hooks on critical events, for easy feature addition.

How to begin

  • Make sure you use current github code
  • Copy the plugins directory of this BismuthPlugins repo under your bismuth node directory
  • Run the node

The plugin framework

Overview

The plugins live in a "plugin" subdirectory.
Each plugin has its own directory.
For instance: plugins/ plugins/010_webhook/ plugins/100_test_block/ plugins/110_test_status

A plugin directory is formated as 000_pluginname. The numerical prefix acts as a priority level. Lowest prio gets run first.
Priorities of 000-099 are reserved for low level plugins.
100-199 for demo and example plugins.
900-999 for test plugins. In each plugin directory, at least one __init__.py file containing the plugin code is needed.

Activating / Deactivating plugins

As for now, all plugins present in plugins/ directory will be loaded.
So, only place the ones you want to run.
You can have a "plugins.available" directory and drop unused plugins there.

Minimal plugin

A plugin wanting to implement a "block" action hook only has to declare a simple function:

plugins/900_test/__init__.py:

def action_block(block):
    print(block)

Demo plugins

See https://github.com/bismuthfoundation/BismuthPlugins/tree/master/plugins directory (WIP).

Full API

The full API reference can be found in https://github.com/bismuthfoundation/BismuthPlugins/tree/master/doc directory (WIP).

See also

A nice post and interview by Portait on Steemit: https://steemit.com/cryptocurrency/@bitsignal/the-bismuth-plugin-system

A word of caution

Current plugins are harmless (but may need some config to run properly).
Future plugins could be more dangerous (like able to emit transactions). So, always make sure you trust the plugin source, and check its source code.
Certified plugins will come later on.

bismuthplugins's People

Contributors

eggpool avatar hclivess avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bismuthplugins's Issues

Propose some use cases!

The plugin system allows to execute action upon specific blockchain events (blocks, transactions) as well as at regular interval.

I have many use cases in mind, but I'm interested in yours.

What real world app, notification, usage do you think of?

Custom plugin compatibility lost

Saving this so we do not forget that SCCTR cannot be extended for real-world usecases until this is fixed, default custom plugin also affected

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.