Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,21 @@ sidebars and page frontmatter, so they stay correct as content evolves.

## History: the GitBook import

The content in this repo was imported once from the obol-gitbook repo by a
migration script (`scripts/migrate-gitbook.mjs`) that converted
GitBook-flavoured markdown (hints, tabs, OpenAPI blocks, card tables,
figures, explicit heading anchors) to Docusaurus markdown/MDX, derived slugs
from the live site's `llms.txt`, generated sidebars from `SUMMARY.md`, and
normalized assets. The script has since been deleted — content is authored
here now, and re-running it would have overwritten local edits. If it is
ever needed again, recover it from git history:
All content in this repo (`next` + v1.10, and later v1.3–v1.9 from the
obol-gitbook `version-*` branches) was imported by a migration script that
converted GitBook-flavoured markdown (hints, tabs, OpenAPI blocks, card
tables, figures, explicit heading anchors) to Docusaurus markdown/MDX,
derived slugs from the live site's `llms.txt`, generated sidebars from
`SUMMARY.md`, and normalized assets. With every version migrated, the script
has been deleted; content is authored in this repo now, and each ported
version received manual link/anchor fixes after import that a re-run would
have clobbered. If it is ever needed again, recover it from git history:

```shell
git log --diff-filter=D -- scripts/migrate-gitbook.mjs
```

