Monday 9-27-21 changes

This commit is contained in:
philip-morlier 2021-09-27 14:26:42 -07:00
parent a030ac72c0
commit 7de75e788b
No known key found for this signature in database
GPG Key ID: 0323A143B7B6F663
46 changed files with 585 additions and 209 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,43 +0,0 @@
.. _anatomy:
==============
Plugin Anatomy
==============
.. todo:: fill in disections of archetypal plugins
.. code-block:: go
package main
import (
"github.com/openrelayxyz/plugeth-utils/core"
"gopkg.in/urfave/cli.v1"
)
var (
log core.Logger
)
type myservice struct{}
func (*myservice) Hello() string {
return "Hello world"
}
func Initialize(ctx *cli.Context, loader core.PluginLoader, logger core.Logger) {
log = logger
log.Info("Initialized hello")
}
func GetAPIs(node core.Node, backend core.Backend) []core.API {
defer log.Info("APIs Initialized")
return []core.API{
{
Namespace: "mynamespace",
Version: "1.0",
Service: &myservice{},
Public: true,
},
}
}``

View File

@ -6,6 +6,8 @@ Build and Deploy
.. contents:: :local:
If you are ready to start building your own plugins go ahead and start `here`_
Setting up the environment
**************************
@ -14,10 +16,10 @@ Setting up the environment
PluGeth is an application built in three seperate repositories.
* `PluGeth`_
* `PluGethUtils`_
* `PluGethPlugins`_
* `PluGeth-Utils`_
* `PluGeth-Plugins`_
Once all three are cloned into their own directories you are ready to begin. First we need to build geth though the PluGeth project. Navigate to ``plugeth/cmd/geth`` and run:
For our purposed here you will only need to clone Plugeth and Plugeth-Plugins. Once you have them cloned you are ready to begin. First we need to build geth though the PluGeth project. Navigate to ``plugeth/cmd/geth`` and run:
.. code-block:: shell
@ -43,7 +45,7 @@ At this point you are ready to start downloading local ethereum nodes. In order
Build a plugin
**************
Navigate to ``plugethPlugins/packages/hello``. Inside you will see a ``main.go`` file. From this location run:
For the sake of this tutorial we will be building the Hello plugin. Navigate to ``plugethPlugins/packages/hello``. Inside you will see a ``main.go`` file. From this location run:
.. code-block:: shell
@ -63,7 +65,12 @@ You should see that the network has responded with:
``{"jsonrpc":"2.0","id":0,"result":"Hello world"}``
Congradulations. You have just built and run your first Plugeth plugin.
Congradulations. You have just built and run your first Plugeth plugin. From here you can follow the steps above to build any of the plugins you choose.
.. NOTE:: Each plugin will vary in terms of the requirements to deploy. Refer to the documentation of the plugin itself in order to assure
that you know how to use it.
.. _space for practice: https://tour.golang.org/welcome/1
.. _tutorial: https://tour.golang.org/welcome/1
@ -71,5 +78,5 @@ Congradulations. You have just built and run your first Plugeth plugin.
.. _Go: https://golang.org/doc/
.. _Geth: https://geth.ethereum.org/
.. _PluGeth: https://github.com/openrelayxyz/plugeth
.. _PluGethUtils: https://github.com/openrelayxyz/plugeth-utils
.. _PluGethPlugins: https://github.com/openrelayxyz/plugeth-plugins
.. _PluGeth-Utils: https://github.com/openrelayxyz/plugeth-utils
.. _PluGeth-Plugins: https://github.com/openrelayxyz/plugeth-plugins

View File

