Skip to content

Instantly share code, notes, and snippets.

View johnnieskywalker's full-sized avatar
⛓️
Exploring Blockchain

Johnnie Lucas johnnieskywalker

⛓️
Exploring Blockchain
View GitHub Profile
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active June 11, 2024 19:53
Bridge Hack List
@yorickdowne
yorickdowne / HallOfBlame.md
Last active June 28, 2024 13:47
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

The drive lists are ordered by interface and then by capacity and alphabetically by vendor name, not by preference. The lists are not exhaustive at all. @mwpastore linked a filterable spreadsheet in comments that has a far greater variety of drives and their characteristics. Filter it by DRAM yes, NAND Type TLC, Form Factor M.2, and desired capacity.

For size, 4TB comes recommended as of mid 2024. The smaller 2TB drive should last an Ethereum full node until early 2025 or thereabouts, with crystal ball uncertainty. Remy wrote a migration guide to 4TB.

@reneklacan
reneklacan / aoe4-mp-fix.sh
Last active March 26, 2024 08:48
Script to fix AOE4 desync issues
#!/bin/bash
set -ex
STEAM_DIR=/home/$USER/.steam/steam/steamapps
AOE4_DIR=$STEAM_DIR/compatdata/1466860
AOE4_WIN_DIR=$AOE4_DIR/pfx/drive_c/windows
AOE4_WIN_SYS32_DIR=$AOE4_WIN_DIR/system32
AOE4_WIN_SYS64_DIR=$AOE4_WIN_DIR/syswow64
@fvictorio
fvictorio / hardhat-mocking.md
Created July 20, 2021 11:52
Hardhat: stubs and mocks

If you want to test a contract that depends on other contract, but you don't own the latter contract (or you do but you want to test the first contract in isolation), you need to either stub or mock that dependency.

If you are not sure about the difference between a stub and a mock, check this StackOverflow question

Stubbing

If the contract you are testing receives its dependency in some way, you can write a stub contract and use that in your tests. It would be something like this:

contract ContractToTest {
var blockSocket = new WebSocket("wss://api.blocknative.com/v0");
var init = JSON.stringify({"timeStamp":"new Date().toISOString()","dappId":"1b0ab1af-f282-4776-8bd0-58dd0fb2efa4","version":"2.1.5","blockchain":{"system":"ethereum","network":"main"},"categoryCode":"initialize","eventCode":"checkDappId","connectionId":"8e34210d2420c7d988d12554366e2ea1e3502aa5743c443d9db82e94c0bb83fb"});
var config = JSON.stringify({"timeStamp":"new Date().toISOString()","dappId":"1b0ab1af-f282-4776-8bd0-58dd0fb2efa4","version":"2.1.5","blockchain":{"system":"ethereum","network":"main"},"categoryCode":"configs","eventCode":"put","config":{"filters":[{"status":"pending"}],"scope":"global"}});
var uniswapAddress = JSON.stringify({"timeStamp":"new Date().toISOString()","dappId":"1b0ab1af-f282-4776-8bd0-58dd0fb2efa4","version":"2.1.5","blockchain":{"system":"ethereum","network":"main"},"eventCode":"watch","categoryCode":"accountAddress","account":{"address":"0x7a250d5630b4cf539739df2c5dacb4c659f2488d"}});
var transactionStatusMap