Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugins docs outline #1560

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/plugins/index.md
@@ -0,0 +1,9 @@
---
title: Extend Besu using plugins
sidebar_position: 1
sidebar_label: Introduction
id: index
description: Besu plugins overview
---

# Extend Hyperledger Besu using plugins
4 changes: 0 additions & 4 deletions docs/private-networks/_category_.json

This file was deleted.

6 changes: 0 additions & 6 deletions docs/public-networks/.meta.yml

This file was deleted.

32 changes: 32 additions & 0 deletions docusaurus.config.js
Expand Up @@ -132,6 +132,13 @@ const config = {
position: "left",
label: "Private networks",
},
{
type: "docSidebar",
sidebarId: "pluginsDocSidebar",
docId: "index",
position: "left",
label: "Plugins",
},
{
type: "docsVersionDropdown",
position: "right",
Expand Down Expand Up @@ -215,6 +222,31 @@ const config = {
},
],
},
{
title: "Plugins",
items: [
{
label: "Introduction",
to: "/plugins",
},
{
label: "How to guides",
to: "/plugins/how-to",
},
{
label: "Concepts",
to: "/plugins/concepts",
},
{
label: "Tutorials",
to: "/plugins/tutorials",
},
{
label: "Reference",
to: "/plugins/reference",
},
],
},
{
title: "Community",
items: [
Expand Down
2 changes: 2 additions & 0 deletions project-words.txt
Expand Up @@ -316,6 +316,7 @@ librocksdbjni
lifecycles
lightchaindata
lighthouserc
Linea
linenums
linkify
livenodes
Expand Down Expand Up @@ -563,6 +564,7 @@ serviceaccounts
setaf
setext
shiki
Shomei
showinfo
sida
sighup
Expand Down
1 change: 1 addition & 0 deletions sidebars.js
Expand Up @@ -2,6 +2,7 @@
const sidebars = {
publicDocSidebar: [{ type: "autogenerated", dirName: "public-networks" }],
privateDocSidebar: [{ type: "autogenerated", dirName: "private-networks" }],
pluginsDocSidebar: [{ type: "autogenerated", dirName: "plugins" }],
};

module.exports = sidebars;
16 changes: 14 additions & 2 deletions src/components/HomepageCards/index.tsx
Expand Up @@ -25,7 +25,7 @@ const CardList: CardItem[] = [
// prettier-ignore
description: (
<>
Run Besu as an execution client on Ethereum Mainnet and Ethereum public testnets, such as Goerli and Sepolia.
Run Besu as an execution client on Ethereum Mainnet and public testnets, such as Goerli and Sepolia.
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
</>
),
buttonName: "Get started",
Expand All @@ -43,6 +43,18 @@ const CardList: CardItem[] = [
buttonName: "Get started",
buttonType: "secondary",
},
{
title: "🔌 Plugins",
link: "/plugins",
// prettier-ignore
description: (
<>
Extend Besu&apos;s functionality on both public and private networks using the Plugin API.
</>
),
buttonName: "Get started",
buttonType: "secondary",
},
];

function Card({ title, link, description, buttonName, buttonType }: CardItem) {
Expand Down Expand Up @@ -81,7 +93,7 @@ export default function HomepageCards(): JSX.Element {
<p>
Hyperledger Besu is an open source Ethereum client developed under the
Apache 2.0 license and written in Java. It runs on public and private
networks:
networks. You can also extend Besu&apos;s functionality using plugins.
</p>
<div className="row">
{CardList.map((props, idx) => (
Expand Down
@@ -0,0 +1,8 @@
{
"label": "Concepts",
"position": 4,
"link": {
"type": "generated-index",
"slug": "/plugins/concepts"
}
}
@@ -0,0 +1,9 @@
---
sidebar_position: 2
description: Learn about best practices with creating a plugin.
---

# Best practices

TO DO: This page should contain an overview of best practices when creating plugins.
This can include performance considerations and security best practices.
14 changes: 14 additions & 0 deletions versioned_docs/version-24.3.0/plugins/concepts/lifecycle.md
@@ -0,0 +1,14 @@
---
sidebar_position: 1
description: Learn about the plugin lifecycle.
---

# Plugin lifecycle

TO DO: This page should contain an explanation of the plugin lifecycle.
It can include a diagram of the lifecycle.
It might take
[this plugin lifecycle overview](https://www.youtube.com/watch?feature=shared&t=919&v=78sa2WuA1rg)
as a starting point, with updates as needed.

This page should also explain "hooks," and how they can alter the lifecycle events within Besu.
@@ -0,0 +1,9 @@
{
"label": "Get started",
"position": 2,
"collapsed": false,
"link": {
"type": "generated-index",
"slug": "/plugins/get-started"
}
}
@@ -0,0 +1,16 @@
---
sidebar_position: 1
description: Get started by creating a simple plugin.
---

# Create a simple plugin

TO DO: This page should contain a step-by-step tutorial on creating a minimal
plugin for a basic use case.

The goal is to teach the user the essential workflow and components of any
plugin (e.g., lifecycle events, configuration, using the API, deployment, see
results) so they can get started quickly on their specific use case.

This tutorial can link to other pages that go into more detail about each step,
and also link to more advanced next steps / use cases.
@@ -0,0 +1,8 @@
{
"label": "How to",
"position": 3,
"link": {
"type": "generated-index",
"slug": "/plugins/how-to"
}
}
@@ -0,0 +1,9 @@
---
sidebar_position: 1
description: Configure a plugin.
---

# Configure a plugin

TO DO: This page should contain instructions on configuring a plugin, and
explain configuration parameter norms.
12 changes: 12 additions & 0 deletions versioned_docs/version-24.3.0/plugins/how-to/deploy-a-plugin.md
@@ -0,0 +1,12 @@
---
sidebar_position: 5
description: Deploy a plugin.
---

# Deploy a plugin

TO DO: This page should contain instructions on deploying a plugin in a
production environment.
It might take
[this example deployment demo](https://www.youtube.com/watch?v=78sa2WuA1rg&t=1923s)
as a starting point, adding further considerations for a production environment.
@@ -0,0 +1,8 @@
---
sidebar_position: 4
description: Test a plugin.
---

# Test a plugin

TO DO: This page should contain instructions on testing a plugin.
10 changes: 10 additions & 0 deletions versioned_docs/version-24.3.0/plugins/how-to/troubleshoot.md
@@ -0,0 +1,10 @@
---
sidebar_position: 6
description: Troubleshoot common issues.
---

# Troubleshoot

TO DO: This page should contain instructions for troubleshooting common issues developers might
encounter when creating or using plugins.
This can include a list of error messages and instructions for writing acceptance tests.
11 changes: 11 additions & 0 deletions versioned_docs/version-24.3.0/plugins/how-to/use-plugin-api.md
@@ -0,0 +1,11 @@
---
sidebar_position: 2
description: Use the Plugin API interfaces and methods.
---

# Use the Plugin API

TO DO: This page should contain instructions on accessing Besu resources using
the Plugin API interfaces, services, methods, etc.
It can contain generic instructions and link to the Plugin API reference for
specific method parameters and examples.
@@ -0,0 +1,11 @@
---
sidebar_position: 3
description: Extend Besu metrics.
---

# Use plugin metrics

TO DO: This page should contain instructions on using plugin metrics, and
extending [Besu metrics](../../public-networks/how-to/monitor/metrics.md) – for
example, using a
[validator monitoring plugin](https://github.com/Consensys/doc.quorumplugins/blob/master/docs/HowTo/Configure/Besu-Plugins/Monitor-Validators.md).
37 changes: 37 additions & 0 deletions versioned_docs/version-24.3.0/plugins/index.md
@@ -0,0 +1,37 @@
---
title: Extend Besu using plugins
sidebar_position: 1
sidebar_label: Introduction
id: index
description: Besu plugins overview
---

# Extend Hyperledger Besu using plugins

You can extend Hyperledger Besu's functionality by creating Java plugins or using existing
[open source Besu plugins](reference/resources.md#open-source-plugins).
Use the [Plugin API](reference/plugin-api/index.md) to get data from any public or private Besu
network and feed it into an application or system.

For example, you can create a plugin to add more monitoring functionality or to stream event data
to a third-party application.
The API exposes data about the following components:
alexandratran marked this conversation as resolved.
Show resolved Hide resolved

- Blocks
- Balances
- Transactions
- Smart contracts
- Execution results
- Logs
- Syncing state

Get started by [creating a simple plugin](get-started/create-a-plugin.md).

## Architecture

The following diagram outlines the high-level architecture of the Plugin API.

![Besu plugin API](../assets/images/Hyperledger-Besu-Plugin-API.png)

If you have questions about creating or using Besu plugins, ask on the **besu** channel on
[Hyperledger Discord](https://discord.gg/hyperledger).
@@ -0,0 +1,8 @@
{
"label": "Reference",
"position": 6,
"link": {
"type": "generated-index",
"slug": "/plugins/reference"
}
}
@@ -0,0 +1,15 @@
---
sidebar_position: 1
sidebar_label: Plugin API
description: See the Plugin API reference.
---

# Plugin API reference

TO DO: This section should contain a manually formatted reference of the Plugin API.
The [existing Javadoc spec](https://javadoc.io/doc/org.hyperledger.besu/plugin-api/latest/index.html)
might be used as a starting point, but should be updated to reflect the current API.

This section should document each API interface, method, etc., with a description, parameters,
return values, and an example usage.
It might be broken up into separate pages in this category, e.g., one page for each interface.
21 changes: 21 additions & 0 deletions versioned_docs/version-24.3.0/plugins/reference/resources.md
@@ -0,0 +1,21 @@
---
sidebar_position: 2
description: See additional resources for Besu plugins.
---

# Resources

See the following additional resources for Besu plugins.

## Open source plugins

You can use the following open source Besu plugins:

- [Besu plugins](https://github.com/Consensys/besu-plugins)
- [Besu-Shomei Plugin](https://github.com/Consensys/besu-shomei-plugin)
- [Linea Besu plugins](https://github.com/Consensys/linea-arithmetization)
alexandratran marked this conversation as resolved.
Show resolved Hide resolved

## Get support

If you have questions about creating or using Besu plugins, ask on the **besu** channel on
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
[Hyperledger Discord](https://discord.gg/hyperledger).
@@ -0,0 +1,8 @@
{
"label": "Tutorials",
"position": 5,
"link": {
"type": "generated-index",
"slug": "plugins/tutorials"
}
}
@@ -0,0 +1,12 @@
---
sidebar_position: 1
description: Create a Linea plugin.
---

# Create a Linea plugin
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to walk the user through creating the sequencer? This seems difficult. Or do we envision this as more of a walkthrough on how it was accomplished, and not asking much of the user? One thing we could do is also use an example from each of Linea's modified areas in the plug-in. I.e. walk through tx pool changes, block validation changes, creation limits, more, and only discuss one area. E.g. Modify x in the tx pool (step 1), modify y in block validation (Step 2). Only going through one example per area.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it's necessary to discuss the Linea plugin in the docs, then yes maybe the latter would be helpful. If the goal is to help users learn how to create a plugin from scratch, we could first focus on a simpler use case that would be easier to create an end-to-end tutorial for? I.e., the tutorial that would go in Get started > Create a simple plugin.


TO DO: This page should contain a step-by-step tutorial on creating a
[Linea plugin](https://github.com/Consensys/linea-arithmetization).

It should walk the user through the plugin development process from start (code
template, configuration) to finish (deployment, see results).
6 changes: 6 additions & 0 deletions versioned_sidebars/version-24.3.0-sidebars.json
Expand Up @@ -10,5 +10,11 @@
"type": "autogenerated",
"dirName": "private-networks"
}
],
"pluginsDocSidebar": [
{
"type": "autogenerated",
"dirName": "plugins"
}
]
}