Its lasting output is the content itself plus `scripts/generated/redirects.json`.
Versions before v1.3 were removed in the 2026 rebuild. They remain available
in this repo's history — the last commit carrying them is
[`000db7c5b0`](https://github.com/ObolNetwork/obol-docs/tree/000db7c5b0/versioned_docs)
— and the version dropdown's "Legacy (pre-v1.3)" item points there.
14 changes: 14 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ const config = {
{
fromExtensions: ['html', 'htm'],
redirects: legacyRedirects,
// GitBook served old versions at /version-vX.Y/... — keep those URLs
// alive now that the same pages live at /vX.Y/...
createRedirects(existingPath) {
const m = existingPath.match(/^\/(v\d+\.\d+)\//);
return m ? [existingPath.replace(m[0], `/version-${m[1]}/`)] : [];
},
},
],
'./plugins/llms-txt',
Expand Down Expand Up @@ -261,6 +267,14 @@ const config = {
{
type: 'docsVersionDropdown',
position: 'right',
dropdownItemsAfter: [
{
// Pre-v1.3 docs were removed in the 2026 rebuild; they live in
// this repo's history at the last commit before the rebuild.
href: 'https://github.com/ObolNetwork/obol-docs/tree/000db7c5b0/versioned_docs',
label: 'Legacy (pre-v1.3)',
},
],
},
{
href: 'https://launchpad.obol.org',
Expand Down
10 changes: 8 additions & 2 deletions plugins/llms-txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ module.exports = function llmsTxtPlugin(context) {
const {siteDir} = context;
// e.g. https://docs.obol.org or https://obolnetwork.github.io/obol-docs
const siteUrl = `${siteConfig.url}${siteConfig.baseUrl.replace(/\/$/, '')}`;
const lastVersion = JSON.parse(
const allVersions = JSON.parse(
fs.readFileSync(path.join(siteDir, 'versions.json'), 'utf8'),
)[0];
);
const lastVersion = allVersions[0];
const versions = [
{name: 'next', heading: 'Next', base: '/next'},
{
Expand All @@ -102,6 +103,11 @@ module.exports = function llmsTxtPlugin(context) {
base: '',
isCurrent: true,
},
...allVersions.slice(1).map((name) => ({
name,
heading: name,
base: `/${name}`,
})),
];

const sections = [];
Expand Down
Binary file added static/img/gitbook/Token_house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-1-1-1-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-51.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-53.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/image-88.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/stOBOL_03-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/stOBOL_03-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gitbook/stOBOL_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions versioned_docs/version-v1.3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_label: "Introduction"
slug: /learn/introduction
---

# Introduction

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_label: "Advanced Guides"
slug: /advanced-and-troubleshooting/advanced
---

# advanced

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
description: "Use advanced docker-compose features to have more flexibility and power to change the default configuration."
sidebar_label: "Advanced Docker Configs"
slug: /advanced-and-troubleshooting/advanced/adv-docker-configs
---

# Advanced Docker Configs

:::info
This section is intended for _docker power users_, i.e.: for those who are familiar with working with `docker compose` and want to have more flexibility and power to change the default configuration.
:::

We use the "Multiple Compose File" feature which provides a very powerful way to override any configuration in `docker-compose.yml` without needing to modify git-checked-in files since that results in conflicts when upgrading this repo. See [this](https://docs.docker.com/compose/extends/#multiple-compose-files) for more details.

There are some additional compose files in [this repository](https://github.com/ObolNetwork/charon-distributed-validator-node/), `compose-debug.yml` and `docker-compose.override.yml.sample`, along-with the default `docker-compose.yml` file that you can use for this purpose.

* `compose-debug.yml` contains some additional containers that developers can use for debugging, like `jaeger`. To achieve this, you can run:

```shell
docker compose -f docker-compose.yml -f compose-debug.yml up
```

* `docker-compose.override.yml.sample` is intended to override the default configuration provided in `docker-compose.yml`. This is useful when, for example, you wish to add port mappings or want to disable a container.
* To use it, just copy the sample file to `docker-compose.override.yml` and customise it to your liking. Please create this file ONLY when you want to tweak something. This is because the default override file is empty and docker errors if you provide an empty compose file.

```shell
cp docker-compose.override.yml.sample docker-compose.override.yml

# Tweak docker-compose.override.yml and then run docker compose up
docker compose up
```

* You can also run all these compose files together. This is desirable when you want to use both the features. For example, you may want to have some debugging containers AND also want to override some defaults. To achieve this, you can run:

```shell
docker compose -f docker-compose.yml -f docker-compose.override.yml -f compose-debug.yml up
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
sidebar_label: "Create a DV Using the SDK"
slug: /advanced-and-troubleshooting/advanced/create-a-dv-using-the-sdk
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create a DV Using the SDK

This is a walkthrough of using the [Obol-SDK](https://www.npmjs.com/package/@obolnetwork/obol-sdk) to propose a four-node distributed validator cluster for creation using the [DV Launchpad](https://docs.obol.org/next/learn/intro/launchpad).

### Pre-requisites[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#pre-requisites) {#pre-requisites}
* You have [node.js](https://nodejs.org/en) installed.

### Install the package[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#install-the-package) {#install-the-package}
Install the Obol-SDK package into your development environment

<Tabs>
<TabItem value="npm" label="NPM">
```sh
npm install --save @obolnetwork/obol-sdk
```
</TabItem>

<TabItem value="yarn" label="Yarn">
```sh
yarn add @obolnetwork/obol-sdk
```
</TabItem>
</Tabs>

### Instantiate the client[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#instantiate-the-client) {#instantiate-the-client}
The first thing you need to do is create an instance of the Obol SDK client. The client takes two constructor parameters:

* The `chainID` for the chain you intend to use.
* An ethers.js [signer](https://docs.ethers.org/v6/api/providers/#Signer-signTypedData) object.

```sh
import { Client } from "@obolnetwork/obol-sdk";
import { ethers } from "ethers";

// Create a dummy ethers signer object with a throwaway private key
const mnemonic = ethers.Wallet.createRandom().mnemonic?.phrase || "";
const privateKey = ethers.Wallet.fromPhrase(mnemonic).privateKey;
const wallet = new ethers.Wallet(privateKey);
const signer = wallet.connect(null);

// Instantiate the Obol Client for holesky
const obol = new Client({ chainId: 17000 }, signer);
```

### Propose the cluster[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#propose-the-cluster) {#propose-the-cluster}
List the Ethereum addresses of participating operators, along with withdrawal and fee recipient address data for each validator you intend for the operators to create.

```sh
// A config hash is a deterministic hash of the proposed DV cluster configuration
const configHash = await obol.createClusterDefinition({
name: "SDK Demo Cluster",
operators: [
{ address: "0xC35CfCd67b9C27345a54EDEcC1033F2284148c81" },
{ address: "0x33807D6F1DCe44b9C599fFE03640762A6F08C496" },
{ address: "0xc6e76F72Ea672FAe05C357157CfC37720F0aF26f" },
{ address: "0x86B8145c98e5BD25BA722645b15eD65f024a87EC" },
],
validators: [
{
fee_recipient_address: "0x3CD4958e76C317abcEA19faDd076348808424F99",
withdrawal_address: "0xE0C5ceA4D3869F156717C66E188Ae81C80914a6e",
},
],
});

console.log(
`Direct the operators to https://holesky.launchpad.obol.org/dv?configHash=${configHash} to complete the key generation process`
);
```

### Invite the Operators to complete the DKG[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#invite-the-operators-to-complete-the-dkg) {#invite-the-operators-to-complete-the-dkg}
Once the Obol-API returns a `configHash` string from the `createClusterDefinition` method, you can use this identifier to invite the operators to the [Launchpad](https://docs.obol.org/next/learn/intro/launchpad) to complete the process

1. Operators navigate to `https://<NETWORK_NAME_HERE>.launchpad.obol.org/dv?configHash=<CONFIG_HASH_HERE>` and complete the [run a DV with others](https://docs.obol.org/next/run/start/quickstart_group) flow.
2. Once the DKG is complete, and operators are using the `--publish` flag, the created cluster details will be posted to the Obol API.
3. The creator will be able to retrieve this data with `obol.getClusterLock(configHash)`, to use for activating the newly created validator.

### Retrieve the created Distributed Validators using the SDK[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#retrieve-the-created-distributed-validators-using-the-sdk) {#retrieve-the-created-distributed-validators-using-the-sdk}
Once the DKG is complete, the proposer of the cluster can retrieve key data such as the validator public keys and their associated deposit data messages.

```sh
const clusterLock = await obol.getClusterLock(configHash);
```

Reference lock files can be found [here](https://github.com/ObolNetwork/charon/tree/main/cluster/testdata).

### Activate the DVs using the deposit contract[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#activate-the-dvs-using-the-deposit-contract) {#activate-the-dvs-using-the-deposit-contract}
In order to activate the distributed validators, the cluster operator can retrieve the validators' associated deposit data from the lock file and use it to craft transactions to the `deposit()` method on the deposit contract.

```sh
const validatorDepositData =
clusterLock.distributed_validators[validatorIndex].deposit_data;

const depositContract = new ethers.Contract(
DEPOSIT_CONTRACT_ADDRESS, // 0x00000000219ab540356cBB839Cbe05303d7705Fa for Mainnet, 0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b for Goerli
depositContractABI, // https://etherscan.io/address/0x00000000219ab540356cBB839Cbe05303d7705Fa#code for Mainnet, and replace the address for Goerli
signer
);

const TX_VALUE = ethers.parseEther("32");

const tx = await depositContract.deposit(
validatorDepositData.pubkey,
validatorDepositData.withdrawal_credentials,
validatorDepositData.signature,
validatorDepositData.deposit_data_root,
{ value: TX_VALUE }
);

const txResult = await tx.wait();
```

### Usage Examples[​](https://docs.obol.org/next/adv/advanced/quickstart-sdk#usage-examples) {#usage-examples}
Examples of how our SDK can be used are found [here](https://github.com/ObolNetwork/obol-sdk-examples).
Loading
Loading