@ -0,0 +1,46 @@
.. _custom:
========================
Building a Custom Plugin
========================
Before setting out to build a plugin it will be helpful to be familiar with the basic :ref:`types` of plugins. Depending on what you intend to do certain aspects of implimentation will be neccisary.
In general, no matter which type of plugin you intend to build, below are common aspects which will be shared by all plugins.
Most Basic implimentation
=========================
A plugin will need its own package located in the Plugeth-Utils packages directory. The package will need to include a main.go from which the .so file will be built. The package and main file should share the same name and the name should be a word that describes the basic functionality of the plugin.
All plugins will need to be initialized with an **initialize function**. The initialize function will need to be passed at least three arguments: a cli.Context, core.PluginLoader, and a core.Logger.
And so, all plugins will have an intial template that looks something like this:
.. code-block:: Go
package main
import (
"github.com/openrelayxyz/plugeth-utils/core"
"gopkg.in/urfave/cli.v1"
)
var log core.Logger
func Initialize(ctx *cli.Context, loader core.PluginLoader, logger core.Logger) {
log = logger
log.Info("loaded New Custom Plugin")
}
Specialization
==============
**Hooks**
Plugeth provides several hooks with which data of various kinds can be captured and manipulated. Once a plugin has been initalized it will be up to the hooks utilized to determine the behavior of the plugin.

View File

@ -6,15 +6,20 @@
PluGeth
=======
PluGeth is a fork of the `Go Ethereum Client Geth`_ that implements a plugin architecture, allowing developers to extend Geth's capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.
PluGeth is a fork of the `Go Ethereum Client Geth`_ that implements a plugin architecture, allowing developers to extend Geth's capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.
From Here:
----------
- Ready for an overview of the project and some context? :ref:`project`
- If your goal is to run existing plugns without sourcecode: :ref:`run`
- If your goal is to build and deploy existing plugins or make custom plugins: :ref:`build`
.. warning:: Right now PluGeth is in early development. We are
still settling on some of the plugin APIs, and are
not yet making official releases. From an operational
perspective, PluGeth should be as stable as upstream Geth less whatever isstability is added by plugins you might run. But if you plan to run PluGeth today, be aware that furture updates will likely break you plugins.
Table of Contents
*****************
@ -25,14 +30,16 @@ Table of Contents
project
types
anatomy
.. toctree::
:maxdepth: 1
:caption: Tutorials
run
build
custom
.. toctree::
:maxdepth: 1
@ -40,7 +47,7 @@ Table of Contents
system_req
plugin_loader
hooks
plugin_hooks
core_restricted
api

View File

@ -4,4 +4,10 @@
Plugin Loader
=============
.. todo:: breakdown of plugin loader function
At the heart of the PluGeth project is the `PluginLoader`_.
Upon invocation the PluginLoader will parse through a list of known plugins and either return the plugin name passed to it or, if not found, append to that list. Additionally the loader will check the function signature of the plugin to assure complience with anticipated behavior. Once these checks are passed and the plugin name and function signature is validated the plugin will be invoked.
.. _PluginLoader: https://github.com/openrelayxyz/plugeth/blob/develop/plugins/plugin_loader.go

View File

@ -0,0 +1,13 @@
.. _quickstart:
Quickstart
==========
.. contents:: :local:
.. toctree::
:maxdepth: 1
:caption: tutorial
build
constom

View File

@ -0,0 +1,8 @@
.. _run:
===
Run
===
.. todo:: Need explination of how to download and run plugin
binaries.

View File

@ -14,7 +14,7 @@ In general these plugins provide new json rpc methods. They will requirre an ini
Subcommand
------------
A subcommand redifines the total behavior of Geth and could stand on its own.
A subcommand redifines the total behavior of Geth and could stand on its own. I contrast with the other plugin types which, in general, are meant to capture and manipulate information, a subcommand is meant to change to overall behavior of Geth. It may do this in order to capture information but the primary fuctionality is a modulation of geth behaviour.
Tracers
-------

View File

@ -38,17 +38,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#flags">Flags</a></li>

View File

