Giter Club home page Giter Club logo

manspreading's Introduction

Manspreading

Manspreading helps you greedily occupy a peer seat in a remote geth node. seat-occupied

Introduction

Sadly, due to the fact that many nodes on Ethereum network do not change the default --maxpeers settings, most nodes are full and won't accept new peers. Although there are static-nodes.json and trusted-nodes.json where a node owner can hardcode peers that will always connect regardless of the restriction by --maxpeers, these options are buried deep in the document and codebase, so that few knows they exist. Preserving a node peer seat at a peer becomes essential in the development/research on geth.

Manspreading is a proxy server that can be run as daemon and occupies a "seat" at a remote geth peer, so the real geth instance behind the proxy can stop and restart anytime without worrying the seat at the remote peer been taken during the restart period.

Prerequisite

  • Golang (v1.8+)
  • You need to install geth as the dependency by running go get github.com/ethereum/go-ethereum

Usage

  1. go build .
  2. ./manspreading --upstream="<remote node enode url>" --listenaddr="127.0.0.1:36666"
    A log line will show what's the enode url of the manspreading proxy in the format of enode://<nodekey>@<listenaddr>
    or if you have a nodekey file that you'd like to use:
    ./manspreading --upstream="<remote node enode url>" --listenaddr="127.0.0.1:36666" --nodekey="<path_to_your_nodekey>"
    Upstream node will be configured as both a static node and a trusted node, therefore even if the upstream disconnect itself, manspreading will attempt to reconnect indefinitely.
  3. Start your real geth instance and add the manspreading enode url as a peer by running admin.addPeer("<manspreading enode url>")

TODO

  • Making manspreading a 1-to-many or even a many-to-many proxy

manspreading's People

Contributors

xiaoyao1991 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

manspreading's Issues

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.