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
if (new URLSearchParams(window.location.search).get('portal')) {
// <create start portal>
// Create portal group to contain all portal elements
const startPortalGroup = new THREE.Group();
startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z);
startPortalGroup.rotation.x = 0.35;
startPortalGroup.rotation.y = 0;
// Create portal effect
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active March 10, 2025 13:06
Bridge Hack List
@yorickdowne
yorickdowne / HallOfBlame.md
Last active June 29, 2025 02:34
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on latency and IOPS, I/O Per Second, of the storage. Budget SSDs will struggle to an extent, and some won't be able to sync at all. IOPS can roughly be used as proxy of / predictor for latency. Measuring latency directly is arguably better.

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 is a very conservative choice. The smaller 2TB drive should last an Ethereum full node until at least sometime 2026, with [pre-merge history expiry](https://hackmd.io/@hBXHLw_9Qq2va4pRtI4bI

@reneklacan
reneklacan / aoe4-mp-fix.sh
Last active December 8, 2024 14: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