@ -15,8 +15,8 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="System Requirements" href="system_req.html" />
<link rel="prev" title="Plugin Anatomy" href="anatomy.html" />
<link rel="next" title="Building a Custom Plugin" href="custom.html" />
<link rel="prev" title="Run" href="run.html" />
</head>
<body class="wy-body-for-nav">
@ -38,21 +38,22 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Build and Deploy</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#setting-up-the-environment">Setting up the environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="#build-a-plugin">Build a plugin</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -93,6 +94,7 @@
<li><p><a class="reference internal" href="#build-a-plugin" id="id2">Build a plugin</a></p></li>
</ul>
</div>
<p>If you are ready to start building your own plugins go ahead and start <a href="#id3"><span class="problematic" id="id4">`here`_</span></a></p>
<div class="section" id="setting-up-the-environment">
<h2><a class="toc-backref" href="#id1">Setting up the environment</a><a class="headerlink" href="#setting-up-the-environment" title="Permalink to this headline"></a></h2>
<div class="admonition note">
@ -102,10 +104,10 @@
<p>PluGeth is an application built in three seperate repositories.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/openrelayxyz/plugeth">PluGeth</a></p></li>
<li><p><a class="reference external" href="https://github.com/openrelayxyz/plugeth-utils">PluGethUtils</a></p></li>
<li><p><a class="reference external" href="https://github.com/openrelayxyz/plugeth-plugins">PluGethPlugins</a></p></li>
<li><p><a class="reference external" href="https://github.com/openrelayxyz/plugeth-utils">PluGeth-Utils</a></p></li>
<li><p><a class="reference external" href="https://github.com/openrelayxyz/plugeth-plugins">PluGeth-Plugins</a></p></li>
</ul>
<p>Once all three are cloned into their own directories you are ready to begin. First we need to build geth though the PluGeth project. Navigate to <code class="docutils literal notranslate"><span class="pre">plugeth/cmd/geth</span></code> and run:</p>
<p>For our purposed here you will only need to clone Plugeth and Plugeth-Plugins. Once you have them cloned you are ready to begin. First we need to build geth though the PluGeth project. Navigate to <code class="docutils literal notranslate"><span class="pre">plugeth/cmd/geth</span></code> and run:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ go get
</pre></div>
</div>
@ -125,7 +127,7 @@
</div>
<div class="section" id="build-a-plugin">
<h2><a class="toc-backref" href="#id2">Build a plugin</a><a class="headerlink" href="#build-a-plugin" title="Permalink to this headline"></a></h2>
<p>Navigate to <code class="docutils literal notranslate"><span class="pre">plugethPlugins/packages/hello</span></code>. Inside you will see a <code class="docutils literal notranslate"><span class="pre">main.go</span></code> file. From this location run:</p>
<p>For the sake of this tutorial we will be building the Hello plugin. Navigate to <code class="docutils literal notranslate"><span class="pre">plugethPlugins/packages/hello</span></code>. Inside you will see a <code class="docutils literal notranslate"><span class="pre">main.go</span></code> file. From this location run:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ go build -buildmode<span class="o">=</span>plugin
</pre></div>
</div>
@ -138,7 +140,12 @@
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="sb">``</span><span class="o">{</span><span class="s2">&quot;jsonrpc&quot;</span>:<span class="s2">&quot;2.0&quot;</span>,<span class="s2">&quot;id&quot;</span>:0,<span class="s2">&quot;result&quot;</span>:<span class="s2">&quot;Hello world&quot;</span><span class="o">}</span><span class="sb">``</span>
</pre></div>
</div>
<p>Congradulations. You have just built and run your first Plugeth plugin.</p>
<p>Congradulations. You have just built and run your first Plugeth plugin. From here you can follow the steps above to build any of the plugins you choose.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Each plugin will vary in terms of the requirements to deploy. Refer to the documentation of the plugin itself in order to assure
that you know how to use it.</p>
</div>
</div>
</div>
@ -146,8 +153,8 @@
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="anatomy.html" class="btn btn-neutral float-left" title="Plugin Anatomy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="system_req.html" class="btn btn-neutral float-right" title="System Requirements" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="run.html" class="btn btn-neutral float-left" title="Run" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="custom.html" class="btn btn-neutral float-right" title="Building a Custom Plugin" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View File

@ -37,17 +37,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -16,7 +16,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="API" href="api.html" />
<link rel="prev" title="Plugin Hooks" href="hooks.html" />
<link rel="prev" title="Plugin Hooks" href="plugin_hooks.html" />
</head>
<body class="wy-body-for-nav">
@ -38,17 +38,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -93,7 +94,7 @@
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="hooks.html" class="btn btn-neutral float-left" title="Plugin Hooks" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="plugin_hooks.html" class="btn btn-neutral float-left" title="Plugin Hooks" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="api.html" class="btn btn-neutral float-right" title="API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

