Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiaoyao1991/manspreading
Manspreading is a proxy server that helps you greedily occupy a peer seat in a remote geth node
https://github.com/xiaoyao1991/manspreading
blockchain ethereum geth go golang proxy
Last synced: 3 months ago
JSON representation
Manspreading is a proxy server that helps you greedily occupy a peer seat in a remote geth node
- Host: GitHub
- URL: https://github.com/xiaoyao1991/manspreading
- Owner: xiaoyao1991
- License: mit
- Created: 2018-02-26T08:33:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T03:10:12.000Z (over 6 years ago)
- Last Synced: 2024-06-18T23:17:41.399Z (5 months ago)
- Topics: blockchain, ethereum, geth, go, golang, proxy
- Language: Go
- Homepage:
- Size: 7.83 MB
- Stars: 42
- Watchers: 3
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - manspreading
README
# Manspreading
Manspreading helps you greedily occupy a peer seat in a remote geth node.
![seat-occupied](https://sicksack.com/bags/bag-0261.jpg)### Introduction
Sadly, due to the fact that many nodes on Ethereum network do not change the [default](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) `--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](https://github.com/ethereum/go-ethereum/) as the dependency by running `go get github.com/ethereum/go-ethereum`### Usage
1. `go build .`
2. `./manspreading --upstream="" --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://@`
or if you have a nodekey file that you'd like to use:
`./manspreading --upstream="" --listenaddr="127.0.0.1:36666" --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("")`### TODO
- Making manspreading a 1-to-many or even a many-to-many proxy