GithubHelp home page GithubHelp logo

isabella232 / trin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethereum/trin

0.0 0.0 0.0 762 KB

An Ethereum portal client: a json-rpc server with nearly instant sync, and low CPU & storage usage

Rust 99.37% Dockerfile 0.24% Makefile 0.16% Python 0.23%

trin's Introduction

Trin

Trin is an Ethereum "portal": a json-rpc server with nearly instant sync, and low CPU & storage usage.

Trin does this by making these tradeoffs:

  • Trusts miners to include valid state transitions, to skip sync
  • Shards state across a (new) p2p network, to reduce local storage needs

This should sound similar to a light client. It is, but with a peer-to-peer philosophy rather than the LES client/server model, which has introduced challenges in an altruistic environment.

Repository Structure

The portal protocol is a collection of networks. Trin needs to connect to all of them.

The repository is structured as follows:

  • trin/: The main entry point to run a holistic Ethereum portal client
  • trin-history/: The chain history network
  • trin-state/: The state network

Ready for production?

LOL, not even a little bit. At the last readme update, this was simply a proxy to Infura for all inbound requests, and doesn't validate any answers against state roots.

Trin will proxy at least some requests to Infura for quite a while, but the plan is to incrementally reduce the reliance on Infura, as more trin functionality becomes available.

How to use Trin

Checkout out the Getting Started guide to quickly get up and running with Trin.

CLI Options

trin 0.0.1
carver
Run an eth portal client

USAGE:
    trin [OPTIONS]

FLAGS:
        --enable-metrics    Enable prometheus metrics reporting (requires --metrics-url)
    -h, --help              Prints help information
        --internal-ip       (For testing purposes) Use local ip address rather than external via STUN.
    -V, --version           Prints version information

OPTIONS:
        --bootnodes <bootnodes>               One or more comma-delimited base64-encoded ENR's or multiaddr strings of
                                              peers to initially add to the local routing table [default: ]
        --discovery-port <discovery_port>     The UDP port to listen on. [default: 9000]
        --external-address <external_addr>    The public IP address and port under which this node is accessible
        --kb <kb>                             Maximum number of kilobytes of total data to store in the DB
                                              [default: 100000]
        --metrics-url <metrics-url>           URL for prometheus server
        --networks <networks>...              Comma-separated list of which portal subnetworks to activate
                                              [default: history,state]
        --pool-size <pool_size>               max size of threadpool [default: 2]
        --unsafe-private-key <private_key>    Hex encoded 32 byte private key (considered unsafe to pass in pk as cli
                                              arg, as it's stored in terminal history - keyfile support coming soon)
        --web3-http-address <web3-http-address>    address to accept json-rpc http connections [default: 127.0.0.1:8545]
        --web3-ipc-path <web3_ipc_path>       path to json-rpc endpoint over IPC [default: /tmp/trin-jsonrpc.ipc]
        --web3-transport <web3_transport>     select transport protocol to serve json-rpc endpoint [default: ipc]
                                              [possible values: http, ipc]

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing, then check out issues that are labeled Good First Issue.

Gotchas

  • There is a limit on concurrent connections given by the threadpool. At last doc update, that number was 2, but will surely change. If you leave connections open, then new connections will block.

trin's People

Contributors

acolytec3 avatar carver avatar jacobkaufmann avatar kolbyml avatar lithp avatar mrferris avatar njgheorghita avatar ogenev avatar pawanjay176 avatar samwilsn avatar victor-wei126 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.