From f1046e909bfcb775d55f7d10a820f341dbbfcfaa Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Fri, 19 Apr 2024 13:46:40 -0400 Subject: [PATCH] attck: start basic architecture Signed-off-by: Vincenzo Palazzo --- Makefile | 12 ++++ flake.nix | 1 + logs.txt | 127 ++++++++++++++++++++++++++++++++++++ templates/golang/Makefile | 39 +++++++++++ templates/golang/attack.go | 7 ++ templates/golang/bitcoin.go | 12 ++-- templates/golang/graph.go | 5 +- templates/golang/main.go | 11 +++- 8 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 Makefile create mode 100644 logs.txt create mode 100644 templates/golang/Makefile create mode 100644 templates/golang/attack.go diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e34cb2b --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +## +# Project Title +# +# @file +# @version 0.1 + +sandbox: + cd .. && git clone https://github.com/bitcoin-dev-project/warnet.git + cd .. && git clone https://github.com/bitcoin-dev-project/sim-ln.git + cd .. && git clone https://github.com/lightningequipment/circuitbreaker.git + +# end diff --git a/flake.nix b/flake.nix index f37d2ba..95c2b1f 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,7 @@ just go + rustc cargo python3 diff --git a/logs.txt b/logs.txt new file mode 100644 index 0000000..d9338ed --- /dev/null +++ b/logs.txt @@ -0,0 +1,127 @@ +* +* ==> Audit <== +* |---------|---------------|----------|---------|---------|---------------------|---------------------| +| Command | Args | Profile | User | Version | Start Time | End Time | +|---------|---------------|----------|---------|---------|---------------------|---------------------| +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:41 EDT | | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:43 EDT | | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:43 EDT | | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:44 EDT | | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:44 EDT | | +| delete | | minikube | vincent | v1.32.0 | 19 Apr 24 11:45 EDT | 19 Apr 24 11:45 EDT | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:45 EDT | | +| delete | | minikube | vincent | v1.32.0 | 19 Apr 24 11:47 EDT | 19 Apr 24 11:47 EDT | +| start | --driver=kvm2 | minikube | vincent | v1.32.0 | 19 Apr 24 11:47 EDT | | +| start | | minikube | vincent | v1.32.0 | 19 Apr 24 11:52 EDT | | +|---------|---------------|----------|---------|---------|---------------------|---------------------| + +* +* ==> Last Start <== +* Log file created at: 2024/04/19 11:52:58 +Running on machine: vincenzopalazzo-arch-dev +Binary: Built with gc go1.22.2 for linux/amd64 +Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg +I0419 11:52:58.618779 80336 out.go:296] Setting OutFile to fd 1 ... +I0419 11:52:58.618945 80336 out.go:348] isatty.IsTerminal(1) = true +I0419 11:52:58.618947 80336 out.go:309] Setting ErrFile to fd 2... +I0419 11:52:58.618949 80336 out.go:348] isatty.IsTerminal(2) = true +I0419 11:52:58.619025 80336 root.go:338] Updating PATH: /home/vincent/.minikube/bin +I0419 11:52:58.619285 80336 out.go:303] Setting JSON to false +I0419 11:52:58.620308 80336 start.go:128] hostinfo: {"hostname":"vincenzopalazzo-arch-dev","uptime":6056,"bootTime":1713535923,"procs":388,"os":"linux","platform":"arch","platformFamily":"arch","platformVersion":"rolling","kernelVersion":"6.6.27-1-lts","kernelArch":"x86_64","virtualizationSystem":"kvm","virtualizationRole":"host","hostId":"a1274155-875d-4fcd-a837-5a8932ae4ff0"} +I0419 11:52:58.620339 80336 start.go:138] virtualization: kvm host +I0419 11:52:58.621424 80336 out.go:177] ๐Ÿ˜„ minikube v1.32.0 on Arch rolling +I0419 11:52:58.622862 80336 out.go:177] โ–ช MINIKUBE_WANTUPDATENOTIFICATION=false +I0419 11:52:58.622891 80336 notify.go:220] Checking for updates... +I0419 11:52:58.623942 80336 config.go:182] Loaded profile config "minikube": Driver=kvm2, ContainerRuntime=docker, KubernetesVersion=v1.28.3 +I0419 11:52:58.623975 80336 driver.go:378] Setting default libvirt URI to qemu:///system +I0419 11:52:58.624151 80336 main.go:141] libmachine: Found binary path at /home/vincent/.minikube/bin/docker-machine-driver-kvm2 +I0419 11:52:58.624194 80336 main.go:141] libmachine: Launching plugin server for driver kvm2 +I0419 11:52:58.635949 80336 main.go:141] libmachine: Plugin server listening at address 127.0.0.1:39853 +I0419 11:52:58.636602 80336 main.go:141] libmachine: () Calling .GetVersion +I0419 11:52:58.637212 80336 main.go:141] libmachine: Using API Version 1 +I0419 11:52:58.637222 80336 main.go:141] libmachine: () Calling .SetConfigRaw +I0419 11:52:58.637382 80336 main.go:141] libmachine: () Calling .GetMachineName +I0419 11:52:58.637457 80336 main.go:141] libmachine: (minikube) Calling .DriverName +I0419 11:52:59.472177 80336 out.go:177] โœจ Using the kvm2 driver based on existing profile +I0419 11:52:59.474956 80336 start.go:298] selected driver: kvm2 +I0419 11:52:59.474965 80336 start.go:902] validating driver "kvm2" against &{Name:minikube KeepContext:false EmbedCerts:false MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v1.32.1-amd64.iso KicBaseImage:gcr.io/k8s-minikube/kicbase:v0.0.42@sha256:d35ac07dfda971cabee05e0deca8aeac772f885a5348e1a0c0b0a36db20fcfc0 Memory:6000 CPUs:2 DiskSize:20000 VMDriver: Driver:kvm2 HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] ContainerVolumeMounts:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.59.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false KVMNUMACount:1 APIServerPort:0 DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio SSHIPAddress: SSHUser:root SSHKey: SSHPort:22 KubernetesConfig:{KubernetesVersion:v1.28.3 ClusterName:minikube Namespace:default APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin:cni FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: LoadBalancerStartIP: LoadBalancerEndIP: CustomIngressCert: RegistryAliases: ExtraOptions:[] ShouldLoadCachedImages:true EnableDefaultCNI:false CNI: NodeIP: NodePort:8443 NodeName:} Nodes:[{Name: IP: Port:8443 KubernetesVersion:v1.28.3 ContainerRuntime:docker ControlPlane:true Worker:true}] Addons:map[] CustomAddonImages:map[] CustomAddonRegistries:map[] VerifyComponents:map[apiserver:true system_pods:true] StartHostTimeout:6m0s ScheduledStop: ExposedPorts:[] ListenAddress: Network: Subnet: MultiNodeRequested:false ExtraDisks:0 CertExpiration:26280h0m0s Mount:false MountString:/home/vincent:/minikube-host Mount9PVersion:9p2000.L MountGID:docker MountIP: MountMSize:262144 MountOptions:[] MountPort:0 MountType:9p MountUID:docker BinaryMirror: DisableOptimizations:false DisableMetrics:false CustomQemuFirmwarePath: SocketVMnetClientPath: SocketVMnetPath: StaticIP: SSHAuthSock: SSHAgentPID:0 AutoPauseInterval:1m0s GPUs:} +I0419 11:52:59.475077 80336 start.go:913] status for kvm2: {Installed:true Healthy:true Running:true NeedsImprovement:false Error: Reason: Fix: Doc: Version:} +I0419 11:52:59.476018 80336 install.go:52] acquiring lock: {Name:mk900956b073697a4aa6c80a27c6bb0742a99a53 Clock:{} Delay:500ms Timeout:10m0s Cancel:} +I0419 11:52:59.476141 80336 install.go:117] Validating docker-machine-driver-kvm2, PATH=/home/vincent/.minikube/bin:/nix/store/ig23ki6sl8dlg3lp0k1l9y9x05wrqs4q-patchelf-0.15.0/bin:/nix/store/4kwk49k8rc8cg8c387kbbjcrl8i0y693-gcc-wrapper-13.2.0/bin:/nix/store/nn152mgpdfcw92b3b03g9kmnlpd9jris-gcc-13.2.0/bin:/nix/store/b93lnii942nnkbpkl6smk8dhv0049di8-glibc-2.39-5-bin/bin:/nix/store/asqa3kfq3maclk7cqqhrjvp7vriw6ahy-coreutils-9.5/bin:/nix/store/zfs2gv7x073znw6b250rgnbij300hva5-binutils-wrapper-2.41/bin:/nix/store/vj57s3h2za2qrfccrvc9b6i7s8mw3ndn-binutils-2.41/bin:/nix/store/mayn76rxh2wlndnhi5pn9h0idw59qbs1-attr-2.5.2-bin/bin:/nix/store/5alq06vnw2lc84f5lkjg6zisanbhc51n-libcap-2.69/bin:/nix/store/39nq7p6jcm9m3xqqm99skwmgsqw4pbbg-pkg-config-wrapper-0.29.2/bin:/nix/store/apl2ibxqrxbbj6z79nfgv892999z1zyv-git-2.44.0/bin:/nix/store/sxmad6bc8j8qgqvcc7278fjsrgm89qkc-jq-1.7.1-bin/bin:/nix/store/igc1cay5d5nqlj96vrq2icdxkdby1pay-gnumake-4.4.1/bin:/nix/store/n2ng9hhfwvr480wvv45837hqsivaaqdp-golangci-lint-1.57.2/bin:/nix/store/ap71wavjciyyfqsr7j0dz5b7k36r1w1w-just-1.25.2/bin:/nix/store/9kriq85qac7phcxgpdqbqr25vlr61ifw-go-1.22.2/bin:/nix/store/hcbxzlv6vjd5r9h9f4zdl6p0f3k839ci-rustc-wrapper-1.77.1/bin:/nix/store/4ry19b6xvzqf98fhq8ijk6zpxv13a483-cargo-1.77.1/bin:/nix/store/glfr70gi7hfaj50mwj2431p8bg60fhqw-python3-3.11.9/bin:/nix/store/1s9bdzai4csrc4sb1jy1h9jbwba79gd7-docker-24.0.5/bin:/nix/store/c4msh393irj6hj1bqg921kcd5f3jl7hx-docker-machine-kvm2-1.32.0/bin:/nix/store/qn8aisxpxrp5xvbzs4119hcg5fhaqcrc-kubernetes-1.29.4/bin:/nix/store/fxl58imib4p08zybpih9dixjjmjf17mz-minikube-1.32.0/bin:/nix/store/r39di833mwxizpasd6jfwhldfml585am-dnsmasq-2.90/bin:/nix/store/w1p8slarbj0ii4nasdv8hk7ax50palvf-libvirt-10.0.0/bin:/nix/store/9lhr225i7i5qpsajk5dgbxmjb10v0cdz-qemu-host-cpu-only-8.2.2/bin:/nix/store/lq925g20aksc1sys5q437s78p5svbp2p-bitcoind-27.0/bin:/nix/store/asqa3kfq3maclk7cqqhrjvp7vriw6ahy-coreutils-9.5/bin:/nix/store/vf8cjkgwmgd4sb3vkxh6x9iar71s1w1c-findutils-4.9.0/bin:/nix/store/ql4y72l42lrlbk8b4nbfvnc5m0nlp2kk-diffutils-3.10/bin:/nix/store/ard747zf4fkkkqa0pwj3fxp9fhnyfm7p-gnused-4.9/bin:/nix/store/gbrv0fn9a07kmdw2rg22iybdymylw4qc-gnugrep-3.11/bin:/nix/store/1vh7kczjs90fzxd786s7yikvqr1g2ndn-gawk-5.2.2/bin:/nix/store/zs4ajc6bp81c92fj2l5r2d68ra0hmfbb-gnutar-1.35/bin:/nix/store/3fzv6f2c0vxv1zfw8v7baxh4s8qq8r2x-gzip-1.13/bin:/nix/store/1mr1p83pzbcmwqlj7v3cwkq5lbxyszq2-bzip2-1.0.8-bin/bin:/nix/store/fx2yaklnv3h6jx0p07h1bh4vy618pn9s-gnumake-4.4.1/bin:/nix/store/dy2z01kpnxn7dn2kgfdxs4fm8xy9mb89-bash-5.2p26/bin:/nix/store/jmxc8fdl9iwdj5qdg5mq15hz2adbq1yn-patch-2.7.6/bin:/nix/store/v6cqgpxhbcd4bhwvzh22hvy7s2i9j90z-xz-5.4.6-bin/bin:/nix/store/f3ylr5a5w2cla15j2w66n435vwx65xmq-file-5.45/bin:/home/vincent/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/vincent/.amplify/bin:/home/vincent/.poetry/bin:/home/vincent/.cargo/bin:/home/vincent/.local/bin:/home/vincent/.local/bin:/bin:/usr/bin:/usr/local/bin:/home/vincent/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/vincent/.config/guix/current/bin:/home/vincent/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/vincent/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/home/vincent/.radicle/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/vincent/.radicle/bin:/run/media/vincent/VincentSSD/ToolCaseDevelopement/Bitcoin/bitcoin-23.0/bin/:/run/media/vincent/VincentSSD/ToolCaseDevelopement/Bitcoin/lnd-linux-amd64-v0.9.0-beta-rc1/:/run/media/vincent/VincentSSD/ToolCaseDevelopement/Bitcoin/litecoin-0.17.1/bin:/run/media/vincent/VincentSSD/ToolCaseDevelopement/Bitcoin/dogecoin-1.14.4/bin/:/run/media/vincent/VincentSSD/ToolCaseDevelopment/geth-linux-amd64-1.10.3-991384a7:/home/vincent/Android/Sdk/emulator:/home/vincent/Android/Sdk/tools:/home/vincent/Android/Sdk/tools/bin:/home/vincent/Android/Sdk/platform-tools:/home/vincent/Documents/.flutter/flutter/bin:/home/vincent/.config/emacs/bin:/home/vincent/go/bin:/run/media/vincent/VincentSSD/ToolCaseDevelopement/ocaml:/run/media/vincent/VincentSSD/ToolCaseDevelopement/ocaml:/home/vincent/.pub-cache/bin:/home/vincent/.rvm/bin +I0419 11:52:59.495075 80336 install.go:137] /home/vincent/.minikube/bin/docker-machine-driver-kvm2 version is 1.32.0 +I0419 11:52:59.495786 80336 cni.go:84] Creating CNI manager for "" +I0419 11:52:59.495795 80336 cni.go:158] "kvm2" driver + "docker" container runtime found on kubernetes v1.24+, recommending bridge +I0419 11:52:59.495798 80336 start_flags.go:323] config: +{Name:minikube KeepContext:false EmbedCerts:false MinikubeISO:https://storage.googleapis.com/minikube/iso/minikube-v1.32.1-amd64.iso KicBaseImage:gcr.io/k8s-minikube/kicbase:v0.0.42@sha256:d35ac07dfda971cabee05e0deca8aeac772f885a5348e1a0c0b0a36db20fcfc0 Memory:6000 CPUs:2 DiskSize:20000 VMDriver: Driver:kvm2 HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] ContainerVolumeMounts:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.59.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false KVMNUMACount:1 APIServerPort:0 DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio SSHIPAddress: SSHUser:root SSHKey: SSHPort:22 KubernetesConfig:{KubernetesVersion:v1.28.3 ClusterName:minikube Namespace:default APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin:cni FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: LoadBalancerStartIP: LoadBalancerEndIP: CustomIngressCert: RegistryAliases: ExtraOptions:[] ShouldLoadCachedImages:true EnableDefaultCNI:false CNI: NodeIP: NodePort:8443 NodeName:} Nodes:[{Name: IP: Port:8443 KubernetesVersion:v1.28.3 ContainerRuntime:docker ControlPlane:true Worker:true}] Addons:map[] CustomAddonImages:map[] CustomAddonRegistries:map[] VerifyComponents:map[apiserver:true system_pods:true] StartHostTimeout:6m0s ScheduledStop: ExposedPorts:[] ListenAddress: Network: Subnet: MultiNodeRequested:false ExtraDisks:0 CertExpiration:26280h0m0s Mount:false MountString:/home/vincent:/minikube-host Mount9PVersion:9p2000.L MountGID:docker MountIP: MountMSize:262144 MountOptions:[] MountPort:0 MountType:9p MountUID:docker BinaryMirror: DisableOptimizations:false DisableMetrics:false CustomQemuFirmwarePath: SocketVMnetClientPath: SocketVMnetPath: StaticIP: SSHAuthSock: SSHAgentPID:0 AutoPauseInterval:1m0s GPUs:} +I0419 11:52:59.495895 80336 iso.go:125] acquiring lock: {Name:mkf34c7d1ac7df1c2676eb10ace7fd8e397fa708 Clock:{} Delay:500ms Timeout:10m0s Cancel:} +I0419 11:52:59.497769 80336 out.go:177] ๐Ÿ‘ Starting control plane node minikube in cluster minikube +I0419 11:52:59.498589 80336 preload.go:132] Checking if preload exists for k8s version v1.28.3 and runtime docker +I0419 11:52:59.498608 80336 preload.go:148] Found local preload: /home/vincent/.minikube/cache/preloaded-tarball/preloaded-images-k8s-v18-v1.28.3-docker-overlay2-amd64.tar.lz4 +I0419 11:52:59.498612 80336 cache.go:56] Caching tarball of preloaded images +I0419 11:52:59.498666 80336 preload.go:174] Found /home/vincent/.minikube/cache/preloaded-tarball/preloaded-images-k8s-v18-v1.28.3-docker-overlay2-amd64.tar.lz4 in cache, skipping download +I0419 11:52:59.498672 80336 cache.go:59] Finished verifying existence of preloaded tar for v1.28.3 on docker +I0419 11:52:59.498734 80336 profile.go:148] Saving config to /home/vincent/.minikube/profiles/minikube/config.json ... +I0419 11:52:59.498876 80336 start.go:365] acquiring machines lock for minikube: {Name:mk91c56313479d2e61032bfb122a1f3dbbc28c1a Clock:{} Delay:500ms Timeout:13m0s Cancel:} +I0419 11:52:59.498899 80336 start.go:369] acquired machines lock for "minikube" in 14.489ยตs +I0419 11:52:59.498907 80336 start.go:96] Skipping create...Using existing machine configuration +I0419 11:52:59.498910 80336 fix.go:54] fixHost starting: +I0419 11:52:59.499065 80336 main.go:141] libmachine: Found binary path at /home/vincent/.minikube/bin/docker-machine-driver-kvm2 +I0419 11:52:59.499079 80336 main.go:141] libmachine: Launching plugin server for driver kvm2 +I0419 11:52:59.509635 80336 main.go:141] libmachine: Plugin server listening at address 127.0.0.1:41315 +I0419 11:52:59.509931 80336 main.go:141] libmachine: () Calling .GetVersion +I0419 11:52:59.510210 80336 main.go:141] libmachine: Using API Version 1 +I0419 11:52:59.510216 80336 main.go:141] libmachine: () Calling .SetConfigRaw +I0419 11:52:59.510349 80336 main.go:141] libmachine: () Calling .GetMachineName +I0419 11:52:59.510405 80336 main.go:141] libmachine: (minikube) Calling .DriverName +I0419 11:52:59.510476 80336 main.go:141] libmachine: (minikube) Calling .GetState +I0419 11:52:59.515259 80336 fix.go:102] recreateIfNeeded on minikube: state=Error err=getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +I0419 11:52:59.515272 80336 main.go:141] libmachine: (minikube) Calling .DriverName +I0419 11:52:59.515382 80336 fix.go:107] machineExists: true. err=getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +W0419 11:52:59.515387 80336 fix.go:128] unexpected machine state, will restart: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +I0419 11:52:59.516363 80336 out.go:177] ๐Ÿ”„ Restarting existing kvm2 VM for "minikube" ... +I0419 11:52:59.517196 80336 main.go:141] libmachine: (minikube) Calling .Start +I0419 11:52:59.517332 80336 main.go:141] libmachine: (minikube) Ensuring networks are active... +I0419 11:52:59.521203 80336 main.go:141] libmachine: (minikube) Ensuring network default is active +I0419 11:52:59.756793 80336 fix.go:56] fixHost completed within 257.8697ms +I0419 11:52:59.756818 80336 start.go:83] releasing machines lock for "minikube", held for 257.911354ms +W0419 11:52:59.756843 80336 start.go:691] error starting host: driver start: ensuring active networks: starting network default: virError(Code=38, Domain=19, Message='Unable to find 'dnsmasq' binary in $PATH: No such file or directory') +W0419 11:52:59.756944 80336 out.go:239] ๐Ÿคฆ StartHost failed, but will try again: driver start: ensuring active networks: starting network default: virError(Code=38, Domain=19, Message='Unable to find 'dnsmasq' binary in $PATH: No such file or directory') +I0419 11:52:59.756985 80336 start.go:706] Will try again in 5 seconds ... +I0419 11:53:04.757435 80336 start.go:365] acquiring machines lock for minikube: {Name:mk91c56313479d2e61032bfb122a1f3dbbc28c1a Clock:{} Delay:500ms Timeout:13m0s Cancel:} +I0419 11:53:04.757610 80336 start.go:369] acquired machines lock for "minikube" in 126.401ยตs +I0419 11:53:04.757651 80336 start.go:96] Skipping create...Using existing machine configuration +I0419 11:53:04.757661 80336 fix.go:54] fixHost starting: +I0419 11:53:04.758366 80336 main.go:141] libmachine: Found binary path at /home/vincent/.minikube/bin/docker-machine-driver-kvm2 +I0419 11:53:04.758423 80336 main.go:141] libmachine: Launching plugin server for driver kvm2 +I0419 11:53:04.774628 80336 main.go:141] libmachine: Plugin server listening at address 127.0.0.1:33197 +I0419 11:53:04.775048 80336 main.go:141] libmachine: () Calling .GetVersion +I0419 11:53:04.775583 80336 main.go:141] libmachine: Using API Version 1 +I0419 11:53:04.775597 80336 main.go:141] libmachine: () Calling .SetConfigRaw +I0419 11:53:04.775914 80336 main.go:141] libmachine: () Calling .GetMachineName +I0419 11:53:04.776139 80336 main.go:141] libmachine: (minikube) Calling .DriverName +I0419 11:53:04.776262 80336 main.go:141] libmachine: (minikube) Calling .GetState +I0419 11:53:04.786106 80336 fix.go:102] recreateIfNeeded on minikube: state=Error err=getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +I0419 11:53:04.786128 80336 main.go:141] libmachine: (minikube) Calling .DriverName +I0419 11:53:04.786308 80336 fix.go:107] machineExists: true. err=getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +W0419 11:53:04.786324 80336 fix.go:128] unexpected machine state, will restart: getting connection: looking up domain: virError(Code=42, Domain=10, Message='Domain not found: no domain with matching name 'minikube'') +I0419 11:53:04.796951 80336 out.go:177] ๐Ÿ”„ Restarting existing kvm2 VM for "minikube" ... +I0419 11:53:04.800675 80336 main.go:141] libmachine: (minikube) Calling .Start +I0419 11:53:04.801078 80336 main.go:141] libmachine: (minikube) Ensuring networks are active... +I0419 11:53:04.812395 80336 main.go:141] libmachine: (minikube) Ensuring network default is active +I0419 11:53:05.039313 80336 fix.go:56] fixHost completed within 281.643302ms +I0419 11:53:05.039338 80336 start.go:83] releasing machines lock for "minikube", held for 281.713167ms +W0419 11:53:05.039466 80336 out.go:239] ๐Ÿ˜ฟ Failed to start kvm2 VM. Running "minikube delete" may fix it: driver start: ensuring active networks: starting network default: virError(Code=38, Domain=19, Message='Unable to find 'dnsmasq' binary in $PATH: No such file or directory') +I0419 11:53:05.050239 80336 out.go:177] +W0419 11:53:05.053868 80336 out.go:239] โŒ Exiting due to GUEST_PROVISION: error provisioning guest: Failed to start host: driver start: ensuring active networks: starting network default: virError(Code=38, Domain=19, Message='Unable to find 'dnsmasq' binary in $PATH: No such file or directory') +W0419 11:53:05.053930 80336 out.go:239] +W0419 11:53:05.055531 80336 out.go:239] โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ +โ”‚ โ”‚ +โ”‚ ๐Ÿ˜ฟ If the above advice does not help, please let us know: โ”‚ +โ”‚ ๐Ÿ‘‰ https://github.com/kubernetes/minikube/issues/new/choose โ”‚ +โ”‚ โ”‚ +โ”‚ Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue. โ”‚ +โ”‚ โ”‚ +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ +I0419 11:53:05.059975 80336 out.go:177] + +* diff --git a/templates/golang/Makefile b/templates/golang/Makefile new file mode 100644 index 0000000..1ba2559 --- /dev/null +++ b/templates/golang/Makefile @@ -0,0 +1,39 @@ +## +# Project Title +# +# @file +# @version 0.1 +CC=go +FMT=gofmt +NAME=cln-splice +BASE_DIR=/script +OS=linux +ARCH=386 +ARM= +GORPC_COMMIT=4471a927bb9937a45a9ece876c3e00f093727fc3 +NAME=attach + +default: fmt lint + $(CC) build -o $(NAME) main.go + +fmt: + $(CC) fmt ./... + +lint: + golangci-lint run + +check: + $(CC) test -v ./... + +build: + $(CC) build -o $(NAME) main.go + +dep: + $(CC) mod vendor + +force: + $(CC) get -u all + @make dep + +clean: + cd cln-integration; make clean diff --git a/templates/golang/attack.go b/templates/golang/attack.go new file mode 100644 index 0000000..50eb96b --- /dev/null +++ b/templates/golang/attack.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func Attack() error { + return fmt.Errorf("TODO: need to be implement") +} diff --git a/templates/golang/bitcoin.go b/templates/golang/bitcoin.go index 21717b1..5db05ff 100644 --- a/templates/golang/bitcoin.go +++ b/templates/golang/bitcoin.go @@ -8,12 +8,12 @@ import ( // Mine n blocks using bitcoin cli. func Mine(n int) error { - // Santiy check for fat fingering to stop us setting our laptops on - // fire, can be removed. - if n > 1000{ - return fmt.Errorf("trying to mine: %v blocks failed "+ - "santiy check", n) - } + // Santiy check for fat fingering to stop us setting our laptops on + // fire, can be removed. + if n > 1000 { + return fmt.Errorf("trying to mine: %v blocks failed "+ + "santiy check", n) + } cmd := exec.Command("bitcoin-cli", "-generate", strconv.Itoa(n)) diff --git a/templates/golang/graph.go b/templates/golang/graph.go index a2e17eb..dad42e7 100644 --- a/templates/golang/graph.go +++ b/templates/golang/graph.go @@ -249,8 +249,5 @@ func (c *GraphHarness) CloseAllChannels(ctx context.Context, node int) error { } - Mine(6) - - return nil - + return Mine(6) } diff --git a/templates/golang/main.go b/templates/golang/main.go index fa45968..ea483bf 100644 --- a/templates/golang/main.go +++ b/templates/golang/main.go @@ -35,19 +35,24 @@ func main() { LndNodes: lnds, } + // HERE your script. + if err := Attack(); err != nil { + fmt.Printf("Error while attaching the network %s", err) + os.Exit(1) + } fmt.Println("Cleaning up opened channels for all nodes") - if err:=graph.CloseAllChannels(ctx, 0); err!=nil{ + if err := graph.CloseAllChannels(ctx, 0); err != nil { fmt.Printf("Could not clean up node 0: %v\n", err) os.Exit(1) } - if err:=graph.CloseAllChannels(ctx, 1); err!=nil{ + if err := graph.CloseAllChannels(ctx, 1); err != nil { fmt.Printf("Could not clean up node 1: %v\n", err) os.Exit(1) } - if err:=graph.CloseAllChannels(ctx, 2); err!=nil{ + if err := graph.CloseAllChannels(ctx, 2); err != nil { fmt.Printf("Could not clean up node q: %v\n", err) os.Exit(1) }