From 0aa866f534b65fab3a1629d4c77a02abfaae4e6f Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 2 Jun 2023 22:20:24 +0800 Subject: [PATCH] copyedit docs --- docs/RPC_method.rst | 4 ++-- docs/hooks.rst | 30 +++++++++++++++--------------- docs/plugin_loader.rst | 2 +- docs/subscription.rst | 4 ++-- docs/tracer.rst | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/RPC_method.rst b/docs/RPC_method.rst index d50d208..0da0d9b 100644 --- a/docs/RPC_method.rst +++ b/docs/RPC_method.rst @@ -49,6 +49,6 @@ A simple implimentation would look like so: 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``. \ No newline at end of file +The plugin can now be accessed with an rpc call to ``mynamespace_helloWorld``. diff --git a/docs/hooks.rst b/docs/hooks.rst index 50f8eb7..96567c6 100644 --- a/docs/hooks.rst +++ b/docs/hooks.rst @@ -7,7 +7,7 @@ Selected Plugin Hooks Plugin Hooks ************ -Plugeth provides several hooks from which the plugin can capture data from Geth. Additionally in the case of **subcommands** the provided hooks are designed to change the behavior of Geth. +Plugeth provides several hooks from which the plugin can capture data from Geth. Additionally in the case of **subcommands** the provided hooks are designed to change the behavior of Geth. Hooks are called from functions within the plugin. For example, if we wanted to bring in data from the StateUpdate hook. We would impliment it like so: (from `blockupdates`_) @@ -26,24 +26,24 @@ Hooks are called from functions within the plugin. For example, if we wanted to 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: -StateUpdate +StateUpdate *********** **Function Signature**:``func(root common.Hash, parentRoot common.Hash, destructs map[common.Hash]struct{}, accounts map[common.Hash][]byte, storage map[common.Hash]map[common.Hash][]byte)`` -The state update plugin provides a snapshot of the state subsystem in the form of a a stateUpdate object. The stateUpdate object contains all information transformed by a transaction but not the transaction itself. +The state update plugin provides a snapshot of the state subsystem in the form of a a stateUpdate object. The stateUpdate object contains all information transformed by a transaction but not the transaction itself. Invoked for each new block, StateUpdate provides the changes to the blockchain state. root corresponds to the state root of the new block. parentRoot corresponds to the state root of the parent block. destructs serves as a set of accounts that self-destructed in this block. accounts maps the hash of each account address to the SlimRLP encoding of the account data. storage maps the hash of each account to a map of that account's stored data. -.. warning:: StateUpdate is only called if Geth is running with - ``-snapshots=true``. This is the default behavior for Geth, but if you are explicitly running with ``--snapshot=false`` this function will not be invoked. - +.. warning:: StateUpdate is only called if Geth is running with + ``-snapshots=true``. This is the default behavior for Geth, but if you are explicitly running with ``--snapshot=false`` this function will not be invoked. + AppendAncient ************* @@ -57,7 +57,7 @@ GetRPCCalls **Function Signature**:``func(string, string, string)`` -Invoked when the RPC handler registers a method call. Returns the call ``id``, method ``name``, and any ``params`` that may have been passed in. +Invoked when the RPC handler registers a method call. Returns the call ``id``, method ``name``, and any ``params`` that may have been passed in. .. todo:: missing a couple of hooks @@ -80,24 +80,24 @@ BlockProcessingError **Function Signature**:``func(*types.Transaction, *types.Block, error)`` -Invoked if an error occurs while processing a transaction. This only applies to errors that would unvalidate the block were this transaction is included not errors such as reverts or opcode errors. Returns a transaction, block, and error. +Invoked if an error occurs while processing a transaction. This only applies to errors that would unvalidate the block were this transaction is included not errors such as reverts or opcode errors. Returns a transaction, block, and error. NewHead ******* **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 - 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. +.. 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. NewSideBlock ************ **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. @@ -107,8 +107,8 @@ Reorg **Function Signature**:``func(common *types.Block, oldChain, newChain types.Blocks)`` -Invoked when a chain reorg occurs, that is; at least one block is removed and one block is added. (``oldChain`` is a list of removed blocks, ``newChain`` is a list of newliy added blocks, and ``common`` is the latest block that is an ancestor to both oldChain and newChain.) Returns a block, a list of old blocks, and a list of new blocks. - +Invoked when a chain reorg occurs, that is; at least one block is removed and one block is added. (``oldChain`` is a list of removed blocks, ``newChain`` is a list of newliy added blocks, and ``common`` is the latest block that is an ancestor to both oldChain and newChain.) Returns a block, a list of old blocks, and a list of new blocks. + diff --git a/docs/plugin_loader.rst b/docs/plugin_loader.rst index 1b6914f..f69d5d4 100644 --- a/docs/plugin_loader.rst +++ b/docs/plugin_loader.rst @@ -31,7 +31,7 @@ GetFeed ======= ``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: diff --git a/docs/subscription.rst b/docs/subscription.rst index 522395f..d5ee857 100644 --- a/docs/subscription.rst +++ b/docs/subscription.rst @@ -32,7 +32,7 @@ A GetAPIs method is required in the body of the plugin in order to make the plug 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 @@ -64,7 +64,7 @@ Access .. 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. -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: diff --git a/docs/tracer.rst b/docs/tracer.rst index da34338..16a5882 100644 --- a/docs/tracer.rst +++ b/docs/tracer.rst @@ -22,7 +22,7 @@ First an empty MyService Struct. 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