Skip to content

Warnet project implementation with one-tank network and attack scenario #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

b-l-u-e
Copy link

@b-l-u-e b-l-u-e commented Jul 4, 2025

Overview

A complete Warnet project implementing a one-tank network with a single attack scenario for hands-on Bitcoin network analysis learning.

Implementation Details

Based on feedback from this comment

��️ Project Structure

  • Created complete Warnet project structure (warnet-demo/)
  • Implemented one-tank network configuration (94.0.0-5k-inv.yaml)
  • Added single scenario (my_first_attack_5kinv.py)

📚 Documentation

  • Enhanced README with comprehensive setup instructions
  • Added extensive links to main Warnet documentation
  • Provided detailed monitoring and progress watching guidance
  • Included multiple monitoring options (dashboard, CLI, direct access)

🎯 Key Features

  • One-tank network: Single node for simplicity and learning
  • Single scenario: Focused on basic network interaction
  • Clear instructions: Step-by-step deployment and execution
  • Multiple monitoring methods: Web dashboard, command line, direct node access
  • Progress watching: Real-time observation of attack execution

What Users Can Do

  1. Deploy the one-node network with warnet deploy warnet-demo
  2. Run the attack scenario with warnet run warnet-demo/scenarios/my_first_attack_5kinv.py
  3. Monitor the tiny network using dashboard or CLI tools
  4. Watch the attack progress in real-time
  5. Understand basic Bitcoin network behavior

Testing

✅ Successfully tested deployment and scenario execution
✅ Verified monitoring capabilities work as documented
✅ Confirmed one-node network operates correctly

b-l-u-e added 2 commits June 27, 2025 01:12
Add a beginner-friendly guide that teaches users how to:
- Set up Warnet using standard installation workflow
- Deploy Bitcoin networks with warnet new command
- Run existing scenarios (miner_std, tx_flood, reconnaissance)
- Monitor and interact with networks via dashboard

This provides a simple entry point for new users to learn Warnet
without requiring custom scripts or source installation.
- Created one-tank network (single node)
- Implemented single scenario (my_first_attack_5kinv.py)
- Enhanced README with comprehensive Warnet docs links
- Added detailed monitoring and progress watching instructions
- Provided multiple ways to monitor the tiny network
- Clear step-by-step execution and observation guidance
Copy link
Contributor

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I think this needs a lot more effort. I appreciate you taking the time to put together this demo for the BDP website, but it's disorganized and nothing works. If you still want to work on this, please proof read your work by pretending to be a beginner, and naievly following the steps you write out, to see if you get any results.

```sh
# Create virtual environment
python3 -m venv .venv
source ./venv/bin/activate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source ./venv/bin/activate
source .venv/bin/activate

Comment on lines +42 to +43
- **Minikube** - Local Kubernetes cluster (recommended for beginners)
- **Docker Desktop** - If you have Docker Desktop with Kubernetes enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think Docker Desktop is better for beginners because it has a GUI. I would assume Docker Desktop for mac users and minikube for linux users

This project includes a pre-configured one-node network. Deploy it with:

```sh
warnet deploy warnet-demo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected this to be warnet deploy networks/warnet-demo or warnet deploy networks/94.0.0-5k-inv. I was surprised this command worked but I realized its because your directory structure is not standard for warnet. I think it should be something like this (I created this using warnet new and then following the inquirer prompts):

warnet-demo/
├── networks
│   └── 5k-inv-attack
│       ├── network.yaml
│       └── node-defaults.yaml
├── plugins
│   ├── __init__.py
│   ├── simln
│   │   ├── README.md
│   │   ├── charts
│   │   └── plugin.py
│   └── tor
│       ├── charts
│       └── plugin.py
└── scenarios
    ├── __init__.py
    ├── commander.py
    ├── ln_framework
    │   ├── __init__.py
    │   └── ln.py
    ├── ln_init.py
    ├── miner_std.py
    ├── reconnaissance.py
    ├── signet_miner.py
    ├── test_framework
    │   ├── __init__.py
    │   ├── ...
    └── tx_flood.py

Execute the included scenario to see the network in action:

```sh
warnet run warnet-demo/scenarios/my_first_attack_5kinv.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warnet run warnet-demo/scenarios/my_first_attack_5kinv.py
warnet run warnet-demo/scenarios/my_first_attack_5kinv.py --debug

This might be more fun to show some running-time output of the scenario, but of course it will consume the shell foreground so for other commands like warnet dashboard we might not want to add --debug what do you think?

Comment on lines +68 to +69
- Monitor transaction propagation across the network
- Show you how nodes communicate and synchronize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I thought we were going to test an attack, literally https://github.com/bitcoin-dev-project/battle-of-galen-erso/blob/main/scenarios/my_first_attack_5kinv.py

What you have here is actually very cool and totally fine - but then we mine as well add 1-2 more nodes so we can actually see actual network propogation. Then go ahead and just rename the scenario something like propogation-check and instruct the user to do warnet dashboard etc

and THEN....
we can still run the attack from Galen Erso and watch a node die. (if you like?)

- **[Warnet Scenarios](https://github.com/bitcoin-dev-project/warnet?tab=readme-ov-file#scenarios)** - Learn how to create custom attack scenarios
- **[Warnet Networks](https://github.com/bitcoin-dev-project/warnet?tab=readme-ov-file#networks)** - Understanding network configuration
- **[Bitcoin Core Test Framework](https://github.com/bitcoin/bitcoin/tree/master/test/functional)** - Framework used by Warnet scenarios
- **[Bitcoin Development Guide](https://bitcoin.org/en/development)** - General Bitcoin development resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can just drop this


- **[Warnet Documentation](https://github.com/bitcoin-dev-project/warnet)** - Complete guide to Warnet features and usage
- **[Warnet Quick Start](https://github.com/bitcoin-dev-project/warnet?tab=readme-ov-file#quick-start)** - Step-by-step installation guide
- **[Warnet Scenarios](https://github.com/bitcoin-dev-project/warnet?tab=readme-ov-file#scenarios)** - Learn how to create custom attack scenarios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try these links? They don't work.

use

https://github.com/bitcoin-dev-project/warnet/blob/main/docs/scenarios.md

...etc.

@@ -0,0 +1,123 @@
# SimLN Plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove the entire plugins/ directory, it's more advanced usage and not worth the confusion of including in an introductory guide.

@@ -0,0 +1,35 @@
name: "warnet-demo"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file for?

@@ -0,0 +1,132 @@
# Warnet Demo Project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this extra README for? It describes a 5-node network which we don't have.

@b-l-u-e
Copy link
Author

b-l-u-e commented Jul 15, 2025

Thank you for your feedback..
I will resolve on changes suggested...
And proofread the setup and run it on new venv...
I had ran the demo on my existing venv...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants