GithubHelp home page GithubHelp logo

isabella232 / go-ethereum-p2p-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from livepeer/go-ethereum-p2p-test

0.0 0.0 0.0 68.61 MB

testing ground for creating a p2p network on top of devp2p

License: GNU Lesser General Public License v3.0

Makefile 0.14% Go 88.11% Shell 0.04% NSIS 0.38% Ruby 0.08% JavaScript 1.50% M4 0.19% C 7.40% C++ 1.04% Java 0.03% Assembly 0.24% CSS 0.01% HTML 0.43% Python 0.44%

go-ethereum-p2p-test's Introduction

LivePeer

Livepeer is a decentralized live streaming broadcast platform. This repo is a proof-of-concept spike built on top of Swarm and go-ethereum developed by the Ethereum Foundation.

Building and running this node allows you to:

  • Create a local Livepeer Network, or join the existing Livepeer POC network.
  • Broadcast a live stream into the network.
  • Request that your stream be transcoded into multiple formats.
  • Consume a live stream from the network.

For full documentation and a project overview, check out the Livepeer Documentation

Installation

The Livepeer POC requires ffmpeg. On OSX:

brew install ffmpeg --with-ffplay

git clone https://github.com/livepeer/go-ethereum.git
cd go-ethereum
go install ./cmd/geth
go install ./cmd/livepeer

Setup

If you would like to simply connect to the Livepeer Toynet (test network with id=326), no setup is necessary. Simply run the command:

livepeer

This will prompt you to create a new ethereum account, and unlock it with a password.

If you would like to control where the data for Livepeer is stored, and which account is used in each data directory (you may want to do this if you're running multiple nodes), then create a new account in a new directory:

geth --datadir <datadir> account new

Copy the output account address, perhaps into an environment variable $BZZKEY. You can then use this when you start livepeer

livepeer --bzzaccount $BZZKEY --datadir <datadir>

By default this should connect you to the Livepeer POC network. For detailed instructions on all the options you can pass, refer to the following section.

Detailed setup including running a private network

Since this spike runs on top of Swarm and an Ethereum node, you'll need to do a little ethereum setup to get a node running and initialize an account. Follow the instructions in the go-ethereum README for running a private network.

Usage

The simplest way to start Livepeer and connect to the test network is just by running:

livepeer

By default, starting Livepeer will launch an RTMP interface on port 1935. You can override this with the --rtmp option:

livepeer --rtmp 1937

or more control over the account, data directory, and network you connect to:

livepeer --bzzaccount $BZZKEY --datadir $DATADIR --ethapi $DATADIR/geth.ipc --lpnetworkid 412 --rtmp 1935

To run a second node, so that you can test streaming to one another, specify a new --port, --rtmp, --bzzport, --datadir, and --bzzaccount argument:

livepeer --bzzaccount $BZZKEY2 --datadir $DATADIR2 --ethapi $DATADIR/geth.ipc --verbosity 4 --maxpeers 3 --port 30402 --lpnetworkid 412 --rtmp 1936

Now that you have two nodes running, make sure they are talking to each other, then stream into one node and play from the other. You can stream a saved video using ffmpeg, For example:

ffmpeg -re -i bunny.mp4 -c copy -f flv rtmp://localhost:1935/movie

This will output the streamID to the console of node running on port 1935 (the default). Copy the streamID. And you can play from the second node (running on RTMP port 1936) using the livepeer command.

livepeer stream --rtmp 1936 <streamID>

To start a true livestream instead of playing a pre-recorded video, visit our web client or use a broadcasting platform such as OBS, and point the output at rtmp://localhost:1935/movie

Transcoding

To enable transcoding, add ?transcode=true in your RTMP uplink video. For ease of testing, start SRS manually. (So you can see the output). To start srs, create a ./objs directory, and run ./bin/srs -c srs.conf

Metrics and monitoring

To look at a list of metrics, use the --metrics flag when starting swarm, and use geth monitor to monitor metrics. For example:

livepeer --bzzaccount $BZZKEY --datadir $DATADIR --ethapi $DATADIR/geth.ipc --verbosity 4 --maxpeers 3 --port 30402 --lpnetworkid 412 --rtmp 1935 --metrics

geth monitor --attach ipc:/Users/erictang/Sandbox/swarmdata1/bzzd.ipc livepeer/test livepeer/chunks/

It is also possible to run a network visualization server which will let you view the current state of your network for a given streamID. See the documentation at the streamingviz repository. To start a livepeer node that reports to the visualization server, add the --viz flag:

livepeer --bzzaccount $BZZKEY --datadir $DATADIR --ethapi $DATADIR/geth.ipc --lpnetworkid 412 --rtmp 1935 --viz

Additional functionality available through Swarm and Ethereum

Since this spike is built on top of Swarm and Ethereum, all the available functionality is exposed through this project. Please see the documentation at the go-ethereum repository

License from Go-Ethereum

The go-ethereum library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The go-ethereum binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

go-ethereum-p2p-test's People

Contributors

0xc1c4da avatar arachnid avatar arboreum avatar caktux avatar cjentzsch avatar cubedro avatar debris avatar dob avatar ebuchman avatar ericxtang avatar erobit avatar ethers avatar fjl avatar frewsxcv avatar gavofyork avatar heikoheiko avatar hiddentao avatar jimenezrick avatar karalabe avatar kobigurk avatar lefterisjp avatar leijurv avatar mansaj avatar obscuren avatar tgerring avatar vbuterin avatar winsvega avatar xcthulhu avatar zelig avatar zsfelfoldi 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.