Skip to content

Instantly share code, notes, and snippets.

View tpmccallum's full-sized avatar

Timothy McCallum tpmccallum

View GitHub Profile
@tpmccallum
tpmccallum / epn_15.md
Last active February 2, 2018 02:37
epn_15
cd ~
geth --mine --minerthreads=1 --datadir ~/gethDataDir --networkid 15
@tpmccallum
tpmccallum / epn_16.md
Created February 2, 2018 13:39
epn_16
web3.eth.getBlock(0).stateRoot
web3.eth.getBlock(0).transactionsRoot
web3.eth.getBlock(0).receiptsRoot
@tpmccallum
tpmccallum / epn_17.md
Created February 2, 2018 13:41
epn_17
web3.eth.getBlock(web3.eth.blockNumber).stateRoot
@tpmccallum
tpmccallum / epn_18.md
Last active February 6, 2018 03:52
epn_18
cd ~
sudo apt-get update
sudo apt-get upgrade
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - sudo apt-get install -y nodejs
sudo apt-get install nodejs
npm -v
nodejs -v
npm install levelup leveldown rlp merkle-patricia-tree --save
git clone https://github.com/ethereumjs/ethereumjs-vm.git
@tpmccallum
tpmccallum / epn_19.md
Created February 2, 2018 13:57
epn_19
//Just importing the requirements
var Trie = require('merkle-patricia-tree/secure');
var levelup = require('levelup');
var leveldown = require('leveldown');
var RLP = require('rlp');
var assert = require('assert');

//Connecting to the leveldb database
var db = levelup(leveldown('/home/timothymccallum/gethDataDir/geth/chaindata'));
@tpmccallum
tpmccallum / eth_account_balance.md
Created February 5, 2018 01:06
Ethereum Account Balance
//Just getting the requirements
var Trie = require('merkle-patricia-tree/secure');
var levelup = require('levelup');
var leveldown = require('leveldown');
var RLP = require('rlp');
var assert = require('assert');
var VM = require('ethereumjs-vm')
var Account = require('ethereumjs-account')
//Mozilla Public License 2.0 
//As per https://github.com/ethereumjs/ethereumjs-vm/blob/master/LICENSE
//Requires the following packages to run as nodejs file https://gist.github.com/tpmccallum/0e58fc4ba9061a2e634b7a877e60143a

//Getting the requirements
var Trie = require('merkle-patricia-tree/secure');
var levelup = require('levelup');
var leveldown = require('leveldown');
var utils = require('ethereumjs-util');
@tpmccallum
tpmccallum / pyumbral.md
Last active May 7, 2018 15:20
Installing and testing NuCypher's pyUmbral on Ubuntu 16.04
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python3-pip
sudo -H pip3 install pipenv
cd ~
git clone https://github.com/nucypher/pyUmbral.git
cd pyUmbral/
pipenv install
pipenv shell
python3
>>> import random
>>> from umbral import umbral, keys, config
alice_priv_key = keys.UmbralPrivateKey.gen_key()
alice_pub_key = alice_priv_key.get_pubkey()