View File

@ -0,0 +1,152 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Building a Custom Plugin &mdash; Plugeth Austin Roberts documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="System Requirements" href="system_req.html" />
<link rel="prev" title="Build and Deploy" href="build.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Plugeth
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption"><span class="caption-text">Overview</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Building a Custom Plugin</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#most-basic-implimentation">Most Basic implimentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#specialization">Specialization</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
<p class="caption"><span class="caption-text">Contact</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Get in touch with us</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Plugeth</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
<li>Building a Custom Plugin</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/custom.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="building-a-custom-plugin">
<span id="custom"></span><h1>Building a Custom Plugin<a class="headerlink" href="#building-a-custom-plugin" title="Permalink to this headline"></a></h1>
<p>Before setting out to build a plugin it will be helpful to be familiar with the basic <a class="reference internal" href="types.html#types"><span class="std std-ref">Basic Types of Plugins</span></a> of plugins. Depending on what you intend to do certain aspects of implimentation will be neccisary.</p>
<p>In general, no matter which type of plugin you intend to build, below are common aspects which will be shared by all plugins.</p>
<div class="section" id="most-basic-implimentation">
<h2>Most Basic implimentation<a class="headerlink" href="#most-basic-implimentation" title="Permalink to this headline"></a></h2>
<p>A plugin will need its own package located in the Plugeth-Utils packages directory. The package will need to include a main.go from which the .so file will be built. The package and main file should share the same name and the name should be a word that describes the basic functionality of the plugin.</p>
<p>All plugins will need to be initialized with an <strong>initialize function</strong>. The initialize function will need to be passed at least three arguments: a cli.Context, core.PluginLoader, and a core.Logger.</p>
<p>And so, all plugins will have an intial template that looks something like this:</p>
<div class="highlight-Go notranslate"><div class="highlight"><pre><span></span><span class="kn">package</span> <span class="nx">main</span>
<span class="kn">import</span> <span class="p">(</span>
<span class="s">&quot;github.com/openrelayxyz/plugeth-utils/core&quot;</span>
<span class="s">&quot;gopkg.in/urfave/cli.v1&quot;</span>
<span class="p">)</span>
<span class="kd">var</span> <span class="nx">log</span> <span class="nx">core</span><span class="p">.</span><span class="nx">Logger</span>
<span class="kd">func</span> <span class="nx">Initialize</span><span class="p">(</span><span class="nx">ctx</span> <span class="o">*</span><span class="nx">cli</span><span class="p">.</span><span class="nx">Context</span><span class="p">,</span> <span class="nx">loader</span> <span class="nx">core</span><span class="p">.</span><span class="nx">PluginLoader</span><span class="p">,</span> <span class="nx">logger</span> <span class="nx">core</span><span class="p">.</span><span class="nx">Logger</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">log</span> <span class="p">=</span> <span class="nx">logger</span>
<span class="nx">log</span><span class="p">.</span><span class="nx">Info</span><span class="p">(</span><span class="s">&quot;loaded New Custom Plugin&quot;</span><span class="p">)</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="specialization">
<h2>Specialization<a class="headerlink" href="#specialization" title="Permalink to this headline"></a></h2>
<p><strong>Hooks</strong></p>
<p>Plugeth provides several hooks with which data of various kinds can be captured and manipulated. Once a plugin has been initalized it will be up to the hooks utilized to determine the behavior of the plugin.</p>
</div>
</div>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="build.html" class="btn btn-neutral float-left" title="Build and Deploy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="system_req.html" class="btn btn-neutral float-right" title="System Requirements" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2021, Philip Morlier.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -36,17 +36,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -14,9 +14,7 @@
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Core vs Restricted packages in Plugeth-utils" href="core_restricted.html" />
<link rel="prev" title="Plugin Loader" href="plugin_loader.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
@ -38,26 +36,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul class="current">
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Plugin Hooks</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#selected-hooks">Selected Hooks</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#stateupdate">StateUpdate</a></li>
<li class="toctree-l3"><a class="reference internal" href="#appendancient">AppendAncient</a></li>
<li class="toctree-l3"><a class="reference internal" href="#newhead">NewHead</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getrpccalls">GetRPCCalls</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -130,10 +120,7 @@
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="plugin_loader.html" class="btn btn-neutral float-left" title="Plugin Loader" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="core_restricted.html" class="btn btn-neutral float-right" title="Core vs Restricted packages in Plugeth-utils" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<footer>
<hr/>

View File

@ -37,17 +37,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -83,6 +84,13 @@
<div class="section" id="plugeth">
<h1>PluGeth<a class="headerlink" href="#plugeth" title="Permalink to this headline"></a></h1>
<p>PluGeth is a fork of the <a class="reference external" href="https://github.com/ethereum/go-ethereum">Go Ethereum Client Geth</a> that implements a plugin architecture, allowing developers to extend Geths capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.</p>
<div class="section" id="from-here">
<h2>From Here:<a class="headerlink" href="#from-here" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p>Ready for an overview of the project and some context? <a class="reference internal" href="project.html#project"><span class="std std-ref">Project Design</span></a></p></li>
<li><p>If your goal is to run existing plugns without sourcecode: <a class="reference internal" href="run.html#run"><span class="std std-ref">Run</span></a></p></li>
<li><p>If your goal is to build and deploy existing plugins or make custom plugins: <a class="reference internal" href="build.html#build"><span class="std std-ref">Build and Deploy</span></a></p></li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Right now PluGeth is in early development. We are
@ -91,19 +99,20 @@ not yet making official releases. From an operational
perspective, PluGeth should be as stable as upstream Geth less whatever isstability is added by plugins you might run. But if you plan to run PluGeth today, be aware that furture updates will likely break you plugins.</p>
</div>
<div class="section" id="table-of-contents">
<h2>Table of Contents<a class="headerlink" href="#table-of-contents" title="Permalink to this headline"></a></h2>
<h3>Table of Contents<a class="headerlink" href="#table-of-contents" title="Permalink to this headline"></a></h3>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">Overview</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
</div>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
</div>
<div class="toctree-wrapper compound">
@ -111,7 +120,7 @@ perspective, PluGeth should be as stable as upstream Geth less whatever isstabil
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -123,6 +132,7 @@ perspective, PluGeth should be as stable as upstream Geth less whatever isstabil
</ul>
</div>
</div>
</div>
</div>

View File

@ -36,17 +36,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -14,7 +14,9 @@
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Core vs Restricted packages in Plugeth-utils" href="core_restricted.html" />
<link rel="prev" title="Plugin Loader" href="plugin_loader.html" />
</head>
<body class="wy-body-for-nav">
@ -36,17 +38,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -90,7 +93,10 @@
</div>
</div>
<footer>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="plugin_loader.html" class="btn btn-neutral float-left" title="Plugin Loader" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="core_restricted.html" class="btn btn-neutral float-right" title="Core vs Restricted packages in Plugeth-utils" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View File

@ -15,7 +15,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Plugin Hooks" href="hooks.html" />
<link rel="next" title="Plugin Hooks" href="plugin_hooks.html" />
<link rel="prev" title="System Requirements" href="system_req.html" />
</head>
@ -38,17 +38,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -83,10 +84,8 @@
<div class="section" id="plugin-loader">
<span id="id1"></span><h1>Plugin Loader<a class="headerlink" href="#plugin-loader" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="id2">
<p class="admonition-title">Todo</p>
<p>breakdown of plugin loader function</p>
</div>
<p>At the heart of the PluGeth project is the <a class="reference external" href="https://github.com/openrelayxyz/plugeth/blob/develop/plugins/plugin_loader.go">PluginLoader</a>.</p>
<p>Upon invocation the PluginLoader will parse through a list of known plugins and either return the plugin name passed to it or, if not found, append to that list. Additionally the loader will check the function signature of the plugin to assure complience with anticipated behavior. Once these checks are passed and the plugin name and function signature is validated the plugin will be invoked.</p>
</div>
@ -94,7 +93,7 @@
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="system_req.html" class="btn btn-neutral float-left" title="System Requirements" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="hooks.html" class="btn btn-neutral float-right" title="Plugin Hooks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="plugin_hooks.html" class="btn btn-neutral float-right" title="Plugin Hooks" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View File

@ -36,17 +36,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -47,17 +47,18 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -0,0 +1,121 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quickstart &mdash; Plugeth Austin Roberts documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Plugeth
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption"><span class="caption-text">Overview</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
<p class="caption"><span class="caption-text">Contact</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Get in touch with us</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Plugeth</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
<li>Quickstart</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/quickstart.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="quickstart">
<span id="id1"></span><h1>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">tutorial</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2021, Philip Morlier.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Plugin Anatomy &mdash; Plugeth Austin Roberts documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Run &mdash; Plugeth Austin Roberts documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
@ -35,20 +35,21 @@
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption"><span class="caption-text">Overview</span></p>
<ul class="current">
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -71,9 +72,9 @@
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
<li>Plugin Anatomy</li>
<li>Run</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/anatomy.rst.txt" rel="nofollow"> View page source</a>
<a href="_sources/run.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
@ -81,55 +82,13 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="plugin-anatomy">
<span id="anatomy"></span><h1>Plugin Anatomy<a class="headerlink" href="#plugin-anatomy" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="id1">
<div class="section" id="run">
<span id="id1"></span><h1>Run<a class="headerlink" href="#run" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="id2">
<p class="admonition-title">Todo</p>
<p>fill in disections of archetypal plugins</p>
<p>Need explination of how to download and run plugin
binaries.</p>
</div>
<div class="highlight-go notranslate"><div class="highlight"><pre><span></span><span class="kn">package</span> <span class="nx">main</span>
</pre></div>
</div>
<dl class="simple">
<dt>import (</dt><dd><p>“github.com/openrelayxyz/plugeth-utils/core”
“gopkg.in/urfave/cli.v1”</p>
</dd>
</dl>
<p>)</p>
<dl class="simple">
<dt>var (</dt><dd><p>log core.Logger</p>
</dd>
</dl>
<p>)</p>
<p>type myservice struct{}</p>
<dl class="simple">
<dt>func (<a href="#id2"><span class="problematic" id="id3">*</span></a>myservice) Hello() string {</dt><dd><p>return “Hello world”</p>
</dd>
</dl>
<p>}</p>
<dl class="simple">
<dt>func Initialize(ctx <a href="#id4"><span class="problematic" id="id5">*</span></a>cli.Context, loader core.PluginLoader, logger core.Logger) {</dt><dd><p>log = logger
log.Info(“Initialized hello”)</p>
</dd>
</dl>
<p>}</p>
<dl>
<dt>func GetAPIs(node core.Node, backend core.Backend) []core.API {</dt><dd><p>defer log.Info(“APIs Initialized”)
return []core.API{</p>
<blockquote>
<div><dl class="simple">
<dt>{</dt><dd><p>Namespace: “mynamespace”,
Version: “1.0”,
Service: &amp;myservice{},
Public: true,</p>
</dd>
</dl>
<p>},</p>
</div></blockquote>
<p>}</p>
</dd>
</dl>
<p>}``</p>
</div>

View File

@ -39,17 +39,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Plugin Loader" href="plugin_loader.html" />
<link rel="prev" title="Build and Deploy" href="build.html" />
<link rel="prev" title="Building a Custom Plugin" href="custom.html" />
</head>
<body class="wy-body-for-nav">
@ -38,17 +38,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -91,7 +92,7 @@
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="build.html" class="btn btn-neutral float-left" title="Build and Deploy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="custom.html" class="btn btn-neutral float-left" title="Building a Custom Plugin" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="plugin_loader.html" class="btn btn-neutral float-right" title="Plugin Loader" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

View File

@ -15,7 +15,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Plugin Anatomy" href="anatomy.html" />
<link rel="next" title="Run" href="run.html" />
<link rel="prev" title="Project Design" href="project.html" />
</head>
@ -44,17 +44,18 @@
<li class="toctree-l2"><a class="reference internal" href="#subscriptions">Subscriptions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
@ -99,7 +100,7 @@
</div>
<div class="section" id="subcommand">
<h2>Subcommand<a class="headerlink" href="#subcommand" title="Permalink to this headline"></a></h2>
<p>A subcommand redifines the total behavior of Geth and could stand on its own.</p>
<p>A subcommand redifines the total behavior of Geth and could stand on its own. I contrast with the other plugin types which, in general, are meant to capture and manipulate information, a subcommand is meant to change to overall behavior of Geth. It may do this in order to capture information but the primary fuctionality is a modulation of geth behaviour.</p>
</div>
<div class="section" id="tracers">
<h2>Tracers<a class="headerlink" href="#tracers" title="Permalink to this headline"></a></h2>
@ -122,7 +123,7 @@
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="project.html" class="btn btn-neutral float-left" title="Project Design" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="anatomy.html" class="btn btn-neutral float-right" title="Plugin Anatomy" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="run.html" class="btn btn-neutral float-right" title="Run" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View File

@ -36,17 +36,18 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="project.html">Project Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">Basic Types of Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="anatomy.html">Plugin Anatomy</a></li>
</ul>
<p class="caption"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="run.html">Run</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Build and Deploy</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom.html">Building a Custom Plugin</a></li>
</ul>
<p class="caption"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="system_req.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_loader.html">Plugin Loader</a></li>
<li class="toctree-l1"><a class="reference internal" href="hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin_hooks.html">Plugin Hooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="core_restricted.html">Core vs Restricted packages in Plugeth-utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

View File

@ -1,7 +0,0 @@
.. _anatomy:
==============
Plugin Anatomy
==============
.. todo:: fill in disections of archetypal plugins

View File

@ -6,6 +6,8 @@ Build and Deploy
.. contents:: :local:
If you are ready to start building your own plugins go ahead and start `here`_
Setting up the environment
**************************
@ -14,10 +16,10 @@ Setting up the environment
PluGeth is an application built in three seperate repositories.
* `PluGeth`_
* `PluGethUtils`_
* `PluGethPlugins`_
* `PluGeth-Utils`_
* `PluGeth-Plugins`_
Once all three are cloned into their own directories you are ready to begin. First we need to build geth though the PluGeth project. Navigate to ``plugeth/cmd/geth`` and run:
For our purposed here you will only need to clone Plugeth and Plugeth-Plugins. Once you have them cloned you are ready to begin. First we need to build geth though the PluGeth project. Navigate to ``plugeth/cmd/geth`` and run:
.. code-block:: shell
@ -43,7 +45,7 @@ At this point you are ready to start downloading local ethereum nodes. In order
Build a plugin
**************
Navigate to ``plugethPlugins/packages/hello``. Inside you will see a ``main.go`` file. From this location run:
For the sake of this tutorial we will be building the Hello plugin. Navigate to ``plugethPlugins/packages/hello``. Inside you will see a ``main.go`` file. From this location run:
.. code-block:: shell
@ -63,7 +65,12 @@ You should see that the network has responded with:
``{"jsonrpc":"2.0","id":0,"result":"Hello world"}``
Congradulations. You have just built and run your first Plugeth plugin.
Congradulations. You have just built and run your first Plugeth plugin. From here you can follow the steps above to build any of the plugins you choose.
.. NOTE:: Each plugin will vary in terms of the requirements to deploy. Refer to the documentation of the plugin itself in order to assure
that you know how to use it.
.. _space for practice: https://tour.golang.org/welcome/1
.. _tutorial: https://tour.golang.org/welcome/1
@ -71,5 +78,5 @@ Congradulations. You have just built and run your first Plugeth plugin.
.. _Go: https://golang.org/doc/
.. _Geth: https://geth.ethereum.org/
.. _PluGeth: https://github.com/openrelayxyz/plugeth
.. _PluGethUtils: https://github.com/openrelayxyz/plugeth-utils
.. _PluGethPlugins: https://github.com/openrelayxyz/plugeth-plugins
.. _PluGeth-Utils: https://github.com/openrelayxyz/plugeth-utils
.. _PluGeth-Plugins: https://github.com/openrelayxyz/plugeth-plugins

46
documentation/custom.rst Normal file
View File

@ -0,0 +1,46 @@
.. _custom:
========================
Building a Custom Plugin
========================
Before setting out to build a plugin it will be helpful to be familiar with the basic :ref:`types` of plugins. Depending on what you intend to do certain aspects of implimentation will be neccisary.
In general, no matter which type of plugin you intend to build, below are common aspects which will be shared by all plugins.
Most Basic implimentation
=========================
A plugin will need its own package located in the Plugeth-Utils packages directory. The package will need to include a main.go from which the .so file will be built. The package and main file should share the same name and the name should be a word that describes the basic functionality of the plugin.
All plugins will need to be initialized with an **initialize function**. The initialize function will need to be passed at least three arguments: a cli.Context, core.PluginLoader, and a core.Logger.
And so, all plugins will have an intial template that looks something like this:
.. code-block:: Go
package main
import (
"github.com/openrelayxyz/plugeth-utils/core"
"gopkg.in/urfave/cli.v1"
)
var log core.Logger
func Initialize(ctx *cli.Context, loader core.PluginLoader, logger core.Logger) {
log = logger
log.Info("loaded New Custom Plugin")
}
Specialization
==============
**Hooks**
Plugeth provides several hooks with which data of various kinds can be captured and manipulated. Once a plugin has been initalized it will be up to the hooks utilized to determine the behavior of the plugin.

View File

@ -6,15 +6,20 @@
PluGeth
=======
PluGeth is a fork of the `Go Ethereum Client Geth`_ that implements a plugin architecture, allowing developers to extend Geth's capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.
PluGeth is a fork of the `Go Ethereum Client Geth`_ that implements a plugin architecture, allowing developers to extend Geth's capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.
From Here:
----------
- Ready for an overview of the project and some context? :ref:`project`
- If your goal is to run existing plugns without sourcecode: :ref:`run`
- If your goal is to build and deploy existing plugins or make custom plugins: :ref:`build`
.. warning:: Right now PluGeth is in early development. We are
still settling on some of the plugin APIs, and are
not yet making official releases. From an operational
perspective, PluGeth should be as stable as upstream Geth less whatever isstability is added by plugins you might run. But if you plan to run PluGeth today, be aware that furture updates will likely break you plugins.
Table of Contents
*****************
@ -25,14 +30,16 @@ Table of Contents
project
types
anatomy
.. toctree::
:maxdepth: 1
:caption: Tutorials
run
build
custom
.. toctree::
:maxdepth: 1

View File

@ -4,4 +4,10 @@
Plugin Loader
=============
.. todo:: breakdown of plugin loader function
At the heart of the PluGeth project is the `PluginLoader`_.
Upon invocation the PluginLoader will parse through a list of known plugins and either return the plugin name passed to it or, if not found, append to that list. Additionally the loader will check the function signature of the plugin to assure complience with anticipated behavior. Once these checks are passed and the plugin name and function signature is validated the plugin will be invoked.
.. _PluginLoader: https://github.com/openrelayxyz/plugeth/blob/develop/plugins/plugin_loader.go

View File

@ -0,0 +1,13 @@
.. _quickstart:
Quickstart
==========
.. contents:: :local:
.. toctree::
:maxdepth: 1
:caption: tutorial
build
constom

8
documentation/run.rst Normal file
View File

@ -0,0 +1,8 @@
.. _run:
===
Run
===
.. todo:: Need explination of how to download and run plugin
binaries.

View File

@ -14,7 +14,7 @@ In general these plugins provide new json rpc methods. They will requirre an ini
Subcommand
------------
A subcommand redifines the total behavior of Geth and could stand on its own.
A subcommand redifines the total behavior of Geth and could stand on its own. I contrast with the other plugin types which, in general, are meant to capture and manipulate information, a subcommand is meant to change to overall behavior of Geth. It may do this in order to capture information but the primary fuctionality is a modulation of geth behaviour.
Tracers
-------