Repository: alessandrokonrad/Pi-Pool Branch: master Commit: 678a70f29f24 Files: 30 Total size: 114.0 MB Directory structure: gitextract_mqna29zo/ ├── Crossbuilding.md ├── FullGuideDeprecated.md ├── README.md ├── ReadMeDeprecated.md ├── aarch64/ │ ├── cabal3.0/ │ │ └── cabal │ └── cabal3.2/ │ └── cabal ├── meta/ │ ├── extended_poolmeta.json │ ├── poolmeta.json │ └── poolmeta_v2.json ├── monitoring/ │ └── grafana-dashboard.json └── scripts/ ├── cardano-scripts/ │ ├── createPool │ ├── createWallet │ ├── decryptPool │ ├── decryptWallet │ ├── encryptPool │ ├── encryptWallet │ ├── modifyPool │ ├── registerPool │ ├── registerWallet │ ├── send │ ├── updateKES │ ├── wallet │ └── withdraw ├── fullGuide/ │ ├── 999_decompress_rpi_kernel │ ├── auto_decompress_kernel │ ├── installCardano.sh │ └── start.sh └── nodes/ ├── show-nodes ├── start-nodes └── stop-nodes ================================================ FILE CONTENTS ================================================ ================================================ FILE: Crossbuilding.md ================================================ ## Cross-building Make sure you have the Haskell platform installed (sudo apt install haskell-platform). You also need to do this on a aarch64/arm64 machine or simply on your Raspberry Pi.
We will build Cabal 3.0 in this tutorial, but you can choose any version you need. ``` wget http://hackage.haskell.org/package/cabal-install-3.0.0.0/cabal-install-3.0.0.0.tar.gz tar -xf cabal-install-3.0.0.0.tar.gz cd cabal-install-3.0.0.0 cabal update cabal install --installdir=$HOME/.local/bin ``` This could take some time. Now check with cabal --version your version. ================================================ FILE: FullGuideDeprecated.md ================================================ # How to setup the Cardano Node on Raspberry Pi 4 (Full Guide) ## Prerequesites - Raspberry Pi 4 8GB RAM - SSD (at least 240GB) - microSD Card (at least 1GB) - microSD Card Reader - Eluteng SATA USB 3.0 Adapter - microHDMI to HDMI Adapter - Keyboard and Monitor (or use SSH instead) - LAN connection ## 1. Upgrading Bootloader In order to boot the Raspberry Pi from the SSD, we need to upgrade the bootloader firmware of the Pi. Normally the Pi can just boot from the microSD card slot. We want to run the Pi on SSD because performance and speed is much higher. Also it's much more reliable, because a microSD card is not meant for a lot of read and write actions. These are the steps you need to take: 1. Download Pi Imager and install it. 2. Insert the microSD Card in the Card Reader and plug it in your PC. 3. Open Pi Imager and click "Choose OS" -> Raspberry Pi OS (other) -> Raspberry Pi OS Lite (32-bit) 4. Click on "Choose SD Card" and select the microSD Card 5. Click "Write" and wait until finished 6. Now remove the microSD Card from the PC and plug it into the Pi 7. Connect a monitor and plugin the keyboard in a USB 2.0 slot (the left ones), also make sure to connect the LAN cabel 8. Connect the power adapter and now the Pi should turn on and boot. 9. Just wait until you are at the login screen: - Username: pi - Password: raspberry 10. Enter the following commands to update the distribution: ``` sudo apt update sudo apt full-upgrade ``` 11. In order to receive the latest firmware updates edit the file: ``` sudo nano /etc/default/rpi-eeprom-update ``` 12. Change FIRMWARE_RELEASE_STATUS from "critical" to "stable". Press CTRL + X, then press Y and then Enter to confirm and leave. 13. Now enter the following command in order to upgrade the bootloader: ``` sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-07-31.bin ``` 14. Now you can shutdown/turn off the Pi. The new Bootloader is activated and we can boot from SSD! ## 2. Preparing Ubuntu 1. Insert the SSD together with the Eluteng Adapter in your PC. 2. Open Pi Imager again and click on "Choose OS" -> Ubuntu -> Ubuntu 20.04.1 LTS (Raspberry Pi 3/4). The 64-bit version! 3. Click on "Choose SD Card" and select the SSD 4. Click "Write" and wait until finished 5. You should now have two partitions on your SSD looking like this: 6. For the following it's important to have access to Linux commands on your PC (Windows users can use WSL):
1. Go in the system-boot partition of your SSD and open up a terminal inside (Right Click --> Open Terminal). Run this command: ``` zcat vmlinuz > vmlinux ``` 2. Now open the config.txt file and replace the [pi4] section with this: ``` [pi4] max_framebuffers=2 dtoverlay=vc4-fkms-v3d boot_delay kernel=vmlinux initramfs initrd.img followkernel ``` 3. Now run this command, also from system-boot partition: ``` wget https://raw.githubusercontent.com/alessandrokonrad/Pi-Pool/master/scripts/fullGuide/auto_decompress_kernel sudo chmod +x auto_decompress_kernel ``` 4. Now go in the writable partition and go to /ect/apt/apt.conf.d/ and open up a new terminal inside: ``` wget https://raw.githubusercontent.com/alessandrokonrad/Pi-Pool/master/scripts/fullGuide/999_decompress_rpi_kernel sudo chmod +x 999_decompress_rpi_kernel ``` 7. Unplug the SSD from the PC and insert it into one of the USB 3.0 ports (the right ones) of the Pi. (You can remove the SD Card from the Pi, if it's still inserted) 8. Turn on the Pi and wait until you are at the login screen again: - Username: ubuntu - Password: ubuntu 9. Now you will be prompted to change password. Afterwards you should be successfully logged in your Ubuntu distribution! For more information on how to run Ubuntu on SSD, check out this forum post. ## 3. Installing Cardano node 1. Download the start.sh script and execute it. This script will install all necessary dependencies for the Cardano node: ``` wget https://raw.githubusercontent.com/alessandrokonrad/Pi-Pool/master/scripts/fullGuide/start.sh chmod +x start.sh ./start.sh ``` 2. Install cardano-node and cardano-cli: ``` wget https://raw.githubusercontent.com/alessandrokonrad/Pi-Pool/master/scripts/fullGuide/installCardano.sh chmod +x installCardano.sh ./installCardano.sh ``` ================================================ FILE: README.md ================================================

# Berry Pool Berry is a Cardano Stakepool on Raspberry Pi. Check out my website to see more about my stakepool. You can support me by just delegating to my pool.
This repository is a guide to setup a stakepool on a Raspberry Pi by your own. ## Why this guide Basically we have two different popular CPU architectures. Let's only consider 64-bit machines. Many of you know Intel and AMD. They primarily build their CPUs on a x86_64 architecture. Then there is ARM, which CPUs are built on the so called aarch64 architecture, and our Raspberry Pi has an aarch64 CPU. I don't want to dive any deeper in that, but the problem is, that the Cardano-Node setup is made for x86_64 machines and currently doesn't support aarch64 out of the box. The goal of this repository is to make it as easy as possible to run a Cardano-Node on Raspberry Pi. ## Prerequesites - Raspberry Pi 4 4GB RAM or 8GB RAM (recommended) - SSD (at least 20GB) - microSD Card (needed to upgrade the bootloader) - SATA USB 3.0 Adapter (list of working adapters) ## Getting started ### Note Cardano-Node version 1.27.0 has been released! This image comes with 1.23.0, so you should directly update the node after installing the image. 1.23.0 can't connect with the network anymore since December 2020. Download 1.27.0 here Scroll down to "Updating the Cardano-Node" if you don't know how to update the node version. Changes needed: Remove "ChainDB" from all metrics in Grafana, so that it can be displayed correctly again. E.g.: cardano_node_ChainDB_metrics_epoch_int -> cardano_node_metrics_epoch_int Full Release Notes ## ### Upgrading the Bootloader If your Pi already boots from SSD (recently shipped Pi 4 have USB Booting already flashed on) you can skip this section. 1. Download Pi Imager and install it 2. Insert the microSD Card in a Card Reader and plug it in your PC 3. Open Pi Imager and click "Choose OS" -> Misc utility images -> Raspberry Pi 4 EEPROM boot recovery 4. Click on "Choose SD Card" and select the microSD Card 5. Click "Write" and wait until finished 6. Now remove the microSD Card from the PC and plug it into the Pi 7. Connect a monitor to the Pi and turn it on 8. If you screen shows a green color, the bootloader had been successfully updated! 9. Remove the microSD from the Pi ### Install the Image 1. Download the latest release 2. Plug in the SSD in your PC 3. Open Pi Imager and scroll down to "Use custom", select the downloaded release 4. Click on "Choose SD Card" and select the SSD 5. Click "Write" and wait until finished 6. You can now connect the SSD with the Pi and turn it on. ### Running the Image These are the login credentials: Username:ada
Password:lovelace If you want to change the password, you can do this with passwd ### Running a Cardano-Node: A sample node configuration folder is already preinstalled. To reproduce: ``` mkdir pi-node cd pi-node wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-byron-genesis.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-shelley-genesis.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-topology.json ``` ### Starting a Cardano-Node: ``` cd pi-node cardano-node run \ --topology mainnet-topology.json \ --database-path db \ --socket-path db/socket \ --host-addr 0.0.0.0 \ --port 3000 \ --config mainnet-config.json ``` That's it. Your node is now starting to sync! ### Monitoring If you want to monitor your node, you can do this with the command startMonitor. You can access another instance of terminal by pressing alt+F2-F12 buttons. alt+F1 should take you back to the running node. This will create a Grafana instance at port 5000. A custom dashboard is also already preinstalled. You can find it in the left panel under Dashboard -> Manage. You should find a Dashboard called "Raspberry Pi Node". To connect to it find your ip addresss by typing: ip a In your browser type your ip address and the port number: XXX.XXX.X.X:5000 Default Credentials are:
Username: admin
Password: admin The whole monitoring configuration you can find under /opt/cardano/monitoring Use stopMonitor to stop the monitoring process. ### Updating the Cardano-Node Currently there is no auto updater built in the Image. In order to update the version, this needs to be done manually. To get the latest Cardano-Node version, join this Telgram group or check in the Getting started section under Note, if there is something new. Download it and replace the new binaries with the current ones under ~/.local/bin (cardano-node and cardano-cli) Redownload the the config file:
``` wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json ```
Change the following parameters in the config file: ``` ... "TraceBlockFetchDecisions": true, ... "hasEKG": 12600, "hasPrometheus": [ "127.0.0.1", 12700 ], ... ``` ## Setup a Stake Pool I can recommend CNTools (make sure the CNTools version is compatible with the Cardano-Node version). The guide of CoinCashew is also really helpful. Otherwise I would follow the official guide of cardano.org For JavaScript enthusiasts this could be helpful: cardanocli-js ## Port forwarding Go to your router settings. You can access them via your browser with the IP address of the router (e.g. 192.168.178.1 or if you have a FritzBox with fritz.box). Then look for an option "Port Forwarding". Choose the IP address of your node(s) and open its/their port(s). Allow TCP. Then save it and that's it. ================================================ FILE: ReadMeDeprecated.md ================================================

# Berry Pool Berry is a Cardano Stakepool on Raspberry Pi. Check out my website to see more about my stakepool. You can support me by just delegating to my pool.
This repository is a guide to setup a stakepool on a Raspberry Pi by your own. ## Why this guide Basically we have two different popular CPU architectures. Let's only consider 64-bit machines. Many of you know Intel and AMD. They primarily build their CPUs on a x86_64 architecture. Then there is ARM, which CPUs are built on the so called aarch64 architecture, and our Raspberry Pi has an aarch64 CPU. I don't want to dive any deeper in that, but the problem is, that the Cardano-Node setup is made for x86_64 machines and currently doesn't support aarch64 out of the box. The goal of this repository is to make it as easy as possible to run a Cardano-Node on Raspberry Pi. ## Prerequesites - Raspberry Pi 4 with 8GB RAM (4GB version works only with Swap partition as extra RAM) - Ubuntu 20.04 LTS 64-bit (Very easy to install with Pi Imager. For running Ubuntu on SSD, check below) ## Getting started ## Note IOG is currently improving the performance of the Cardano Node on ARM devices. Join this group to find out more. I wouldn't recommend you building the node with the GHC 8.6.5 compiler for ARM any longer, like in this guide. This guide is for the Cardano mainnet! #### 1. First of all let's update and upgrade our Ubuntu: ``` sudo apt-get update sudo apt-get upgrade ``` You might reboot your Pi afterwards. #### 2. Install necessary dependencies: ``` sudo apt-get install libsodium-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 llvm -y ``` #### 3. Get the Haskell platform: ``` wget https://downloads.haskell.org/ghc/8.6.5/ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz tar -xf ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz rm ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz cd ghc-8.6.5/ ./configure sudo make install cd ../ rm -r ghc-8.6.5/ ``` Now you should have GHC 8.6.5. You can check that with ghc --version. #### 4. Get Cabal 3.2: ``` wget https://github.com/alessandrokonrad/Pi-Pool/raw/master/aarch64/cabal3.2/cabal chmod +x cabal mkdir -p ~/.local/bin mv cabal ~/.local/bin ``` You can also build your own Cabal binary for aarch64. Look here. #### 5. Add the new Cabal to PATH: Open the .bashrc file in your home directory and add at the bottom: ``` export PATH="~/.local/bin:$PATH" ``` To make the the new PATH active you can either reboot the Pi or type source .bashrc from your home directory. Then run: ``` cabal update ```
Now we are ready to build the Cardano-Node! #### 6. Clone the cardano-node repository from GitHub and build it (this takes a while): ``` git clone https://github.com/input-output-hk/cardano-node.git cd cardano-node echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local git fetch --all --tags git checkout tags/1.21.1 cabal build all cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-1.21.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/ cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-1.21.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/ ``` Finally we have our node. If everything worked fine, you should be able to type cardano-cli and cardano-node. #### 7. Running a node: We need first of all some configuration files: ``` mkdir pi-node cd pi-node wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-byron-genesis.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-shelley-genesis.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-topology.json ``` You can change "ViewMode" from "SimpleView to "LiveView" in mainnet-config.json to get a fancy node monitor.
Now start the node: ``` cardano-node run \ --topology mainnet-topology.json \ --database-path db \ --socket-path db/socket \ --host-addr 0.0.0.0 \ --port 3000 \ --config mainnet-config.json ``` That's it. Your node is now starting to sync! Note: The syncing process for the mainnet blockchain can take really long. My node also crashed sometimes during the syncing process. Having a backup machine (x86_64) where you sync the node and just copy the db on the Raspberry Pi, makes it much easier and faster. As soon as the Pi is in sync it runs really smooth and just uses about 5% of the CPU. ## Update the node If a new version is released, you can update your installed node with the following commands (replace `` with the latest version number): ``` cd cardano-node git fetch --all --tags git checkout tags/ cabal update cabal build all cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/ cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/ ``` ## Setup a stakepool I might create a detailed guide soon, on how to register a stakepool. Anyway there are plenty tutorials out there:
I can recommend CNTools (make sure the CNTools version is compatible with the Cardano-Node version).
Otherwise I would follow the official guide of cardano.org ## Run Ubuntu on a SSD #### Running Ubuntu from SSD, while booting from SD card: 1. Flash the Ubuntu image on your SSD and your SD card. 2. Now go to to the boot partition of the SD card and change in cmdline.txt the root path to: root=/dev/sda2 3. Insert the SD card into the Pi and the SSD into one of the USB 3.0 ports. This should boot now from the SD card, but the OS will run on the SSD then. #### Running and booting from SSD (no need for SD card): You can check that out: Directly boot from SSD #### Problems with running Ubuntu from USB 3.0: Adding quirks to your chipset, if it's not working ## Cross-building If you want to build your own Cabal binary for aarch64 or a different version of Cabal, follow this guide. ## Port forwarding Go to your router settings. You can access them via your browser with the IP address of the router (e.g. 192.168.178.1 or if you have a FritzBox with fritz.box). Then look for a option Port Forwarding. Choose the IP address of your relay node(s) and open its/their port(s). Allow TCP and UDP. Then save it and that's it. ================================================ FILE: aarch64/cabal3.0/cabal ================================================ [File too large to display: 32.9 MB] ================================================ FILE: aarch64/cabal3.2/cabal ================================================ [File too large to display: 81.0 MB] ================================================ FILE: meta/extended_poolmeta.json ================================================ { "info": { "url_png_icon_64x64": "https://github.com/alessandrokonrad/Pi-Pool/raw/master/images/logo64_64.png", "url_png_logo": "https://github.com/alessandrokonrad/Pi-Pool/raw/master/images/logo.png", "location": "Munich, Germany", "social": { "twitter_handle": "berry_ales", "telegram_handle": "berry_pool", "github_handle": "alessandrokonrad" }, "about": { "me": "My name is Alessandro, I'm a single pool operator and a computer science student from Germany.", "server": "Berry is the first Stake Pool on Raspberry Pis and it's operational since the first day of Shelley. Here to truly decentralize Cardano in a power efficient way!" } }, "my-pool-ids": { "0": "2a748e3885f6f73320ad16a8331247b81fe01b8d39f57eec9caa5091" }, "telegram-admin-handle": { "0": "berry_ales" } } ================================================ FILE: meta/poolmeta.json ================================================ { "name": "Berry", "ticker": "BERRY", "description": "Decentralizing Cardano in the most beautiful way - Let's shape the future together!", "homepage": "https://pipool.online", "extended": "https://github.com/alessandrokonrad/Pi-Pool/raw/master/meta/extended_poolmeta.json" } ================================================ FILE: meta/poolmeta_v2.json ================================================ { "name": "Berry", "ticker": "BERRY", "description": "Decentralizing Cardano in the most beautiful way - Let's shape the future together!", "homepage": "https://berrypool.io", "extended": "https://github.com/alessandrokonrad/Pi-Pool/raw/master/meta/extended_poolmeta.json" } ================================================ FILE: monitoring/grafana-dashboard.json ================================================ { "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": null, "graphTooltip": 0, "id": 2, "links": [], "panels": [ { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "noValue": "[BERRY] Pi Pool", "thresholds": { "mode": "absolute", "steps": [ { "color": "dark-purple", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 2, "w": 8, "x": 0, "y": 0 }, "id": 65, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "", "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "", "type": "stat" }, { "datasource": null, "fieldConfig": { "defaults": { "custom": { "align": null }, "mappings": [], "max": 8035200, "min": 0, "thresholds": { "mode": "percentage", "steps": [ { "color": "light-red", "value": null }, { "color": "semi-dark-purple", "value": 30 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 3, "w": 8, "x": 8, "y": 0 }, "id": 69, "options": { "displayMode": "gradient", "orientation": "horizontal", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, "showUnfilled": true }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_Forge_metrics_remainingKESPeriods_int * 129600", "instant": true, "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "KES Expiry", "type": "bargauge" }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": null, "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 0 }, "hiddenSeries": false, "id": 67, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_BlockFetchDecision_peers_connectedPeers_int{alias=\"Pi-Relay\"}", "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Connected Peers", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "semi-dark-purple", "value": null }, { "color": "light-red", "value": 80 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 0, "y": 2 }, "id": 59, "options": { "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "7.0.3", "targets": [ { "expr": "100 - (avg by(alias) (irate(node_cpu_seconds_total{mode=\"idle\"}[1m])) * 100)", "instant": true, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "CPU Load", "type": "gauge" }, { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "dark-purple", "value": null }, { "color": "light-red", "value": 80 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 2 }, "id": 61, "options": { "displayMode": "lcd", "orientation": "horizontal", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, "showUnfilled": true }, "pluginVersion": "7.0.3", "targets": [ { "expr": "(1 - (node_memory_MemAvailable_bytes / (node_memory_MemTotal_bytes)))* 100", "instant": true, "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Memory Utilization", "type": "bargauge" }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "semi-dark-purple", "relay": "light-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 3 }, "hiddenSeries": false, "id": 57, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_metrics_txsInMempool_int", "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Mempool Transactions", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "datasource": null, "fieldConfig": { "defaults": { "custom": { "align": null }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "semi-dark-purple", "value": null }, { "color": "light-red", "value": 80 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 4 }, "id": 63, "options": { "displayMode": "lcd", "orientation": "horizontal", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, "showUnfilled": true }, "pluginVersion": "7.0.3", "targets": [ { "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=\"/\",fstype!=\"rootfs\"} * 100) / node_filesystem_size_bytes{mountpoint=\"/\",fstype!=\"rootfs\"})", "instant": false, "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Disk Utilization", "type": "bargauge" }, { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 }, { "color": "semi-dark-purple", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 2, "w": 8, "x": 0, "y": 6 }, "id": 55, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_metrics_Forge_forged_int / cardano_node_metrics_Forge_node_is_leader_int * 100", "instant": false, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Pool Performance", "type": "stat" }, { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "semi-dark-yellow", "value": null }, { "color": "light-yellow", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 8 }, "id": 51, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_metrics_Forge_forged_int", "instant": false, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Blocks Forged", "type": "stat" }, { "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "semi-dark-yellow", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 8 }, "id": 53, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_metrics_Forge_node_is_leader_int", "instant": false, "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Blocks Assigned", "type": "stat" }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 8 }, "hiddenSeries": false, "id": 18, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_ChainDB_metrics_density_real * 100", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "cardano_node_metrics_ChainDB_density_real * 100", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Chain Density", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "light-blue", "value": null }, { "color": "light-blue", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 10 }, "id": 47, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_ChainDB_metrics_epoch_int{alias=\"Pi-Core\"}", "instant": true, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Epoch", "transformations": [], "type": "stat" }, { "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "light-blue", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 10 }, "id": 49, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false } }, "pluginVersion": "7.0.3", "targets": [ { "expr": "cardano_node_ChainDB_metrics_slotInEpoch_int{alias=\"Pi-Core\"}", "instant": true, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Slot", "transformations": [], "type": "stat" }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 11 }, "hiddenSeries": false, "id": 2, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_ChainDB_metrics_slotNum_int", "hide": false, "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "cardano_node_metrics_ChainDB_slotNum_int", "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Slot Height", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 12 }, "hiddenSeries": false, "id": 5, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_ChainDB_metrics_blockNum_int", "legendFormat": "{{alias}}", "refId": "C" }, { "expr": "cardano_node_metrics_ChainDB_blockNum_int", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "cardano_byron_proxy_ChainDB_blockNum_int", "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Last Block Height", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 16 }, "hiddenSeries": false, "id": 41, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_metrics_Forge_forged_int - cardano_node_metrics_Forge_adopted_int", "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Rejected blocks since last restart", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 0, "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "decimals": 5, "description": "", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 19 }, "hiddenSeries": false, "id": 39, "interval": "20s", "legend": { "alignAsTable": true, "avg": true, "current": false, "max": false, "min": false, "rightSide": true, "show": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "rate(cardano_node_metrics_Forge_node_is_leader_int[710s])/rate(cardano_node_metrics_Forge_forge_about_to_lead_int[710s])", "instant": false, "intervalFactor": 1, "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "sum(rate(cardano_node_metrics_Forge_node_is_leader_int[710s])/rate(cardano_node_metrics_Forge_forge_about_to_lead_int[710s]))", "legendFormat": "Total led slots", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Slot leading share (% of slots led)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 1, "format": "percentunit", "label": "", "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 20 }, "hiddenSeries": false, "id": 3, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_ChainDB_metrics_epoch_int", "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "cardano_node_metrics_ChainDB_epoch_int", "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Last Block Epoch", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 24 }, "hiddenSeries": false, "id": 28, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "rate(cardano_node_ChainDB_metrics_blockNum_int[150s])*60", "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "rate(cardano_node_metrics_ChainDB_blockNum_int[150s])*60", "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Block sync speed (blocks / min)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "block-producing": "dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 27 }, "hiddenSeries": false, "id": 43, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "1/rate(cardano_node_metrics_Forge_forge_about_to_lead_int[710s])", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Slot length", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 3, "format": "s", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 28 }, "hiddenSeries": false, "id": 19, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "cardano_node_ChainDB_metrics_slotInEpoch_int", "legendFormat": "{{alias}}", "refId": "A" }, { "expr": "cardano_node_metrics_ChainDB_slotInEpoch_int", "legendFormat": "{{alias}}", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Last Block Slot", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 32 }, "hiddenSeries": false, "id": 16, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "node_filefd_allocated", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "File Descriptors", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 35 }, "hiddenSeries": false, "id": 37, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "rts_gc_current_bytes_used/(1024*1024)", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node current \"residency\" (amount of live data, MBytes)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 36 }, "hiddenSeries": false, "id": 30, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "(cardano_node_metrics_Stat_rss_int*4096)/(1024*1026)", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node RSS (allocated memory in RAM, in MB)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "1h Cluster Data Received, bytes": "dark-purple", "1h Cluster Data Transmitted, bytes": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "/", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 40 }, "hiddenSeries": false, "id": 25, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "sum(rate(node_network_receive_bytes_total{alias!~\"monitoring.*\",device!~\"lo\"}[1h])) * 3600", "legendFormat": "1h Cluster Data Received, bytes", "refId": "A" }, { "expr": "sum(rate(node_network_transmit_bytes_total{alias!~\"monitoring.*\",device!~\"lo\"}[1h])) * 3600", "hide": false, "legendFormat": "1h Cluster Data Transmitted, bytes", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cluster Aggregate Data Transfer, 1 hr Rolling Window", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": null, "format": "decbytes", "label": "", "logBase": 1, "max": null, "min": null, "show": true }, { "decimals": null, "format": "short", "label": "", "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "Counts memory that is free as well as reclaimable from caches and buffers", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 43 }, "hiddenSeries": false, "id": 23, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "node_memory_MemAvailable_bytes{alias!~\"monitoring.*\"} / node_memory_MemTotal_bytes{alias!~\"monitoring.*\"} * 100", "hide": false, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node Memory Available (%)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 44 }, "hiddenSeries": false, "id": 17, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "100 - (avg by(alias) (irate(node_cpu_seconds_total{mode=\"idle\"}[1m])) * 100)", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "CPU Utilization (1m avg)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "Shows how many times cardano related services have been restarted within a 1 hour lookback window", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 48 }, "hiddenSeries": false, "id": 35, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "round(increase(node_systemd_unit_state{name=~\"cardano.*|byron.*|explorer.*\",state=\"active\"}[1h:10s])) > 0", "hide": false, "interval": "", "legendFormat": "{{alias}}-{{name}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cardano Service Restarts Per Hour", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 51 }, "hiddenSeries": false, "id": 32, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "rts_gc_max_bytes_used/(1024*1024)", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node max \"residency\" (amount of live data, MBytes)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 52 }, "hiddenSeries": false, "id": 26, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "(time()-node_boot_time_seconds)", "hide": false, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node Uptime", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "s", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Aggregate cluster egress (transmit)": "semi-dark-purple", "Aggregate cluster ingress (received)": "dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "20 second rolling time average", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 56 }, "hiddenSeries": false, "id": 22, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "sum(rate(node_network_receive_bytes_total{alias!~\"monitoring.*\",device!~\"lo\"}[20s])) * 8", "legendFormat": "Aggregate cluster ingress (received)", "refId": "A" }, { "expr": "sum(rate(node_network_transmit_bytes_total{alias!~\"monitoring.*\",device!~\"lo\"}[20s]) * -8)", "legendFormat": "Aggregate cluster egress (transmit)", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cluster Aggregate Bandwidth (bps)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": null, "format": "decbits", "label": "", "logBase": 1, "max": null, "min": null, "show": true }, { "decimals": null, "format": "short", "label": "", "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Pi-Core": "semi-dark-purple", "Pi-Relay": "light-purple", "block-producing": "dark-purple", "relay": "semi-dark-purple" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "Counts only memory that is physically free", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 59 }, "hiddenSeries": false, "id": 34, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "rts_gc_peak_megabytes_allocated", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node peak memory allocated (from OS, in MBytes)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "prometheus", "description": "Counts memory that is free as well as reclaimable from caches and buffers", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 60 }, "hiddenSeries": false, "id": 24, "interval": "", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "node_memory_MemFree_bytes{alias!~\"monitoring.*\"} / node_memory_MemTotal_bytes{alias!~\"monitoring.*\"} * 100", "hide": false, "interval": "", "legendFormat": "{{alias}}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Node Memory Free (%)", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } } ], "refresh": "30s", "schemaVersion": 25, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-12h", "to": "now" }, "timepicker": { "refresh_intervals": [ "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] }, "timezone": "", "title": "Pi Pool", "uid": "pi-node", "version": 29 } ================================================ FILE: scripts/cardano-scripts/createPool ================================================ #!/bin/bash POOL_PATH="$HOME/priv/pool/$1" TMP="/opt/cardano/tmp" mkdir -p "$POOL_PATH" cardano-cli shelley node key-gen-KES \ --verification-key-file "$POOL_PATH/$1.kes.vkey" \ --signing-key-file "$POOL_PATH/$1.kes.skey" cardano-cli shelley node key-gen \ --cold-verification-key-file "$POOL_PATH/$1.node.vkey" \ --cold-signing-key-file "$POOL_PATH/$1.node.skey" \ --operational-certificate-issue-counter "$POOL_PATH/$1.node.counter" slotsPerKESPeriod=$(cat "$RELAY/files/mainnet-shelley-genesis.json" | jq -r '.slotsPerKESPeriod') echo slotsPerKESPeriod: "${slotsPerKESPeriod}" slotNo=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo slotNo: "${slotNo}" kesPeriod=$((${slotNo} / ${slotsPerKESPeriod})) echo kesPeriod: "${kesPeriod}" cardano-cli shelley node issue-op-cert \ --kes-verification-key-file "$POOL_PATH/$1.kes.vkey" \ --cold-signing-key-file "$POOL_PATH/$1.node.skey" \ --operational-certificate-issue-counter "$POOL_PATH/$1.node.counter" \ --kes-period "$kesPeriod" \ --out-file "$POOL_PATH/$1.node.cert" cardano-cli shelley node key-gen-VRF \ --verification-key-file "$POOL_PATH/$1.vrf.vkey" \ --signing-key-file "$POOL_PATH/$1.vrf.skey" for f in $POOL_PATH/*; do (cat "${f}"; echo; echo) >> "$POOL_PATH/$1.pool.txt"; done printf "$1 Pool\n\n" | cat - "$POOL_PATH/$1.pool.txt" > "$POOL_PATH/temp" && mv "$POOL_PATH/temp" "$POOL_PATH/$1.pool.txt" echo "Start core node with the new keys of $1!" echo "For Pool registration host your poolmeta.json now" echo "Edit registerPool for adjusting Pledge, Cost, etc." ================================================ FILE: scripts/cardano-scripts/createWallet ================================================ #!/bin/bash WALLET_PATH="$HOME/priv/wallet/$1" TMP="/opt/cardano/tmp" mkdir -p "$WALLET_PATH" cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode cardano-cli shelley address key-gen \ --verification-key-file "$WALLET_PATH/$1.payment.vkey" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" cardano-cli shelley stake-address key-gen \ --verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --signing-key-file "$WALLET_PATH/$1.stake.skey" cardano-cli shelley stake-address build \ --staking-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --out-file "$WALLET_PATH/$1.stake.addr" \ --mainnet cardano-cli shelley address build \ --payment-verification-key-file "$WALLET_PATH/$1.payment.vkey" \ --staking-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --out-file "$WALLET_PATH/$1.payment.addr" \ --mainnet for f in $WALLET_PATH/*; do (cat "${f}"; echo; echo) >> "$WALLET_PATH/$1.wallet.txt"; done printf "$1 Wallet\n\n" | cat - "$WALLET_PATH/$1.wallet.txt" > "$WALLET_PATH/temp" && mv "$WALLET_PATH/temp" "$WALLET_PATH/$1.wallet.txt" echo "$1 Wallet created!" ================================================ FILE: scripts/cardano-scripts/decryptPool ================================================ #!/bin/bash TMP="/opt/cardano/tmp" POOL_PATH="$HOME/priv/pool/$1" read -s -p "Password: " PASSWORD echo echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.vkey" "$POOL_PATH/$1.node.vkey.gpg" >/dev/null && rm -f "$POOL_PATH/$1.node.vkey.gpg" echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.skey" "$POOL_PATH/$1.node.skey.gpg" >/dev/null && rm -f "$POOL_PATH/$1.node.skey.gpg" echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.counter" "$POOL_PATH/$1.node.counter.gpg" >/dev/null && rm -f "$POOL_PATH/$1.node.counter.gpg" if [ -f "$POOL_PATH/$1.node.skey" ]; then echo "Cold keys of $1 decrypted!" else echo "Failed to decrypt cold keys of $1" fi ================================================ FILE: scripts/cardano-scripts/decryptWallet ================================================ #!/bin/bash TMP="/opt/cardano/tmp" WALLET_PATH="$HOME/priv/wallet/$1" read -s -p "Password: " PASSWORD echo echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.payment.vkey" "$WALLET_PATH/$1.payment.vkey.gpg" >/dev/null && rm -f "$WALLET_PATH/$1.payment.vkey.gpg" echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.payment.skey" "$WALLET_PATH/$1.payment.skey.gpg" >/dev/null && rm -f "$WALLET_PATH/$1.payment.skey.gpg" echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.stake.vkey" "$WALLET_PATH/$1.stake.vkey.gpg" >/dev/null && rm -f "$WALLET_PATH/$1.stake.vkey.gpg" echo "$PASSWORD" | gpg --decrypt --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.stake.skey" "$WALLET_PATH/$1.stake.skey.gpg" >/dev/null && rm -f "$WALLET_PATH/$1.stake.skey.gpg" if [ -f "$WALLET_PATH/$1.payment.vkey" ]; then echo "$1 Wallet decrypted!" else echo "Failed to decrypt $1 Wallet" fi ================================================ FILE: scripts/cardano-scripts/encryptPool ================================================ #!/bin/bash TMP="/opt/cardano/tmp" POOL_PATH="$HOME/priv/pool/$1" read -s -p "Password: " PASSWORD echo read -s -p "Confirm Password: " CONFIRM_PASSWORD echo if [ "$PASSWORD" != "$CONFIRM_PASSWORD" ]; then echo "Passwords do not match!" exit fi echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.vkey.gpg" "$POOL_PATH/$1.node.vkey" >/dev/null && rm -f "$POOL_PATH/$1.node.vkey" echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.skey.gpg" "$POOL_PATH/$1.node.skey" >/dev/null && rm -f "$POOL_PATH/$1.node.skey" echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$POOL_PATH/$1.node.counter.gpg" "$POOL_PATH/$1.node.counter" >/dev/null && rm -f "$POOL_PATH/$1.node.counter" echo "Cold keys of $1 encrypted!" ================================================ FILE: scripts/cardano-scripts/encryptWallet ================================================ #!/bin/bash TMP="/opt/cardano/tmp" WALLET_PATH="$HOME/priv/wallet/$1" read -s -p "Password: " PASSWORD echo read -s -p "Confirm Password: " CONFIRM_PASSWORD echo if [ "$PASSWORD" != "$CONFIRM_PASSWORD" ]; then echo "Passwords do not match!" exit fi echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.payment.vkey.gpg" "$WALLET_PATH/$1.payment.vkey" >/dev/null && rm -f "$WALLET_PATH/$1.payment.vkey" echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.payment.skey.gpg" "$WALLET_PATH/$1.payment.skey" >/dev/null && rm -f "$WALLET_PATH/$1.payment.skey" echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.stake.vkey.gpg" "$WALLET_PATH/$1.stake.vkey" >/dev/null && rm -f "$WALLET_PATH/$1.stake.vkey" echo "$PASSWORD" | gpg --symmetric --yes --batch --cipher-algo AES256 --passphrase-fd 0 --output "$WALLET_PATH/$1.stake.skey.gpg" "$WALLET_PATH/$1.stake.skey" >/dev/null && rm -f "$WALLET_PATH/$1.stake.skey" echo "$1 Wallet encrypted!" ================================================ FILE: scripts/cardano-scripts/modifyPool ================================================ #!/bin/bash #Pledge in Lovelace PLEDGE=1000000000 # 1000 ADA #Pool cost in Lovelace COST=340000000 # 340 ADA MARGIN=0.05 # 5% RELAY_PORT=3001 # domain name of your relay, e.g relay.stakepool.com RELAY_DOMAIN="" # URL link to meta.json, e.g META_URL="" WALLET_PATH="$HOME/priv/wallet/$1" POOL_PATH="$HOME/priv/pool/$2" TMP="/opt/cardano/tmp" if [ -f "$POOL_PATH/$1.node.skey.gpg" ]; then echo "Cold keys of $2 are encrypted!" exit fi if [ -f "$WALLET_PATH/$1.payment.skey.gpg" ]; then echo "$1 Wallet is encrypted!" exit fi cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode cardano-cli shelley stake-pool metadata-hash --pool-metadata-file "$POOL_PATH/poolmeta.json" > "$POOL_PATH/poolmetaHash.txt" minPoolCost=$(cat "$TMP/params.json" | jq -r .minPoolCost) echo minPoolCost: "${minPoolCost}" cardano-cli shelley stake-pool registration-certificate \ --cold-verification-key-file "$POOL_PATH/$2.node.vkey" \ --vrf-verification-key-file "$POOL_PATH/$2.vrf.vkey" \ --pool-pledge "$PLEDGE" \ --pool-cost "$COST" \ --pool-margin "$MARGIN" \ --pool-reward-account-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --pool-owner-stake-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --mainnet \ --single-host-pool-relay "$RELAY_DOMAIN" \ --pool-relay-port $RELAY_PORT \ --metadata-url "$META_URL" \ --metadata-hash $(cat "$POOL_PATH/poolmetaHash.txt") \ --out-file "$POOL_PATH/$2.pool.cert" cardano-cli shelley stake-address delegation-certificate \ --staking-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --cold-verification-key-file "$POOL_PATH/$2.node.vkey" \ --out-file "$WALLET_PATH/$1.deleg.cert" currentSlot=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo "Current Slot: $currentSlot" cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" cat "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) echo TxHash: ${in_addr}#${idx} echo ADA: ${utxo_balance} tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) echo "Total ADA balance of $1 Wallet": ${total_balance} echo Number of UTXOs: ${txcnt} poolDeposit=$(cat "$TMP/params.json" | jq -r '.poolDeposit') echo poolDeposit: "$poolDeposit" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+$(( ${total_balance} - ${poolDeposit})) \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --certificate-file "$POOL_PATH/$2.pool.cert" \ --certificate-file "$WALLET_PATH/$1.deleg.cert" \ --out-file "$TMP/tx.tmp" fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 1 \ --mainnet \ --witness-count 3 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: $fee txOut=$((${total_balance}-${fee})) echo txOut: "${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+${txOut} \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --certificate-file "$POOL_PATH/$2.pool.cert" \ --certificate-file "$WALLET_PATH/$1.deleg.cert" \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --signing-key-file "$POOL_PATH/$2.node.skey" \ --signing-key-file "$WALLET_PATH/$1.stake.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode cardano-cli shelley stake-pool id --verification-key-file "$POOL_PATH/$2.node.vkey" > "$POOL_PATH/$2.id.txt" echo "$2 modified with new Pledge: $PLEDGE, Cost: $COST, Margin: $MARGIN" ================================================ FILE: scripts/cardano-scripts/registerPool ================================================ #!/bin/bash #Pledge in Lovelace PLEDGE=1000000000 # 1000 ADA #Pool cost in Lovelace COST=340000000 # 340 ADA MARGIN=0.05 # 5% RELAY_PORT=3001 # domain name of your relay, e.g relay.stakepool.com RELAY_DOMAIN="" # URL link to meta.json, e.g META_URL="" WALLET_PATH="$HOME/priv/wallet/$1" POOL_PATH="$HOME/priv/pool/$2" TMP="/opt/cardano/tmp" echo "Fetching poolmeta.json" wget -P "$POOL_PATH" "$META_URL" cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode cardano-cli shelley stake-pool metadata-hash --pool-metadata-file "$POOL_PATH/poolmeta.json" > "$POOL_PATH/poolmetaHash.txt" minPoolCost=$(cat "$TMP/params.json" | jq -r .minPoolCost) echo minPoolCost: "${minPoolCost}" cardano-cli shelley stake-pool registration-certificate \ --cold-verification-key-file "$POOL_PATH/$2.node.vkey" \ --vrf-verification-key-file "$POOL_PATH/$2.vrf.vkey" \ --pool-pledge "$PLEDGE" \ --pool-cost "$COST" \ --pool-margin "$MARGIN" \ --pool-reward-account-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --pool-owner-stake-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --mainnet \ --single-host-pool-relay "$RELAY_DOMAIN" \ --pool-relay-port $RELAY_PORT \ --metadata-url "$META_URL" \ --metadata-hash $(cat "$POOL_PATH/poolmetaHash.txt") \ --out-file "$POOL_PATH/$2.pool.cert" cardano-cli shelley stake-address delegation-certificate \ --staking-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --cold-verification-key-file "$POOL_PATH/$2.node.vkey" \ --out-file "$WALLET_PATH/$1.deleg.cert" currentSlot=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo "Current Slot: $currentSlot" cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" cat "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) echo TxHash: ${in_addr}#${idx} echo ADA: ${utxo_balance} tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) echo "Total ADA balance of $1 Wallet": ${total_balance} echo Number of UTXOs: ${txcnt} poolDeposit=$(cat "$TMP/params.json" | jq -r '.poolDeposit') echo poolDeposit: "$poolDeposit" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+$(( ${total_balance} - ${poolDeposit})) \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --certificate-file "$POOL_PATH/$2.pool.cert" \ --certificate-file "$WALLET_PATH/$1.deleg.cert" \ --out-file "$TMP/tx.tmp" fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 1 \ --mainnet \ --witness-count 3 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: $fee txOut=$((${total_balance}-${poolDeposit}-${fee})) echo txOut: "${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+${txOut} \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --certificate-file "$POOL_PATH/$2.pool.cert" \ --certificate-file "$WALLET_PATH/$1.deleg.cert" \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --signing-key-file "$POOL_PATH/$2.node.skey" \ --signing-key-file "$WALLET_PATH/$1.stake.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode cardano-cli shelley stake-pool id --verification-key-file "$POOL_PATH/$2.node.vkey" > "$POOL_PATH/$2.id.txt" echo "$2 registered with Pledge: $PLEDGE, Cost: $COST, Margin: $MARGIN" ================================================ FILE: scripts/cardano-scripts/registerWallet ================================================ #!/bin/bash WALLET_PATH="$HOME/priv/wallet/$1" TMP="/opt/cardano/tmp" cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode cardano-cli shelley stake-address registration-certificate \ --staking-verification-key-file "$WALLET_PATH/$1.stake.vkey" \ --out-file "$WALLET_PATH/$1.stake.cert" currentSlot=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo "Current Slot: $currentSlot" cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" cat "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) echo TxHash: ${in_addr}#${idx} echo ADA: ${utxo_balance} tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) echo "Total ADA balance of $1 Wallet": ${total_balance} echo Number of UTXOs: ${txcnt} keyDeposit=$(cat "$TMP/params.json" | jq -r '.keyDeposit') echo "keyDeposit: $keyDeposit" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+0 \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --out-file "$TMP/tx.tmp" \ --certificate "$WALLET_PATH/$1.stake.cert" fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 1 \ --mainnet \ --witness-count 2 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: "$fee" txOut=$((${total_balance}-${keyDeposit}-${fee})) echo "Change Output: ${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+${txOut} \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --certificate-file "$WALLET_PATH/$1.stake.cert" \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --signing-key-file "$WALLET_PATH/$1.stake.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode echo "Registered $1 Stake Address!" ================================================ FILE: scripts/cardano-scripts/send ================================================ #!/bin/bash WALLET_PATH="$HOME/priv/wallet/$1" TMP="/opt/cardano/tmp" if [ -f "$WALLET_PATH/$1.payment.skey.gpg" ]; then echo "$1 Wallet is encrypted!" exit fi cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode currentSlot=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo "Current Slot: $currentSlot" cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" cat "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) echo TxHash: ${in_addr}#${idx} echo ADA: ${utxo_balance} tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) echo "Total ADA balance of $1 Wallet": ${total_balance} echo Number of UTXOs: ${txcnt} if [[ "$2" != "all" ]]; then cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+0 \ --tx-out "$3+0" \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --out-file "$TMP/tx.tmp" \ fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 2 \ --mainnet \ --witness-count 1 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: "$fee" txOut=$((${total_balance}-$2-${fee})) echo "Change Output: ${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+${txOut} \ --tx-out "$3+$2" \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode echo "Sent $2 Lovelace to $3!" else cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out "$3+0" \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --out-file "$TMP/tx.tmp" \ fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 1 \ --mainnet \ --witness-count 1 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: "$fee" txOut=$((${total_balance}-${fee})) echo "Change Output: ${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out "$3+$txOut" \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode echo "Sent $txOut Lovelace to $3" fi ================================================ FILE: scripts/cardano-scripts/updateKES ================================================ #!/bin/bash TMP="/opt/cardano/tmp" POOL_PATH="$HOME/priv/pool/$1" if [ -f "$POOL_PATH/$1.node.skey.gpg" ]; then echo "Cold keys of $1 are encrypted!" exit fi slotNo=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') slotsPerKESPeriod=$(cat $RELAY/files/mainnet-shelley-genesis.json | jq -r '.slotsPerKESPeriod') kesPeriod=$((${slotNo} / ${slotsPerKESPeriod})) cardano-cli shelley node issue-op-cert \ --kes-verification-key-file "$POOL_PATH/$1.kes.vkey" \ --cold-signing-key-file "$POOL_PATH/$1.node.skey" \ --operational-certificate-issue-counter "$POOL_PATH/$1.node.counter" \ --kes-period ${kesPeriod} \ --out-file "$POOL_PATH/$1.node.cert" echo "Restart your core node with the new keys!" ================================================ FILE: scripts/cardano-scripts/wallet ================================================ #!/bin/bash WALLET_PATH="$HOME/priv/wallet/$1" TMP="/opt/cardano/tmp" cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) BALANCE=`echo "scale=6; ${total_balance}*10^-6" | bc -l` STAKE_ADDR=$(cat "$WALLET_PATH/$1.stake.addr") REWARD=$(cardano-cli shelley query stake-address-info --address "$STAKE_ADDR" --mainnet | jq -r '.[]' | jq -r '.rewardAccountBalance') REWARD=`echo "scale=6; ${REWARD}*10^-6" | bc -l` STATUS="" if [ -f "$WALLET_PATH/$1.payment.skey" ]; then STATUS="decrypted" else STATUS="encrypted" fi echo echo "$1 Wallet ($STATUS)" echo echo "Address: $(cat $WALLET_PATH/$1.payment.addr)" echo "Balance: $BALANCE ADA" echo "Reward: $REWARD ADA" echo ================================================ FILE: scripts/cardano-scripts/withdraw ================================================ #!/bin/bash WALLET_PATH="$HOME/priv/wallet/$1" TMP="/opt/cardano/tmp" if [ -f "$WALLET_PATH/$1.payment.skey.gpg" ]; then echo "$1 Wallet is encrypted!" exit fi cardano-cli shelley query protocol-parameters \ --mainnet \ --out-file "$TMP/params.json" \ --cardano-mode currentSlot=$(cardano-cli shelley query tip --mainnet | jq -r '.slotNo') echo "Current Slot: $currentSlot" cardano-cli shelley query utxo \ --address $(cat "$WALLET_PATH/$1.payment.addr") \ --mainnet \ --cardano-mode > "$TMP/fullUtxo.out" tail -n +3 "$TMP/fullUtxo.out" | sort -k3 -nr > "$TMP/balance.out" cat "$TMP/balance.out" tx_in="" total_balance=0 while read -r utxo; do in_addr=$(awk '{ print $1 }' <<< "${utxo}") idx=$(awk '{ print $2 }' <<< "${utxo}") utxo_balance=$(awk '{ print $3 }' <<< "${utxo}") total_balance=$((${total_balance}+${utxo_balance})) echo TxHash: ${in_addr}#${idx} echo ADA: ${utxo_balance} tx_in="${tx_in} --tx-in ${in_addr}#${idx}" done < "$TMP/balance.out" txcnt=$(cat "$TMP/balance.out" | wc -l) echo "Total ADA balance of $1 Wallet": ${total_balance} echo Number of UTXOs: ${txcnt} STAKE_ADDR=$(cat "$WALLET_PATH/$1.stake.addr") REWARD=$(cardano-cli shelley query stake-address-info --address "$STAKE_ADDR" --mainnet | jq -r '.[]' | jq -r '.rewardAccountBalance') cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+0 \ --ttl $(( ${currentSlot} + 10000)) \ --fee 0 \ --out-file "$TMP/tx.tmp" \ fee=$(cardano-cli shelley transaction calculate-min-fee \ --tx-body-file "$TMP/tx.tmp" \ --tx-in-count ${txcnt} \ --tx-out-count 1 \ --mainnet \ --witness-count 2 \ --byron-witness-count 0 \ --protocol-params-file "$TMP/params.json" | awk '{ print $1 }') echo fee: "$fee" txOut=$((${total_balance}-${fee}+${REWARD})) echo "Change Output: ${txOut}" cardano-cli shelley transaction build-raw \ ${tx_in} \ --tx-out $(cat "$WALLET_PATH/$1.payment.addr")+${txOut} \ --ttl $(( ${currentSlot} + 10000)) \ --fee ${fee} \ --withdrawal "${STAKE_ADDR}+${REWARD}" \ --out-file "$TMP/tx.raw" cardano-cli shelley transaction sign \ --tx-body-file "$TMP/tx.raw" \ --signing-key-file "$WALLET_PATH/$1.payment.skey" \ --signing-key-file "$WALLET_PATH/$1.stake.skey" \ --mainnet \ --out-file "$TMP/tx.signed" cardano-cli shelley transaction submit \ --tx-file "$TMP/tx.signed" \ --mainnet \ --cardano-mode echo "Withdrawn $REWARD Lovelace to $1 Wallet" ================================================ FILE: scripts/fullGuide/999_decompress_rpi_kernel ================================================ DPkg::Post-Invoke {"/bin/bash /boot/firmware/auto_decompress_kernel"; }; ================================================ FILE: scripts/fullGuide/auto_decompress_kernel ================================================ #!/bin/bash -e #Set Variables BTPATH=/boot/firmware CKPATH=$BTPATH/vmlinuz DKPATH=$BTPATH/vmlinux #Check if compression needs to be done. if [ -e $BTPATH/check.md5 ]; then if md5sum --status --ignore-missing -c $BTPATH/check.md5; then echo -e "\e[32mFiles have not changed, Decompression not needed\e[0m" exit 0 else echo -e "\e[31mHash failed, kernel will be compressed\e[0m" fi fi #Backup the old decompressed kernel mv $DKPATH $DKPATH.bak if [ ! $? == 0 ]; then echo -e "\e[31mDECOMPRESSED KERNEL BACKUP FAILED!\e[0m" exit 1 else echo -e "\e[32mDecompressed kernel backup was successful\e[0m" fi #Decompress the new kernel echo "Decompressing kernel: "$CKPATH".............." zcat $CKPATH > $DKPATH if [ ! $? == 0 ]; then echo -e "\e[31mKERNEL FAILED TO DECOMPRESS!\e[0m" exit 1 else echo -e "\e[32mKernel Decompressed Succesfully\e[0m" fi #Hash the new kernel for checking md5sum $CKPATH $DKPATH > $BTPATH/check.md5 if [ ! $? == 0 ]; then echo -e "\e[31mMD5 GENERATION FAILED!\e[0m" else echo -e "\e[32mMD5 generated Succesfully\e[0m" fi #Exit exit 0 ================================================ FILE: scripts/fullGuide/installCardano.sh ================================================ #!/bin/bash set -e echo "Cloning Cardano repository" echo git clone https://github.com/input-output-hk/cardano-node.git ~/cardano-node cd ~/cardano-node echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local git fetch --all --tags echo "Checking out version 1.19.1" git checkout tags/1.19.1 echo "Building node, this takes a while..." cabal build all cp -p ~/cardano-node/dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-1.19.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/ cp -p ~/cardano-node/dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-1.19.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/ cd echo "Done!" ================================================ FILE: scripts/fullGuide/start.sh ================================================ #!/bin/bash set -e # This script installs all necessary dependencies to build the the cardano-node and cardano-cli binaries echo "Updating Ubuntu" echo sudo apt-get update sudo apt-get upgrade echo echo "Installing dependencies" echo sudo apt-get install libsodium-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 llvm -y echo echo "Installing Haskell platform" echo sudo apt-get install -y haskell-platform wget https://github.com/alessandrokonrad/Pi-Pool/raw/master/aarch64/cabal3.2/cabal chmod +x cabal mkdir -p ~/.local/bin mv cabal ~/.local/bin sudo rm /usr/bin/cabal echo 'export PATH="~/.local/bin:$PATH"' >> .bashrc source ~/.bashrc echo echo "Done!" ================================================ FILE: scripts/nodes/show-nodes ================================================ #!/bin/bash tmux a -t cardano ================================================ FILE: scripts/nodes/start-nodes ================================================ #!/bin/bash tmux new -s cardano -d #creating windows tmux split-window -h -t cardano tmux select-pane -t 0 tmux split-window -v -t cardano tmux select-pane -t 2 tmux split-window -v -t cardano #core node tmux select-pane -t 0 tmux send-keys "cardano-node run --topology --database-path --socket-path --host-addr --port --config --shelley-kes-key --shelley-vrf-key --shelley-operational-certificate " C-m #system info tmux select-pane -t 1 tmux send-keys 'neofetch' C-m #relay node tmux select-pane -t 2 tmux send-keys "cardano-node run --topology --database-path --socket-path --host-addr --port --config " C-m #system performance tmux select-pane -t 3 tmux send-keys 'htop' C-m tmux a -t cardano ================================================ FILE: scripts/nodes/stop-nodes ================================================ #!/bin/bash tmux kill-session -t cardano