Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
[[ -z $1 ]] && { echo "Pass [mordor|kotti] as ARG1"; exit 1; }
set -e
[[ -d $HOME/.faucet ]] && { echo "Backing up exiting .faucet datadir" && mv $HOME/.faucet $HOME/.faucet.bak; }
onexit()
{
{
"info": {
"title": "Lotus RPC API",
"version": "1.2.1"
},
"methods": [
{
"deprecated": false,
"description": "```go\nfunc (c *FullNodeStruct) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {\n\treturn c.Internal.BeaconGetEntry(ctx, epoch)\n}\n```",
"externalDocs": {
{
"info": {
"title": "Lotus RPC API",
"version": "1.2.1"
},
"methods": [
{
"deprecated": false,
"description": "```go\nfunc (c *FullNodeStruct) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {\n\treturn c.Internal.BeaconGetEntry(ctx, epoch)\n}\n```",
"externalDocs": {
@meowsbits
meowsbits / geth-jsonrpc-transports-shell.sh
Last active December 7, 2020 17:22
How to hit geth's JSON RPC over different transports.
#!/usr/bin/env bash
# HTTP
curl -X POST $(curl icanhazip.com/v4):8545 --data '{"jsonrpc":"2.0","method":"trace_transaction","params":["0x552280896083bfe801a1f70c84011d1b4195a2c08d2221f80245380775cd6270"],"id":1}' -H "Content-Type: application/json
http --json POST http://localhost:8545 id:=$(date +%s) method='rpc_discover' params:='[]'
# Websocket
echo rpc.discover | websocat -B 650000 -n1 --jsonrpc ws://localhost:8546
# IPC
-- Logs begin at Mon 2020-11-16 09:00:20 CST, end at Tue 2020-12-01 07:55:24 CST. --
Dec 01 07:46:02 ubp52 systemd[1]: Starting core-geth classic service...
Dec 01 07:46:02 ubp52 sh[16822]: INFO [12-01|07:46:02.314|internal/debug/flags.go:212] Starting pprof server addr=http://127.0.0.1:6060/debug/pprof
Dec 01 07:46:02 ubp52 sh[16822]: INFO [12-01|07:46:02.314|geth/main.go:317] Starting Geth on Ethereum Classic...
Dec 01 07:46:02 ubp52 sh[16822]: INFO [12-01|07:46:02.314|cmd/utils/flags.go:1910] Enabling metrics collection
Dec 01 07:46:02 ubp52 sh[16822]: INFO [12-01|07:46:02.314|cmd/utils/flags.go:1930] Enabling stand-alone metrics HTTP endpoint address=0.0.0.0:6060
Dec 01 07:46:02 ubp52 sh[16822]: INFO [12-01|07:46:02.315|metrics/exp/exp.go:62] Starting metrics server addr=http://0.0.0.0:6060/debug/metrics
Dec 01 07:46:02 ubp52 sh[16822]: ERROR[12-01|07:46:02.315|metrics/exp/exp.go:65] Failure in running metrics server err="listen tcp
{
"openrpc": "1.2.6",
"info": {
"title": "Lotus RPC API",
"version": "1.1.2+git.3ccacf2e2.dirty/generated=2020-10-30T10:50:39-05:00"
},
"methods": [
{
"name": "Filecoin.BeaconGetEntry",
"description": "```go\nfunc (c *FullNodeStruct) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {\n\treturn c.Internal.BeaconGetEntry(ctx, epoch)\n}\n```",

The interrelated stories of at least but not limited to EIP1283, EIP1706, EIP2200, EIP1884, ECIP1061, ECIP1078, and ECIP1086.

EIP1283 comes into existence. Has way of net gas metering. Gets Finalized.

EIP____ ("Constantinople") comes into existence specifying enabling EIP1283 on ETH (and testnets).

EIP1283 enabled on Ropsten and other testnets.

Uh oh! EIP1283 has bugs.

@meowsbits
meowsbits / coregeth_mordor.service.sh
Last active June 2, 2020 12:22
Example systemd unit file for running Mordor network on core-geth.
#!/usr/bin/env bash
cat <<EOF > /etc/systemd/system/coregeth_mordor.service
[Unit]
Description=CoreGeth Mordor
[Service]
Type=simple
User=root
Restart=always
@meowsbits
meowsbits / geth.core.block_validator.go-block-gaslimit-max-step.diff
Created May 28, 2020 18:54
Maximized block gas limit steps for miners with strong opinions.
diff --git a/core/block_validator.go b/core/block_validator.go
index 37bea2b246..862ee952cc 100644
--- a/core/block_validator.go
+++ b/core/block_validator.go
@@ -107,34 +107,19 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
// ceil if the blocks are full. If the ceil is exceeded, it will always decrease
// the gas allowance.
func CalcGasLimit(parent *types.Block, gasFloor, gasCeil uint64) uint64 {
- // contrib = (parentGasUsed * 3 / 2) / 1024
- contrib := (parent.GasUsed() + parent.GasUsed()/2) / vars.GasLimitBoundDivisor
@meowsbits
meowsbits / geth.miner-hashrate-floor-monitor.js
Created May 28, 2020 12:42
When and if geth's CPU miner drops below floor hashrate, switch off and restart mining after an interval.
var hashrateFloor = 20000;
for (;true;) {
var sleepInterval = 60;
if (!eth.mining) {
console.log(Date(), "starting miner")
miner.start();
sleepInterval = 60*10;
}
var hashrate = miner.getHashrate();
console.log(Date() , "hashrate", hashrate);