Warnet Event Guide for Participants
  • Welcome!
  • Housekeeping
  • What is Warnet?
  • Pre-event Setup
  • Start hacking!
  • Your first attack
  • Tips
Powered by GitBook
On this page
  • k9s
  • Warnet commands
  • Hints
  • Logs
  • Funds
  • Scrimmage Mode (Advanced)

Tips

PreviousYour first attack

Last updated 1 month ago

Don't forget to activate your python virtual environment when using new terminals!

Run this command from the directory that you initially created the virtual environment:

source .venv/bin/activate

k9s

Part of the involves installing . This is a great tool for keeping an eye on the tanks in your armada as well as investigating failed scenarios. If a scenario fails, you can use k9s to access the logs.

The warnet auth command from the page automatically sets up your kubernetes context so that you can access your armada through k9s.

To start k9s, all you have to do is open a new terminal tab and run:

k9s

Warnet commands

Warnet has a bunch of commands you can use. Here's an example of getting the status of your armada:

(.venv) --> warnet status
╭────────────────────── Warnet Overview ───────────────────────╮
│                                                              │
│                        Warnet Status                         │
│ ┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┓ │
│ ┃ Component ┃ Name                ┃ Status  ┃ Namespace    ┃ │
│ ┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━┩ │
│ │ Tank      │ armada-0            │ running │ wargames-red │ │
│ │ Tank      │ armada-1            │ running │ wargames-red │ │
│ │ Tank      │ armada-2            │ running │ wargames-red │ │
│ │ Scenario  │ No active scenarios │         │              │ │
│ └───────────┴─────────────────────┴─────────┴──────────────┘ │
│                                                              │
╰──────────────────────────────────────────────────────────────╯

Total Tanks: 3 | Active Scenarios: 0
Network connected

A full list of Warnet commands can be found here:


Hints

If you aren't familiar with the Bitcoin Core functional test framework, this is a list of existing tests you can review to better understand how it can be used for p2p scenarios and to gather inspiration for your next attack:


Logs

There are a number of ways to access the logs for a commander running a scenario. The easiest thing to do is add the --debug option when executing a scenario. For example,

(.venv)$ warnet run scenarios/reconnaissance.py --debug

You can also use warnet logs or warnet logs -f which will provide a list of tanks (kubernetes pods), one of which is your scenario.

Lastly, you can also use k9s. Select your tank (kuberenetes pod), and press l to see the logs.


Funds

Some attacks may require you spend some BTC. Fortunately, the tanks in your armada have wallets that are automatically funded with BTC! For more information, see this section:


Scrimmage Mode (Advanced)

If you're interested, it's possible to set up a local Warnet battlefield so you can test out your scenarios in a more controlled environment. You can use it to debug questions like "is the victim getting the right message?" or check if memory use is increasing.

To set this up, see the "scrimmage" instructions in this README:

k9s
Logowarnet/docs/warnet.md at main · bitcoin-dev-project/warnetGitHub
LogoGitHub - bitcoin-dev-project/battle-of-galen-erso: A multiplayer Warnet competitionGitHub
Use the arrow keys to select a tank (kubernetes pod), and press "l" to view the logs
LogoGitHub - bitcoin-dev-project/battle-of-galen-erso: A multiplayer Warnet competitionGitHub
LogoGitHub - bitcoin-dev-project/battle-of-galen-erso: A multiplayer Warnet competitionGitHub
Let's start hacking!
pre-event setup