This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
eggs-directory = /home/ralf/.buildout/cache/eggs | |
download-cache = /home/ralf/.buildout/cache/download | |
extends-cache = /home/ralf/.buildout/extends | |
index = http://pypi/simple/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
*.log | |
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def int_to_big_endian(integer): | |
'''convert a integer to big endian binary string''' | |
if integer == 0: | |
return '' | |
s = '%x' % integer | |
if len(s) & 1: | |
s = '0' + s | |
return s.decode('hex') | |
def big_endian_to_int(string): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==== ALARM ==== | |
Description: | |
- contracts can schedule future calls to themself, by specifying: | |
- block height | |
- gas | |
- msgdata | |
- scheduled calls are sorted by (gas, hash(account, msgdata)) # prevent DOS | |
and executed in this stable sorted order before any other tx | |
- on OOG: # includes no more existent account, balance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Requirements: | |
- I/O bound: cycles spent on I/O ≫ cycles spent in cpu | |
- no sharding: impossible to implement data locality strategy | |
- easy verification | |
Thoughts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"comment": "\n 'node_ids': hex encoded ids in order in which they were added to the routing table\n 'buckets' : buckets sorted asc by range\n ", | |
"buckets": [ | |
{ | |
"start": "0x0", | |
"end": "0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffL", | |
"node_ids": [ | |
"0x1d7425638602ab696a402f23ae8cc938dcdcd03969b666205628059568cc69b1064005c3985c3cf3f76be1d1efa21977394988f847fd9b4e64d1bcb702753a1L", | |
"0x1825bc5430beb45f683514f2ceb81f9d7914c120c8dcd19f3e3511287900f7f993829b43922fe15ae1e3db63ef7ddc76b92da22b21df306f8a0b3c3336d8393aL", | |
"0xf844fef1931e9eea56c0941fbf24050a748dbcfac619e630dde29a6baa4b71add2467ac778eedb3693dffbc6c6fa6115ab33edf6e595ed3a8b317fa18d0752bL", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
cython + gmp implementation of ecdsa recover | |
based on: | |
https://github.com/vbuterin/pybitcointools | |
""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from ethereum import trie | |
from ethereum.securetrie import SecureTrie | |
from ethereum import blocks | |
import ethereum.chain | |
from pyethapp.leveldb_service import LevelDB | |
from ethereum.utils import big_endian_to_int | |
db = LevelDB(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# after entering the console of pyethapp | |
# https://github.com/ethereum/pyethapp/wiki/The_Console | |
from devp2p import kademlia | |
import gevent | |
def crawl(): | |
delay = 0.1 | |
lookups = 0 | |
kademlia_proto = eth.app.services.discovery.protocol.kademlia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trie | |
import rlp | |
import db | |
import time | |
trie.rlp_encode = rlp.codec.encode_raw | |
def int_to_big_endian(value): | |
cs = [] |
OlderNewer