Giter Site home page Giter Site logo

pinkdiamond1 / ultralight Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethereumjs/ultralight

0.0 1.0 0.0 19.5 MB

Ethereum Portal Network TypeScript implementation

Home Page: https://github.com/ethereum/portal-network-specs

Shell 0.58% JavaScript 1.89% Ruby 0.19% Java 0.42% Rust 0.09% TypeScript 95.12% CSS 0.03% Swift 1.13% HTML 0.17% Dockerfile 0.39%

ultralight's Introduction

Ultralight - Portal Network Clients in the browser

This monorepo comprises a suite of tools currently in development to allow dapps, wallet providers, and really any Javascript based Ethereum application to connect into the Portal Network once development is complete and the Portal Network is live.

Prequisites

Node v16+, NPM v7+

Quick Start

Clone this repo and run npm i from the root directory. This project leverages npm workspaces so requires NPM v7 or above.

  • Start the cli - npm run start-cli and you should see some logs like below indicating the node is starting up
de2f8:ultralight Started JSON RPC Server address=http://localhost:8545
de2f8:discv5:service Updated ENR based on public multiaddr to enr:-IS4QH2xRY1ov...
  • Copy the node's ENR which should start with enr:-IS...
    • Alternatively, retrieve the node's ENR using the JSON-RPC. Details here
  • Start the browser client dev server - npm run start-browser-client and open a browser window at localhost:8080
  • Click Start Node, paste the ENR into the input that says Node ENR and press Connect To Node
  • You should see a node appear in the table on the left side of the page
  • In the terminal where the Ultralight-CLI client is running, you should see something like below:
de2f8:portalnetwork Received History Subnetwork request +25s
de2f8:portalnetwork TALKREQUEST with PING message received from b81736575498a5850b0dd52f2695268cf60fe6c89ab74289692c5225c9e4e09e +0ms
de2f8:portalnetwork adding b81736575498a5850b0dd52f2695268cf60fe6c89ab74289692c5225c9e4e09e 
  • Try retrieving a block from the network. (Hint: Enter 0x88e96d4537bea4d9c05d12549907b32561d3bf31f45aae734cdc119f13406cb6 - the hash for Block 1 from the Ethereum Mainnet in the input box on the right input and press the "Get Block by Blockhash")

Connecting to the testnet

  1. Follow the above quickstart guide as far as installing all dependencies.
  2. From the repository root, run node packages/proxy/dist/index.js --nat=extip
  3. Run npm run start-browser-client
  4. Connect to one of the Ultralight bootnodes
  5. You should start to see the network table populate with additional nodes as the client fills in its routing table
  6. Try and get any block by blockhash from the Ethereum Mainnet between blocks 1-2500.
  7. Crossing fingers You should see the block header details before too long

Development Notes

Use npm run dev in the portalnetwork library to have Typescript automatically recompile code as changes are made.

The browser client supports live reload as well as so any changes made in the portalnetwork or browser-client libraries will result in the browser client reloading.

Detailed Node Usage/Interop Instructions

See the browser client and cli READMEs for more specific usage with each client.

Interop instructions for interacting with the Fluffy and Trin portal clients

Monorepo Structure

The portalnetwork library is the application layer needed to interact with the Portal Network and depends on discv5 for its networking layer

This a simple nodejs server that accepts incoming websocket connections from clients running the portalnetwork module and routes their messages on to other Portal Network clients

This is a technical demonstration of a web application that uses the portalnetwork module to connect to the Portal Network

This is a technical demonstration of a NodeJS application that uses the portalnetwork module to connect to the Portal Network

ultralight's People

Contributors

acolytec3 avatar emersonmacro avatar ryanio avatar scottypoi avatar

Watchers

 avatar

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.