Code Monkey home page Code Monkey logo

warnet's Introduction

Warnet

Monitor and analyze the emergent behaviours of Bitcoin networks

Local Deployment

  1. Requirements

Make sure to have docker and docker-compose installed

For macOS, a bridge to the docker subnet is required, such as https://github.com/chipmk/docker-mac-net-connect

# Install via Homebrew
brew install chipmk/tap/docker-mac-net-connect

# Run the service and register it to launch at boot
sudo brew services start chipmk/tap/docker-mac-net-connect
  1. Install the dependencies

It is recommended to create a virtual environment, like so:

python3 -m venv .venv
source .venv/bin/activate

and then install the dependencies with setuptools:

pip install -e .
  1. Start the docker containers

Each container is a node as described in the graph.

warnet
  1. Manually run scenarios

See /src/scenarios for examples. Scenarios are written using the Bitcoin Core test framework for functional testing with some modifications (most notably that self.nodes[] represents an array dockerized bitcoind nodes)

Example:

# Command one node to generate a wallet and fill 100 blocks with 100 txs each
python src/scenarios/tx-flood.py

Remote / Cloud Deployment

// TODO

Command-line Tools

      Usage: warnet-cli <command> <arg1> <arg2> ...

      Available commands:
        bcli <node#> <method> <params...> Send a bitcoin-cli command to the specified node.
        log <node#>                       Output the bitcoin debug.log file for specified node.
        run <scnario name> <args...>      Run the specified warnet scenario.
        messages <src:node#> <dest:node#> Output the captured messages between two specified nodes.
        stop                              Stop warnet. Stops and removes all containers and networks.

Build a Network Graph

// TODO

The graphml file MUST have a series of <node> objects. Each <node> object MUST have a version element with one of the following syntax examples:

Official Bitcoin Core release version, available from https://bitcoincore.org/bin (The binary will be downloaded and installed):

<data key="version">25.0</data>

A remote branch on GitHub (the branch will be cloned, built, and installed):

<data key="version">vasild/bitcoin#relay_tx_to_priv_nets</data>

warnet's People

Contributors

pinheadmz avatar extheoisah avatar willcl-ark avatar josibake 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.