Skip to content
This repository has been archived by the owner on Feb 28, 2025. It is now read-only.

Hanan integrate typedoc #310

Closed
wants to merge 18 commits into from
Closed
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ It is possible to edit versioned docs in their respective folder:

### Translate your site

Let's translate `docs/intro.md` to French.
Let's translate `docs/int/obol_overview.md` to French.

#### Configure i18n

Expand All @@ -111,12 +111,12 @@ module.exports = {

#### Translate a doc

Copy the `docs/intro.md` file to the `i18n/fr` folder:
Copy the `docs/int/obol_overview.md` file to the `i18n/fr` folder:

```bash
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/

cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
cp docs/int/obol_overview.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
```

Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/quickstart-combine.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Run the following command:

```sh
# Combine a clusters private keys
docker run --rm -v "$(pwd):/opt/charon" obolnetwork/charon:v0.19.0 combine --cluster-dir /opt/charon/cluster --output-dir /opt/charon/combined
docker run --rm -v "$(pwd):/opt/charon" obolnetwork/charon:v0.19.1 combine --cluster-dir /opt/charon/cluster --output-dir /opt/charon/combined
```

This command will store the combined keys in the `output-dir`, in this case a folder named `combined`.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/quickstart-split.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ At the end of this process, you should have a tree like this:
Run the following docker command to split the keys:

```shell
CHARON_VERSION= # E.g. v0.19.0
CHARON_VERSION= # E.g. v0.19.1
CLUSTER_NAME= # The name of the cluster you want to create.
WITHDRAWAL_ADDRESS= # The address you want to use for withdrawals.
FEE_RECIPIENT_ADDRESS= # The address you want to use for fee payments.
Expand Down
2 changes: 1 addition & 1 deletion docs/charon/charon-cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `charon` client is under heavy development, interfaces are subject to change

:::

The following is a reference for charon version [`v0.19.0`](https://github.com/ObolNetwork/charon/releases/tag/v0.19.0). Find the latest release on [our Github](https://github.com/ObolNetwork/charon/releases).
The following is a reference for charon version [`v0.19.1`](https://github.com/ObolNetwork/charon/releases/tag/v0.19.1). Find the latest release on [our Github](https://github.com/ObolNetwork/charon/releases).

The following are the top-level commands available to use.

Expand Down
158 changes: 158 additions & 0 deletions docs/sdk/classes/Client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
Obol sdk Client can be used for creating, managing and activating distributed validators.

## Extends

- `Base`

## Constructors

### new Client(config, signer)

> **new Client**(`config`, `signer`?): [`Client`](Client.md)

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `config` | `Object` | Client configurations |
| `config.baseUrl`? | `string` | obol-api url |
| `config.chainId`? | `number` | Blockchain network ID |
| `signer`? | `Signer` | ethersJS Signer |

#### Returns

[`Client`](Client.md)

Obol-SDK Client instance

An example of how to instantiate obol-sdk Client:
[obolClient](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts#L29)

#### Overrides

`Base.constructor`

#### Source

index.ts:28

## Methods

### createClusterDefinition()

> **createClusterDefinition**(`newCluster`): `Promise`< `string` \>

Creates a cluster definition which contains cluster configuration.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `newCluster` | [`ClusterPayload`](../type-aliases/ClusterPayload.md) | The new unique cluster. |

#### Returns

`Promise`< `string` \>

config_hash.

#### Throws

On duplicate entries, missing or wrong cluster keys.

An example of how to use createClusterDefinition:
[createObolCluster](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)

#### Source

index.ts:43

***

### getClusterDefinition()

> **getClusterDefinition**(`configHash`): `Promise`< [`ClusterDefintion`](../interfaces/ClusterDefintion.md) \>

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `configHash` | `string` | The configuration hash returned in createClusterDefinition |

#### Returns

`Promise`< [`ClusterDefintion`](../interfaces/ClusterDefintion.md) \>

The cluster definition for config hash

#### Throws

On not found config hash.

An example of how to use getClusterDefinition:
[getObolClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)

#### Source

index.ts:134

***

### getClusterLock()

> **getClusterLock**(`configHash`): `Promise`< [`ClusterLock`](../type-aliases/ClusterLock.md) \>

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `configHash` | `string` | The configuration hash in cluster-definition |

#### Returns

`Promise`< [`ClusterLock`](../type-aliases/ClusterLock.md) \>

The matched cluster details (lock) from DB

#### Throws

On not found cluster definition or lock.

An example of how to use getClusterLock:
[getObolClusterLock](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)

#### Source

index.ts:151

***

### updateClusterDefinition()

> **updateClusterDefinition**(`operatorPayload`, `configHash`): `Promise`< [`ClusterDefintion`](../interfaces/ClusterDefintion.md) \>

Approves joining a cluster with specific configuration.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `operatorPayload` | [`OperatorPayload`](../type-aliases/OperatorPayload.md) | The operator data including signatures. |
| `configHash` | `string` | The config hash of the cluster which the operator confirms joining to. |

#### Returns

`Promise`< [`ClusterDefintion`](../interfaces/ClusterDefintion.md) \>

The cluster definition.

#### Throws

On unauthorized, duplicate entries, missing keys, not found cluster or invalid data.

An example of how to use updateClusterDefinition:
[updateClusterDefinition](https://github.com/ObolNetwork/obol-sdk-examples/blob/main/TS-Example/index.ts)

#### Source

index.ts:94
10 changes: 10 additions & 0 deletions docs/sdk/enumerations/FORK_MAPPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Permitted ChainID's

## Enumeration Members

| Enumeration Member | Value | Description |
| :------ | :------ | :------ |
| `0x00000000` | `1` | Mainnet. |
| `0x00000064` | `100` | Gnosis Chain. |
| `0x00001020` | `5` | Goerli/Prater. |
| `0x01017000` | `17000` | Holesky. |
38 changes: 38 additions & 0 deletions docs/sdk/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
hide_title: true
---

![Obol Logo](https://obol.tech/obolnetwork.png)

<h1 align="center">Obol SDK</h1>

This repo contains the Obol Software Development Kit, for creating Distributed Validators with the help of the [Obol API](https://docs.obol.tech/api).

## Getting Started

Checkout our [docs](https://docs.obol.tech/docs/int/quickstart/advanced/quickstart-sdk), [examples](https://github.com/ObolNetwork/obol-sdk-examples/), and SDK [reference](https://obolnetwork.github.io/obol-packages). Further guides and walkthroughs coming soon.

## Enumerations

- [FORK\_MAPPING](enumerations/FORK_MAPPING.md)

## Classes

- [Client](classes/Client.md)

## Interfaces

- [ClusterDefintion](interfaces/ClusterDefintion.md)

## Type Aliases

- [BuilderRegistration](type-aliases/BuilderRegistration.md)
- [BuilderRegistrationMessage](type-aliases/BuilderRegistrationMessage.md)
- [ClusterCreator](type-aliases/ClusterCreator.md)
- [ClusterLock](type-aliases/ClusterLock.md)
- [ClusterOperator](type-aliases/ClusterOperator.md)
- [ClusterPayload](type-aliases/ClusterPayload.md)
- [ClusterValidator](type-aliases/ClusterValidator.md)
- [DepositData](type-aliases/DepositData.md)
- [DistributedValidator](type-aliases/DistributedValidator.md)
- [OperatorPayload](type-aliases/OperatorPayload.md)
23 changes: 23 additions & 0 deletions docs/sdk/interfaces/ClusterDefintion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Cluster definition data needed for dkg

## Extends

- [`ClusterPayload`](../type-aliases/ClusterPayload.md)

## Properties

| Property | Type | Description | Inherited from |
| :------ | :------ | :------ | :------ |
| `config_hash` | `string` | The cluster configuration hash. | - |
| `creator` | [`ClusterCreator`](../type-aliases/ClusterCreator.md) | The creator of the cluster. | - |
| `definition_hash?` | `string` | The hash of the cluster definition. | - |
| `dkg_algorithm` | `string` | The cluster dkg algorithm. | - |
| `fork_version` | `string` | The cluster fork version. | - |
| `name` | `string` | The cluster name. | `ClusterPayload.name` |
| `num_validators` | `number` | The number of distributed validators in the cluster. | - |
| `operators` | [`ClusterOperator`](../type-aliases/ClusterOperator.md)[] | The cluster nodes operators addresses. | `ClusterPayload.operators` |
| `threshold` | `number` | The distributed validator threshold. | - |
| `timestamp` | `string` | The cluster creation timestamp. | - |
| `uuid` | `string` | The cluster uuid. | - |
| `validators` | [`ClusterValidator`](../type-aliases/ClusterValidator.md)[] | The clusters validators information. | `ClusterPayload.validators` |
| `version` | `string` | The cluster configuration version. | - |
14 changes: 14 additions & 0 deletions docs/sdk/type-aliases/BuilderRegistration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
> **BuilderRegistration**: `Object`

Pre-generated Signed Validator Builder Registration

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `message` | [`BuilderRegistrationMessage`](BuilderRegistrationMessage.md) | Builder registration message. |
| `signature` | `string` | BLS signature of the builder registration message. |

## Source

types.ts:143
16 changes: 16 additions & 0 deletions docs/sdk/type-aliases/BuilderRegistrationMessage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
> **BuilderRegistrationMessage**: `Object`

Unsigned DV Builder Registration Message

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `fee_recipient` | `string` | The DV fee recipient. |
| `gas_limit` | `number` | Default is 30000000. |
| `pubkey` | `string` | The public key of the DV. |
| `timestamp` | `number` | Timestamp when generating cluster lock file. |

## Source

types.ts:125
14 changes: 14 additions & 0 deletions docs/sdk/type-aliases/ClusterCreator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
> **ClusterCreator**: `Object`

Cluster creator data

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `address` | `string` | The creator address. |
| `config_signature` | `string` | The cluster configuration signature. |

## Source

types.ts:51
17 changes: 17 additions & 0 deletions docs/sdk/type-aliases/ClusterLock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> **ClusterLock**: `Object`

Cluster Details after DKG is complete

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `cluster_definition` | [`ClusterDefintion`](../interfaces/ClusterDefintion.md) | The cluster definition. |
| `distributed_validators` | [`DistributedValidator`](DistributedValidator.md)[] | The cluster distributed validators. |
| `lock_hash` | `string` | The hash of the cluster lock. |
| `node_signatures` | `string`[] | Node Signature for the lock hash by the node secp256k1 key. |
| `signature_aggregate` | `string` | The cluster bls signature aggregate. |

## Source

types.ts:194
18 changes: 18 additions & 0 deletions docs/sdk/type-aliases/ClusterOperator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
> **ClusterOperator**: `Object`

Node operator data

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `address` | `string` | The operator address. |
| `config_signature` | `string` | The operator configuration signature. |
| `enr` | `string` | The operator ethereum node record. |
| `enr_signature` | `string` | The operator enr signature. |
| `fork_version` | `string` | The cluster fork_version. |
| `version` | `string` | The cluster version. |

## Source

types.ts:22
15 changes: 15 additions & 0 deletions docs/sdk/type-aliases/ClusterPayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
> **ClusterPayload**: `Object`

Cluster configuration

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | The cluster name. |
| `operators` | [`ClusterOperator`](ClusterOperator.md)[] | The cluster nodes operators addresses. |
| `validators` | [`ClusterValidator`](ClusterValidator.md)[] | The clusters validators information. |

## Source

types.ts:74
14 changes: 14 additions & 0 deletions docs/sdk/type-aliases/ClusterValidator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
> **ClusterValidator**: `Object`

Validator withdrawal configuration

## Type declaration

| Member | Type | Description |
| :------ | :------ | :------ |
| `fee_recipient_address` | `string` | The validator fee recipient address. |
| `withdrawal_address` | `string` | The validator reward address. |

## Source

types.ts:62
Loading