Skip to content

Instantly share code, notes, and snippets.

View masonforest's full-sized avatar

Mason Fischer masonforest

View GitHub Profile
@masonforest
masonforest / ellipticoin_supply-21-million.py
Last active April 6, 2019 19:54
Tentative Ellipticoin Supply Curve that works out to a supply of 21 million coins
import math
import datetime, time
import time
BLOCKS_PER_SECOND = 5
# This was chosen because it's an exponent of 2
# And it works out to about a year (1.3 years) if blocks are produced every 5 seconds as planned.
BLOCKS_PER_ERA = 2**23
# This was chosen because it puts the final issuance sometime in 2031
# If Ellipticoin hasn't caught on by then assume we've failed :/
NUMBER_OF_ERAS = 8
@masonforest
masonforest / hashfactor.py
Last active March 29, 2019 00:56
Hashfactor is proof of work algorithm inspired by hashcash
# Hashfactor is proof of work algorithm inspired by [hashcash](http://www.hashcash.org/).
# Hashfactor is simpler to implement than hashcash but the result is not a
# hash with leading zeros. This tradeoff is worth-while if you have access to
# a computer to validate proof of work values but you'd like implementation to
# be simpler.
from random import randint
import binascii
import hashlib
@masonforest
masonforest / gist:99e7b694e68dfab06b348f22e179e370
Created February 25, 2019 14:37
./wavelet --port 3000 --db.path testdb_1 --api.port 9000
2019-02-25T14:33:44Z |INFO| Database has been loaded. db_path: testdb_1
2019-02-25T14:33:44Z |INFO| Successfully seeded the genesis of this node. file: genesis.json num_accounts: 1
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: cloud.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: contract.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: money.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: stake.wasm
2019-02-25T14:33:44Z |INFO| Keypair loaded. private_key: 6d6fe0c2bc913c0e3e497a0328841cf4979f932e01d2030ad21e649fca8d47fe71e6c9b83a7ef02bae6764991eefe53360a0a09be53887b2d3900d02c00a3858 public_key: 71e6c9b83a7ef02bae6764991eefe53360a0a09be53887b2d3900d02c00a3858
2019-02-25T14:33:44Z |INFO| Listening for peers. address=tcp://127.0.0.1:3000
2019-02-25T14:33:44Z |INFO| Local HTTP API is being served. host: localhost port: 9000
Enter a message: 2019-02-25T14:33:56Z |INFO| Connected t
var fs = require('fs');
const createKeccakHash = require('keccak');
var jayson = require('jayson');
var transaction = "0x1066b9764832dc6dc710c3e131ee54c68c1b3f1e21de6b3dc8f97ee68ff3f190";
var client = jayson.client.http({
host: "149.248.8.23",
port: 8545,
});
function hash(value) {
This file has been truncated, but you can view the full file.
{
failed: false,
gas: 95244,
returnValue: "",
structLogs: [{
depth: 1,
gas: 174176,
gasCost: 3,
memory: [],
@masonforest
masonforest / run.js
Created September 11, 2018 14:37
Run transaction at block #177610 in ethereumjs-vm
var VM = require('./lib');
const SecureTrie = require('merkle-patricia-tree/secure')
var Account = require('ethereumjs-account');
const StateManager = require('./lib/stateManager.js');
const utils = require('ethereumjs-util')
const rlp = utils.rlp
const ethUtil = require('ethereumjs-util')
@masonforest
masonforest / gist:4df0eb9eb40b436c7c0d06148897f260
Created September 3, 2018 23:30
Output of `cargo run --features "evm-debug"`
parity-ethereum master % cargo run --features "evm-debug"
Compiling parity-rocksdb-sys v0.5.2
Compiling evm v0.1.0 (file:///Users/masonf/src/parity-ethereum/ethcore/evm)
Compiling ethcore-network-devp2p v1.12.0 (file:///Users/masonf/src/parity-ethereum/util/network-devp2p)
Compiling parity-whisper v0.1.0 (file:///Users/masonf/src/parity-ethereum/whisper)
error[E0423]: expected value, found module `informant`
--> ethcore/evm/src/interpreter/mod.rs:277:16
|
277 | evm_debug!({ informant.before_instruction(reader.position, instruction, info, &self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas, &stack) });
| ^^^^^^^^^ help: try: `self.informant`
@masonforest
masonforest / gist:9d683e4d2e067833a95d4decb2a7403e
Created September 3, 2018 23:24
Output of `cargo run -- --no-warp -lmason=trace`
parity-ethereum mf-add-trace-message % rm -rf ~/Library/Application\ Support/io.parity.ethereum && cargo run -- --no-warp -lmason=trace
Finished dev [unoptimized + debuginfo] target(s) in 1.26s
Running `target/debug/parity --no-warp -lmason=trace`
2018-09-03 19:15:28 main INFO parity_ethereum::run Starting Parity-Ethereum/v2.1.0-unstable-caca3a804-20180831/x86_64-macos/rustc1.28.0
2018-09-03 19:15:28 main INFO parity_ethereum::run Keys path /Users/masonf/Library/Application Support/io.parity.ethereum/keys/Foundation
2018-09-03 19:15:28 main INFO parity_ethereum::run DB path /Users/masonf/Library/Application Support/io.parity.ethereum/chains/ethereum/db/906a34e69aec8c0d
2018-09-03 19:15:28 main INFO parity_ethereum::run State DB configuration: fast
2018-09-03 19:15:28 main INFO parity_ethereum::run Operating mode: active
2018-09-03 19:15:28 main INFO ethcore_service::service Configured for Foundation using Ethash engine
2018-09-03 19:15:33 IO Worker #1 INFO network Public node URL: enode
#!/bin/bash
#
# git-nest-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
Compiling 45 files (.ex)
Generated ex_wire app
.
07:27:00.261 [warn] Message code `0x99` not implemented
.....
07:27:00.339 [debug] [Network] Sending EIP8 Handshake to 1.2.3.4
.
07:27:00.367 [debug] [Network] Received EIP8 Handshake from 1.2.3.4
.....................
07:27:00.523 [warn] The on_load function for module libsecp256k1 returned: