Skip to content

Instantly share code, notes, and snippets.

@tymat
tymat / genesis.json
Created December 6, 2015 16:19
Sample Genesis JSON
{
"nonce": "0x0000000000000042",
"difficulty": "0x7",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x2fefd8",
"alloc": {
contract Master {
event CallSucceeded(address callee, bytes32 name, bool success);
int public retVal;
event IntRegistered(address from, int value);
function register(int value) public {
IntRegistered(msg.sender, value);
retVal = value;
PC 00000000: PUSH1 GAS: 98339 COST: 3
STACK = 0
MEM = 0
STORAGE = 0
PC 00000002: PUSH1 GAS: 98336 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 0
STORAGE = 0
'Geth/v1.0.0/linux/go1.4.2',
'Geth/LVIV/v1.0.0/linux/go1.4.2',
'Geth/ploeter/v1.0.0/windows/go1.',
'Geth/v1.0.0-fc79d32d/linux/go1.4',
'Bitcoin is THE Blockchain.',
'alla hopp',
'Geth/v1.0.0-0cdc7647/linux/go1.4',
'Geth/v1.0.0/darwin/go1.4.2',
'Geth/v1.0.0/windows/go1.4.2',
'kekse',
@tymat
tymat / gist:28036cd1b9434692fb13
Last active August 29, 2015 14:24
go-ethereum source tree
.
├── AUTHORS
├── COPYING
├── COPYING.LESSER
├── Godeps - (go build dependencies)
├── LICENSE
├── Makefile (make all | make geth | ....)
├── README.md
├──- _data
│   ├── invalid1
@tymat
tymat / gist:318290f91dbbf0209b2d
Created January 26, 2015 16:03
dieharder test of TRNG
#=============================================================================#
# dieharder version 3.31.1 Copyright 2003 Robert G. Brown #
#=============================================================================#
rng_name | filename |rands/second|
mt19937| /tmp/randomfile| 8.88e+07 |
#=============================================================================#
test_name |ntup| tsamples |psamples| p-value |Assessment
#=============================================================================#
diehard_birthdays| 0| 100| 100|0.84991279| PASSED
diehard_operm5| 0| 1000000| 100|0.84717575| PASSED
@tymat
tymat / gist:33cbad6e677fabd22ef6
Last active August 29, 2015 14:14
Experimenting with using webcam capture for entropy in OpenSSL RAND_add
# I have been trying to experiment with real random number sources for my Macbook for things like creating new Bitcoin wallets or
# generating private OpenSSL RSA keys (i.e. openssl genrsa -rand random_file -out privkey.pem -des3) and this seems to yield good results.
require 'av_capture'
require 'tempfile'
require 'securerandom'
# Monkeypatching ruby/securerandom library
module SecureRandom
@tymat
tymat / gist:1d2b401610b6ed641279
Last active August 29, 2015 14:02
Payment Gateway and Order System API
@tymat
tymat / gist:6df1a394e5b3818934f9
Last active August 29, 2015 14:02
Life Insurance Policy
#define CLAIMER 0xd766c288f24b91ae9781fe2b155d3260b8674c62
this.store[1000] = this.origin()
func heartbeat() var {
if this.store[1000] == this.origin() {
this.store[1002] = this.time()
return true
} else {
if this.time() this.store[1002] - 2592000 {
return false
@tymat
tymat / gist:9664189
Created March 20, 2014 13:51
AlethZero issues
Open a terminal window
````
cd /Applications/AlethZero/AlethZero.app/Contents/MacOS
./AlethZero
````
Provide the output.