<commit_before>#!/usr/bin/env python
import os
import shlex
import json
import time
import tempfile
import signal
from subprocess import Popen, PIPE
from ethereum.utils import denoms, sha3, privtoaddr, encode_hex
from devp2p.crypto import privtopub as privtopub_enode

# DEFAULTS
NUM_GETH_NODES = 3
NUM_RAIDEN_ACCOUNTS = 10
CLUSTER_NAME = 'raiden'
RAIDEN_PORT = 40001
DEFAULT_PW = '<PASSWORD>'

# a list of `num_raiden_accounts` account addresses with a predictable privkey:
# privkey = sha3('127.0.0.1:`raiden_port + i`')
DEFAULTACCOUNTS = [
    encode_hex(privtoaddr(sha3('127.0.0.1:{}'.format(RAIDEN_PORT + i))))
    for i in range(NUM_RAIDEN_ACCOUNTS)
]

# default args to pass to `geth` for all calls, e.g. verbosity, ...
DEFAULT_ARGS = [
    '--nodiscover',
    '--rpc',
    '--networkid {}'.format(sum(ord(c) for c in CLUSTER_NAME)),
]

# the node specific arguments to pass to `geth` that will be extracted from a
# 'node configuration'
NODE_CONFIG = [
    'nodekeyhex',
    'port',
    'rpcport',
    'bootnodes',
    'minerthreads',
    'unlock'
]

GENESIS_STUB = {
    'nonce': '0x0000000000000042',
    'mixhash': '0x0000000000000000000000000000000000000000000000000000000000000000',
    'difficulty': '0x4000',
    'coinbase': '0x0000000000000000000000000000000000000000',
    'timestamp': '0x00',
    'parentHash': '0x0000000000000000000000000000000000000000000000000000000000000000',
    'extraData': CLUSTER_NAME,
    'gasLimit': '0xfffffffff'
}


def mk_genesis(accounts, initial_alloc=denoms.ether * 100000000):
    """
    Create a genesis-block dict with allocation for all `accounts`.

    :param accounts: list of account addresses (hex)
    :param initial_alloc: the amount to allocate for the `accounts`<commit_msg>Fix ECS for private network<commit_after>#!/usr/bin/env python
import os
import shlex
import json
import time
import tempfile
import signal
from subprocess import Popen, PIPE
from ethereum.utils import denoms, sha3, privtoaddr, encode_hex
from devp2p.crypto import privtopub as privtopub_enode

# DEFAULTS
NUM_GETH_NODES = 3
NUM_RAIDEN_ACCOUNTS = 10
CLUSTER_NAME = 'raiden'
RAIDEN_PORT = 40001
DEFAULT_PW = '<PASSWORD>'

# a list of `num_raiden_accounts` account addresses with a predictable privkey:
# privkey = sha3('127.0.0.1:`raiden_port + i`')
DEFAULTACCOUNTS = [
    encode_hex(privtoaddr(sha3('127.0.0.1:{}'.format(RAIDEN_PORT + i))))
    for i in range(NUM_RAIDEN_ACCOUNTS)
]

# default args to pass to `geth` for all calls, e.g. verbosity, ...
DEFAULT_ARGS = [
    '--nodiscover',
    '--rpc',
    '--networkid {}'.format(sum(ord(c) for c in CLUSTER_NAME)),
]

# the node specific arguments to pass to `geth` that will be extracted from a
# 'node configuration'
NODE_CONFIG = [
    'nodekeyhex',
    'port',
    'rpcport',
    'bootnodes',
    'minerthreads',
    'unlock'
]

GENESIS_STUB = {
    'config': {
        'homesteadBlock': 1
    },
    'nonce': '0x0000000000000042',
    'mixhash': '0x0000000000000000000000000000000000000000000000000000000000000000',
    'difficulty': '0x4000',
    'coinbase': '0x0000000000000000000000000000000000000000',
    'timestamp': '0x00',
    'parentHash': '0x0000000000000000000000000000000000000000000000000000000000000000',
    'extraData': CLUSTER_NAME,
    'gasLimit': '0xfffffffff'
}


def mk_genesis(accounts, initial_alloc=denoms.ether * 100000000):
    """
    Create a genesis-block dict with allocation for all `accounts`.

    :param accounts: list of account addresses (hex)
    :param initial_alloc: the amount to allocate for the `accounts`
{'fraction_non_alphanumeric': 0.11487440022579734, 'fraction_numerical': 0.1301157211402766, 'mean_word_length': 4.5375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 12, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5414092', 'n_tokens_mistral': 1577, 'n_tokens_neox': 1162, 'n_words': 310}