Skip to content

Add plugins docs outline #1560

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions docs/plugins/concepts/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Concepts",
"position": 4,
"link": {
"type": "generated-index",
"slug": "/plugins/concepts"
}
}
9 changes: 9 additions & 0 deletions docs/plugins/concepts/best-practices.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/concepts/lifecycle.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions docs/plugins/get-started/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Get started",
"position": 2,
"collapsed": false,
"link": {
"type": "generated-index",
"slug": "/plugins/get-started"
}
}
16 changes: 16 additions & 0 deletions docs/plugins/get-started/create-a-plugin.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions docs/plugins/how-to/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "How to",
"position": 3,
"link": {
"type": "generated-index",
"slug": "/plugins/how-to"
}
}
9 changes: 9 additions & 0 deletions docs/plugins/how-to/configure-a-plugin.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/how-to/deploy-a-plugin.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions docs/plugins/how-to/test-a-plugin.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/how-to/troubleshoot.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/how-to/use-plugin-api.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions docs/plugins/how-to/use-plugin-metrics.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/index.md
Original file line number Diff line number Diff line change
@@ -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:

- 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).
8 changes: 8 additions & 0 deletions docs/plugins/reference/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Reference",
"position": 6,
"link": {
"type": "generated-index",
"slug": "/plugins/reference"
}
}
15 changes: 15 additions & 0 deletions docs/plugins/reference/plugin-api/index.md
Original file line number Diff line number Diff line change
@@ -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 docs/plugins/reference/resources.md
Original file line number Diff line number Diff line change
@@ -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-sequencer)

## Get support

If you have questions about creating or using Besu plugins, ask on the **#besu** channel on
[Hyperledger Discord](https://discord.gg/hyperledger).
8 changes: 8 additions & 0 deletions docs/plugins/tutorials/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Tutorials",
"position": 5,
"link": {
"type": "generated-index",
"slug": "plugins/tutorials"
}
}
12 changes: 12 additions & 0 deletions docs/plugins/tutorials/create-a-linea-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
sidebar_position: 1
description: Create a Linea plugin.
---

# Create a Linea 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).
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ const config = {
position: "left",
label: "Private networks",
},
{
type: "docSidebar",
sidebarId: "pluginsDocSidebar",
docId: "index",
position: "left",
label: "Plugins",
},
{
href: "/public-networks/chatbot",
className: "header-chatbot-link",
Expand Down Expand Up @@ -190,6 +197,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
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
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;
14 changes: 13 additions & 1 deletion src/components/HomepageCards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,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 @@ -82,7 +94,7 @@ export default function HomepageCards(): JSX.Element {
<p>
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
Loading