Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/api/trinity/api.cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Command Line Interface (CLI)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: shell

usage: trinity [-h] [--version] [--trinity-root-dir TRINITY_ROOT_DIR]
[-l {debug,info}] [--network-id NETWORK_ID | --ropsten]
[--sync-mode {full,light} | --light] [--data-dir DATA_DIR]
[--nodekey NODEKEY] [--nodekey-path NODEKEY_PATH]
{console,attach} ...

positional arguments:
{console,attach}
console run the chain and start the trinity REPL
attach open an REPL attached to a currently running chain

optional arguments:
-h, --help show this help message and exit

sync mode:
--version show program's version number and exit
--trinity-root-dir TRINITY_ROOT_DIR
The filesystem path to the base directory that trinity
will store it's information. Default:
$XDG_DATA_HOME/.local/share/trinity

logging:
-l {debug,info}, --log-level {debug,info}
Sets the logging level

network:
--network-id NETWORK_ID
Network identifier (1=Mainnet, 3=Ropsten)
--ropsten Ropsten network: pre configured proof-of-work test
network. Shortcut for `--networkid=3`

sync mode:
--sync-mode {full,light}
--light Shortcut for `--sync-mode=light`

chain:
--data-dir DATA_DIR The directory where chain data is stored
--nodekey NODEKEY Hexadecimal encoded private key to use for the nodekey
--nodekey-path NODEKEY_PATH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note: we should be able to merge the functionality of this argument in with the --nodekey argument and just do detection on whether the arg is referencing a file or that it's just a string nodekey.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue #1428

The filesystem path to the file which contains the
nodekey
8 changes: 8 additions & 0 deletions docs/api/trinity/extensibility/api.extensibility.events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Events
======

.. autoclass:: trinity.extensibility.events.PluginStartedEvent
:members:

.. autoclass:: trinity.extensibility.events.ResourceAvailableEvent
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Exceptions
==========

.. autoclass:: trinity.extensibility.exceptions.EventBusNotReady
:members:

.. autoclass:: trinity.extensibility.exceptions.UnsuitableShutdownError
:members:

39 changes: 39 additions & 0 deletions docs/api/trinity/extensibility/api.extensibility.plugin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Plugin
======


PluginContext
-------------

.. autoclass:: trinity.extensibility.plugin.PluginContext
:members:

BasePlugin
----------

.. autoclass:: trinity.extensibility.plugin.BasePlugin
:members:

BaseSyncStopPlugin
------------------

.. autoclass:: trinity.extensibility.plugin.BaseSyncStopPlugin
:members:

BaseAsyncStopPlugin
-------------------

.. autoclass:: trinity.extensibility.plugin.BaseAsyncStopPlugin
:members:

BaseMainProcessPlugin
---------------------

.. autoclass:: trinity.extensibility.plugin.BaseMainProcessPlugin
:members:

BaseIsolatedPlugin
------------------

.. autoclass:: trinity.extensibility.plugin.BaseIsolatedPlugin
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
PluginManager
=============

BaseManagerProcessScope
-----------------------

.. autoclass:: trinity.extensibility.plugin_manager.BaseManagerProcessScope
:members:

MainAndIsolatedProcessScope
---------------------------

.. autoclass:: trinity.extensibility.plugin_manager.MainAndIsolatedProcessScope
:members:

SharedProcessScope
------------------

.. autoclass:: trinity.extensibility.plugin_manager.SharedProcessScope
:members:

PluginManager
-------------

.. autoclass:: trinity.extensibility.plugin_manager.PluginManager
:members:

16 changes: 16 additions & 0 deletions docs/api/trinity/extensibility/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Extensibility
=============

.. warning::

The extensibility API isn't stable yet. Expect breaking changes.

.. toctree::
:maxdepth: 4
:name: toc-eth-api-extensibility

api.extensibility.events.rst
api.extensibility.exceptions.rst
api.extensibility.plugin.rst
api.extensibility.plugin_manager.rst

49 changes: 6 additions & 43 deletions docs/api/trinity/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,12 @@ Trinity

This section aims to provide a detailed description of all APIs. If you are looking for something more hands-on or higher-level check out the existing :doc:`Trinity guides </guides/trinity/index>`.

Command Line Interface (CLI)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 4
:name: toc-api-trinity
:caption: API

.. code-block:: shell
api.cli
extensibility/index

usage: trinity [-h] [--version] [--trinity-root-dir TRINITY_ROOT_DIR]
[-l {debug,info}] [--network-id NETWORK_ID | --ropsten]
[--sync-mode {full,light} | --light] [--data-dir DATA_DIR]
[--nodekey NODEKEY] [--nodekey-path NODEKEY_PATH]
{console,attach} ...

positional arguments:
{console,attach}
console run the chain and start the trinity REPL
attach open an REPL attached to a currently running chain

optional arguments:
-h, --help show this help message and exit

sync mode:
--version show program's version number and exit
--trinity-root-dir TRINITY_ROOT_DIR
The filesystem path to the base directory that trinity
will store it's information. Default:
$XDG_DATA_HOME/.local/share/trinity

logging:
-l {debug,info}, --log-level {debug,info}
Sets the logging level

network:
--network-id NETWORK_ID
Network identifier (1=Mainnet, 3=Ropsten)
--ropsten Ropsten network: pre configured proof-of-work test
network. Shortcut for `--networkid=3`

sync mode:
--sync-mode {full,light}
--light Shortcut for `--sync-mode=light`

chain:
--data-dir DATA_DIR The directory where chain data is stored
--nodekey NODEKEY Hexadecimal encoded private key to use for the nodekey
--nodekey-path NODEKEY_PATH
The filesystem path to the file which contains the
nodekey
1 change: 1 addition & 0 deletions trinity/extensibility/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
BaseSyncStopPlugin,
DebugPlugin,
PluginContext,
TrinityBootInfo,
)
from trinity.extensibility.plugin_manager import ( # noqa: F401
BaseManagerProcessScope,
Expand Down
17 changes: 10 additions & 7 deletions trinity/extensibility/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
)


class UnsuitableShutdownError(BaseTrinityError):
class EventBusNotReady(BaseTrinityError):
"""
Raised when `shutdown` was called on a ``PluginManager`` instance that operates
in the ``MainAndIsolatedProcessScope`` or when ``shutdown_blocking`` was called on a
``PluginManager`` instance that operates in the ``SharedProcessScope``.
Raised when a plugin tried to access an :class:`~lahja.eventbus.EventBus` before the plugin
had received its :meth:`~trinity.extensibility.plugin.BasePlugin.ready` call.
"""
pass


class EventBusNotReady(BaseTrinityError):
class UnsuitableShutdownError(BaseTrinityError):
"""
Raised when a plugin tried to access an EventBus before the plugin
had received its ``ready`` call.
Raised when :meth:`~trinity.extensibility.plugin_manager.PluginManager.shutdown` was called on
a :class:`~trinity.extensibility.plugin_manager.PluginManager` instance that operates in the
:class:`~trinity.extensibility.plugin_manager.MainAndIsolatedProcessScope` or when
:meth:`~trinity.extensibility.plugin.PluginManager.shutdown_blocking` was called on a
:class:`~trinity.extensibility.plugin_manager.PluginManager` instance that operates in the
:class:`~trinity.extensibility.plugin_manager.SharedProcessScope`.
"""
pass
Loading