Giter Site home page Giter Site logo

obol-sdk-examples's Introduction

Obol Logo

Obol SDK Examples

Description

The repo contains a JS+TS Examples for using Obol-SDK. It also includes a script to create clusters.

Installation And Running the examples

# JS
$ cd JS-Example
$ yarn
$ yarn run start

# TS
$ cd TS-Example
$ yarn
$ yarn run build
$ yarn run start

Runing the Script

The script creates clusters on mainnet based on data in clusters.csv. Update the configuration in clusters.csv before running the script. Update the chain Id in script.js if you want to create clusters on another supported network. Keep in mind that the script expect all validators in a cluster to have the same configurations.

Cluster Configuration Schema

column type
cluster_name string
withdrawal_address Address
fee_recipient_address Address
validator_count number
operator1 Address
operator2 Address
operator3 Address
operator4 Address
... ...
operatorN Address
$ cd Lido-Script
$ yarn
$ node script.js

obol-sdk-examples's People

Contributors

hananinouman avatar oisinkyne avatar

Watchers

 avatar  avatar  avatar

obol-sdk-examples's Issues

GetRandomValues() method not supported

๐ŸŽฏ Problem to be solved

The @obolnetwork/obol-sdk package is throwing an error related to crypto.getRandomValues() not being supported when used within the obol-sdk-examples/JS-Example. This error prevents the SDK's proper function and could indicate a compatibility issue with the version of Node.js being used or a misconfiguration in the SDK itself.

/obol-sdk-examples/JS-Example/node_modules/@obolnetwork/obol-sdk/dist/index.js:17
      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
            ^

Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported
    at rng (/Users/sg/obol/obolnetwork/staging/obol-sdk-examples/JS-Example/node_modules/@obolnetwork/obol-sdk/dist/index.js:17:13)
    at v4 (/Users/sg/obol/obolnetwork/staging/obol-sdk-examples/JS-Example/node_modules/@obolnetwork/obol-sdk/dist/index.js:52:54)
    at Client.createClusterDefinition (/Users/sg/obol/obolnetwork/staging/obol-sdk-examples/JS-Example/node_modules/@obolnetwork/obol-sdk/dist/index.js:15477:19)
    at file:///Users/sg/obol/obolnetwork/staging/obol-sdk-examples/JS-Example/index.js:141:31
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.17.1

SDK Split simplify deploying obol splits with function calls

๐ŸŽฏ Problem to be solved

We want to make sure all the features that build the launchpad are part of SDK so users can create their own launchpad like interface and currently SDK doesn't allow creation of splits. We want to make this mandatory in flow because splitters play a key role in contributing 1% of rewards to the public good in the form of obol. However, if they adhere to the default flow, we do not receive any of these rewards.

๐Ÿ› ๏ธ Proposed solution

Summary:
Add two new functions createObolRewardSplit and createObolTotalSplit

๐Ÿงช Tests

๐Ÿ‘ acceptance criteria

Functional

  • US1:Developer can create their required type of split with desired ratios and withdrawal address programmatically
  • US2: Developer can create the invitation with the created splitter details

Usage:

  • US3: Documentation of new functions in SDK ,their description, input, output, types in Obol SDK repo
  • US8: Guides and examples on how to use SDK to create splits

Business:

  • US9: Obol gets 2% proportion of rewards from the total validator rewards

โŒ Out of Scope

If there is anything to highlight as out of scope for this issue, please outline it here.

-->

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.