Skip to content

Instantly share code, notes, and snippets.

View TrevorBenson's full-sized avatar
:octocat:

illuminatus TrevorBenson

:octocat:
View GitHub Profile
@TrevorBenson
TrevorBenson / App.tsx
Last active February 11, 2024 19:51
Patternfly web-component for sortable table with attributes of headers, rows, sort-index and sort-direction
import './App.css';
import React from 'react';
import { Table, Thead, Tr, Th, Tbody, Td, ThProps } from '@patternfly/react-table';
import r2wc from "@r2wc/react-to-web-component";
interface TableRow {
[key: string]: string | number;
};
@TrevorBenson
TrevorBenson / App.tsx
Last active February 11, 2024 01:26
Patternfly web-component for sortable table with attributes of data, sort-index and sort-direction
import './App.css';
import React from 'react';
import { Table, Thead, Tr, Th, Tbody, Td, ThProps } from '@patternfly/react-table';
import r2wc from "@r2wc/react-to-web-component";
interface TableRow {
[key: string]: string | number;
};
@TrevorBenson
TrevorBenson / gist:ac5fe32f0934bcd5181db3b6c097fc3b
Created November 28, 2023 17:16
mithril-client snapshot download error: missing field `verification_key` at line 1 column 503
mithril-client -vvvv --aggregator-endpoint ${AGGREGATOR_ENDPOINT} snapshot download --download-dir /opt/cardano/cnode/db latest
Nov 28 17:05:03.686 DEBG Run Mode: dev
Nov 28 17:05:03.686 DEBG Reading configuration file './config/dev.json'.
Nov 28 17:05:03.686 DEBG New AggregatorHTTPClient created
Nov 28 17:05:03.686 DEBG New MithrilCertificateVerifier created
Nov 28 17:05:03.686 DEBG Snapshot service: show.
Nov 28 17:05:03.686 DEBG Snapshot service: list.
Nov 28 17:05:03.686 DEBG GET url='https://aggregator.release-mainnet.api.mithril.network/aggregator/artifact/snapshots'.
Nov 28 17:05:03.696 DEBG Prepare request with version: 0.1.12
Nov 28 17:05:04.426 DEBG GET url='https://aggregator.release-mainnet.api.mithril.network/aggregator/artifact/snapshot/8d25aa831ae9acc699dec3f18116c376fdfc88864a3e93c854f898f02fd556e9'.
@TrevorBenson
TrevorBenson / .bashrc
Created August 28, 2022 17:05
Check total time spent validating chain after node restart
timestamp() { date '+%s' --date="$1"; }
check_validation_time() {
file=$1
finalChunk=$(jq -r '. | select(.data.initialChunk == "0") | .data.finalChunk' ${file})
startTime=$(jq -r '. | select(.data.initialChunk == "0") | .at' ${file})
endTime=$(jq -r --arg myfc ${finalChunk} '. | select(.data.initialChunk == $myfc) | .at' ${file})
totalTime=$( echo $(( $(timestamp ${endTime}) - $(timestamp ${startTime}) )) )
HMS=$(date -d@${totalTime} -u +%H:%M:%S)
echo "The total time spent on chain validation was: ${HMS}"
@TrevorBenson
TrevorBenson / gist:575206f357fab9f2a58c337856c40db3
Last active January 15, 2021 14:49
What db-sync queries I would like to see.
Quantity of current valid pools
Get the stake distribution for a specified pool, for [a given epoch | any epoch | >= or <= epoch]
Get the number of blocks created by a specified pool, for [a given epoch | any epoch | <= or >= epoch]
Get the number of blocks created by a specified pool for every epoch
Get the delegation history for a specified wallet
Get the reward history for a specified wallet
@TrevorBenson
TrevorBenson / gist:f4cb86f658891d8f5eb9330cdcc2c804
Last active December 9, 2020 00:51
Looking for High Latency Peers
If you have a relay in one of these countries and would like to improve your block production metrics into the US, please consider peering with this specific peer below. I am dedicating this specific relay to high latency peers and once 20 inbound connections are made I will calculate a new Bandwidth Delay Product to allow as much data in flight as possible.
Argentina
Australia
France
Germany
Hungary
India
Israel
Japan
@TrevorBenson
TrevorBenson / Playground.hs
Created October 27, 2020 20:53
Plutus Playground Smart Contract
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Slot (SlotRange)
import qualified Ledger.Slot as Slot
import Language.PlutusTx.Prelude as P
import Ledger
import qualified Ledger.Ada as Ada
import Ledger.Ada (Ada)
import Ledger.Validation
import Playground.Contract
@TrevorBenson
TrevorBenson / Playground.hs
Created October 27, 2020 20:33
Plutus Playground Smart Contract
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Slot (SlotRange)
import qualified Ledger.Slot as Slot
import Language.PlutusTx.Prelude as P
import Ledger
import qualified Ledger.Ada as Ada
import Ledger.Ada (Ada)
import Ledger.Validation
import Playground.Contract
[user@host cardano-node]$ nix-build -A scripts.ff.node -o ff-node-local
trace: Using IOHK default nixpkgs
unpacking 'https://github.com/input-output-hk/iohk-nix/archive/b22d8da9dd38c971ad40d9ad2d1a60cce53995fb.tar.gz'...
error: attribute 'ff' in selection path 'scripts.ff.node' not found
{
"name": "SomeNode",
"description": "Just some node",
"ticker": "SOME",
"homepage": "https://some.example.com"
}