copyedit docs
This commit is contained in:
parent
0deaa33408
commit
0aa866f534
@ -49,6 +49,6 @@ A simple implimentation would look like so:
|
|||||||
Access
|
Access
|
||||||
******
|
******
|
||||||
|
|
||||||
As with pre-built plugins, a``.so`` will need to be built from``main.go`` and moved into ``~/.ethereum/plugins``. Geth will need to be started with with a ``http.api=mymamespace`` flag. Additionally you will need to include a ``--http`` flag in order to access the standard json rpc methods.
|
As with pre-built plugins, a``.so`` will need to be built from``main.go`` and moved into ``~/.ethereum/plugins``. Geth will need to be started with with a ``http.api=mynamespace`` flag. Additionally you will need to include a ``--http`` flag in order to access the standard json rpc methods.
|
||||||
|
|
||||||
The plugin can now be accessed with an rpc call to ``mynamespace_helloWorld``.
|
The plugin can now be accessed with an rpc call to ``mynamespace_helloWorld``.
|
@ -26,7 +26,7 @@ Hooks are called from functions within the plugin. For example, if we wanted to
|
|||||||
backend.ChainDb().Put(append([]byte("su"), blockRoot.Bytes()...), data)
|
backend.ChainDb().Put(append([]byte("su"), blockRoot.Bytes()...), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
Many hooks can be deployed in an one plugin as is the case with the **BlockUpdater** plugin.
|
Many hooks can be deployed in one plugin as is the case with the **BlockUpdater** plugin.
|
||||||
|
|
||||||
.. contents:: :local:
|
.. contents:: :local:
|
||||||
|
|
||||||
@ -87,9 +87,9 @@ NewHead
|
|||||||
|
|
||||||
**Function Signature**:``func(*types.Block, common.Hash, []*types.Log)``
|
**Function Signature**:``func(*types.Block, common.Hash, []*types.Log)``
|
||||||
|
|
||||||
Invoked when a new block becomes the canonical latest block. Returns a block, hash, and log.
|
Invoked when a new block becomes the canonical latest block. Returns a block, hash, and logs.
|
||||||
|
|
||||||
.. note:: If severtal blocks are processed in a group (such as
|
.. note:: If several blocks are processed in a group (such as
|
||||||
during a reorg) this may not be called for each block. You should track the prior latest head if you need to process intermediate blocks.
|
during a reorg) this may not be called for each block. You should track the prior latest head if you need to process intermediate blocks.
|
||||||
|
|
||||||
NewSideBlock
|
NewSideBlock
|
||||||
@ -97,7 +97,7 @@ NewSideBlock
|
|||||||
|
|
||||||
**Function Signature**:``func(*types.Block, common.Hash, []*types.Log)``
|
**Function Signature**:``func(*types.Block, common.Hash, []*types.Log)``
|
||||||
|
|
||||||
Invoked when a block is side-chained. Returns a block, has, and logs.
|
Invoked when a block is side-chained. Returns a block, hash, and logs.
|
||||||
|
|
||||||
.. note:: Blocks passed to this method are non-canonical blocks.
|
.. note:: Blocks passed to this method are non-canonical blocks.
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ GetFeed
|
|||||||
=======
|
=======
|
||||||
``GetFeed() Feed``
|
``GetFeed() Feed``
|
||||||
|
|
||||||
Returns a new feed that the plugin can used for publish/subscribe models.
|
Returns a new feed that the plugin can use for publish/subscribe models.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ A GetAPIs method is required in the body of the plugin in order to make the plug
|
|||||||
Subscription Function
|
Subscription Function
|
||||||
*********************
|
*********************
|
||||||
|
|
||||||
For subscriptions (supported on IPC and websockets), a function should take MyService as a reciever and a context.Context object as an argument and return a channel and an error. The following is a subscription function that impliments a timer.
|
For subscriptions (supported on IPC and websockets), a function should take MyService as a reciever and a context.Context object as an argument and return a channel and an error. The following is a subscription function that implements a timer.
|
||||||
|
|
||||||
.. code-block:: Go
|
.. code-block:: Go
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Access
|
|||||||
.. Note:: Plugins providing subscriptions can be accessed via IPC
|
.. Note:: Plugins providing subscriptions can be accessed via IPC
|
||||||
and websockets. In the below example we will be using `wscat`_ to connect a websocket to a local Geth node.
|
and websockets. In the below example we will be using `wscat`_ to connect a websocket to a local Geth node.
|
||||||
|
|
||||||
As with pre-built plugins, a ``.so`` will need to be built from ``main.go`` and moved into ``~/.ethereum/plugins``. Geth will need to be started with with ``--ws --ws.api=mynamespace``flags. Additionally you will need to include a ``--http`` flag in order to access the standard json rpc methods.
|
As with pre-built plugins, a ``.so`` will need to be built from ``main.go`` and moved into ``~/.ethereum/plugins``. Geth will need to be started with ``--ws --ws.api=mynamespace`` flags. Additionally you will need to include a ``--http`` flag in order to access the standard json rpc methods.
|
||||||
|
|
||||||
After starting Geth, from a seperate terminal run:
|
After starting Geth, from a seperate terminal run:
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ First an empty MyService Struct.
|
|||||||
Map
|
Map
|
||||||
***
|
***
|
||||||
|
|
||||||
Next, a map of tracers to functions returning a ``core.TracerResult`` which will be implimented like so:
|
Next, a map of tracers to functions returning a ``core.TracerResult`` which will be implemented like so:
|
||||||
|
|
||||||
.. code-block:: Go
|
.. code-block:: Go
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user