carlaKC / attackathon

utilities and instructions to run a lightning jamming attackathon
0 stars 6 forks source link

Adds armada ns, pods and services #2

Closed m3dwards closed 5 months ago

m3dwards commented 5 months ago

Armada is the working name given to a selection of running containers and k8s services that belong to the attacker and represent nodes they have full control over. It consists of 1 bitcoind that is connected to the main warnet network, 3 lnd nodes that are connected to that bitcoind node (but not peered with each other yet) and one generic ubuntu container called flagship from where to shell into and run commands.

Hostnames:

Podnames:

Assuming k8s cluster is setup and kubectl is configured to talk to it, to apply this:

kubectl apply -f setup/armada.yaml

To view the armada pods

kubectl get pods -n warnet-armada

To shell into lnd0 or flagship pod/container use the pod name

kubectl exec -it lnd0 -n warnet-armada -- bash
kubectl exec -it flagship -n warnet-armada -- bash

To destroy the armada

kubectl delete ns warnet-armada

I haven't updated any documentation or install scripts in this PR as it doesn't seem to mention k8s at all at the moment so didn't know where to put it.

carlaKC commented 5 months ago

Thanks for helping out @m3dwards, going to test this out today!

I haven't updated any documentation or install scripts in this PR as it doesn't seem to mention k8s at all at the moment so didn't know where to put it.

I'll handle this in a followup, we only made the decision to switch to k8s over docker compose for local dev recently so all of this needs an update anywayI

pinheadmz commented 5 months ago

Thanks Max! Tested locally and works as expected. I can add more docs next week and few more tweaks to make hacking easier. For example, a shared volume in the pod so all the lnd credentials can be accessed directly by the flagship. For bitcoind hackers will have to include whatever bitcoin rpc client library they need for their language of choice and then configure correctly.

From inside the flagship container, they can install bitcoin-cli from https://bitcoincore.org/en/download/ and then execute commands like this:

 bitcoin-cli -regtest -rpcconnect=bitcoind -rpcuser=warnet_user -rpcpassword=2themoon getblockcount