Is it possible to create a testnet using the python client pyethapp?

askREwsQwaskREwsQw Member Posts: 3
After reading Ethereum's homestead documentation sheet at

https://media.readthedocs.org/pdf/ethereum-homestead/latest/ethereum-homestead.pdf

I didn't find a way of creating a testnet using the python client (pyethapp). Testnet creation seems possible
only through the eth (C++) and geth(Go) clients. Can they be also created using the python client?

Edit:

I've managed to create a testnet by running:
$ mkdir testnetState
$ pyethapp --profile testnet --data-dir testnetState/ run
which gives the output:
Failed to import scrypt. This is not a fatal error but does
mean that you cannot create or decrypt privkey jsons that use
scrypt

/usr/local/lib/python2.7/dist-packages/cffi/model.py:526: UserWarning: 'point_conversion_form_t' has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long)
  % self._get_c_name())
INFO:config	setup default config path=testnetState/
INFO:config	writing config path=testnetState/config.yaml
INFO:app	using data in path=testnetState/
INFO:config	loading config path=testnetState/
? ''
: {}
accounts: {keystore_dir: keystore, must_include_coinbase: true}
block:
  ACCOUNT_INITIAL_NONCE: 0
  BLKLIM_FACTOR_DEN: 2
  BLKLIM_FACTOR_NOM: 3
  BLOCK_DIFF_FACTOR: 2048
  BLOCK_REWARD: 5000000000000000000
  DIFF_ADJUSTMENT_CUTOFF: 13
  EXPDIFF_FREE_PERIODS: 2
  EXPDIFF_PERIOD: 100000
  GASLIMIT_ADJMAX_FACTOR: 1024
  GASLIMIT_EMA_FACTOR: 1024
  GENESIS_COINBASE: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
  GENESIS_DIFFICULTY: 131072
  GENESIS_EXTRA_DATA: ''
  GENESIS_GAS_LIMIT: 3141592
  GENESIS_INITIAL_ALLOC: {}
  GENESIS_MIXHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
    \0"
  GENESIS_NONCE: "\0\0\0\0\0\0\0*"
  GENESIS_PREVHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
    \0"
  GENESIS_TIMESTAMP: 0
  HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF: 10
  HOMESTEAD_FORK_BLKNUM: 1150000
  MAX_EXTRADATA_LENGTH: 32
  MAX_UNCLES: 2
  MAX_UNCLE_DEPTH: 6
  MIN_DIFF: 131072
  MIN_GAS_LIMIT: 5000
  NEPHEW_REWARD: 156250000000000000
  POW_EPOCH_LENGTH: 30000
  UNCLE_DEPTH_PENALTY_FACTOR: 8
Is this block a genesis block within the testnet or not?
client_version_string: pyethapp/v1.2.2/linux2/py2.7.9
data_dir: !!python/unicode 'testnetState/'
db: {implementation: LevelDB}
deactivated_services: [pow]
Why is the proof of work a deactivated services attribute?

discovery:
  bootstrap_nodes: ['enode://e4533109cc9bd7604e4ff6c095f7a1d807e15b38e9bfeb05d3b7c423ba86af0a9[email protected]94.242.229.4:40404']
  listen_host: 0.0.0.0
  listen_port: 30303
Why is there an external bootstrap node needed to create an independent testnet

There is also a second block showing up in the output:
eth:
  block:
    ACCOUNT_INITIAL_NONCE: 1048576
    BLKLIM_FACTOR_DEN: 2
    BLKLIM_FACTOR_NOM: 3
    BLOCK_DIFF_FACTOR: 2048
    BLOCK_REWARD: 5000000000000000000
    DIFF_ADJUSTMENT_CUTOFF: 13
    EXPDIFF_FREE_PERIODS: 2
    EXPDIFF_PERIOD: 100000
    GASLIMIT_ADJMAX_FACTOR: 1024
    GASLIMIT_EMA_FACTOR: 1024
    GENESIS_COINBASE: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
    GENESIS_DIFFICULTY: 131072
    GENESIS_EXTRA_DATA: ''
    GENESIS_GAS_LIMIT: 3141592
    GENESIS_INITIAL_ALLOC:
      '0000000000000000000000000000000000000001': {balance: '1'}
      '0000000000000000000000000000000000000002': {balance: '1'}
      '0000000000000000000000000000000000000003': {balance: '1'}
      '0000000000000000000000000000000000000004': {balance: '1'}
      102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
    GENESIS_MIXHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0duralexsedlex"
    GENESIS_NONCE: "\0\0morden"
    GENESIS_PREVHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
      \0\0"
    GENESIS_TIMESTAMP: 0
    HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF: 10
    HOMESTEAD_FORK_BLKNUM: 494000
    MAX_EXTRADATA_LENGTH: 32
    MAX_UNCLES: 2
    MAX_UNCLE_DEPTH: 6
    MIN_DIFF: 131072
    MIN_GAS_LIMIT: 5000
    NEPHEW_REWARD: 156250000000000000
    POW_EPOCH_LENGTH: 30000
    UNCLE_DEPTH_PENALTY_FACTOR: 8
  genesis: /home/mg13/Work/3dtrust/Topics/BlockchainsIn3DPrinting/Apps/pyethapp/pyethapp/genesisdata/genesis_morden.json
  genesis_hash: 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303
  network_id: 2
  pruning: -1
ipc: {ipcpath: /tmp/pyethapp.ipc}
jsonrpc: {corsdomain: '', listen_host: 127.0.0.1, listen_port: 4000}
log_disconnects: false
node: {privkey_hex: 88************************************************************2e}
Does this block point to the genesis block (as in, is it the second block)? If the nonce shows the number of transaction
each block has made, how can this block's nonce value of 1048576 be valid?

The remainder of the output is as below:
p2p:
  bootstrap_nodes: []
  listen_host: 0.0.0.0
  listen_port: 30303
  max_peers: 10
  min_peers: 5
post_app_start_callback: null
pow: {activated: false, coinbase_hex: null, cpu_pct: 100, mine_empty_blocks: true}

WARNING:accounts	keystore directory does not exist directory=/home/mg13/Work/3dtrust/Topics/BlockchainsIn3DPrinting/Apps/testnetState/keystore
WARNING:accounts	no accounts found 
INFO:app	registering service service=accounts
INFO:db	No contrib directory found, so not loading any user services 
INFO:db	opening LevelDB path=testnetState/leveldb max_open_files=128 block_cache_size=8388608 write_buffer_size=4194304
INFO:app	registering service service=db
INFO:p2p.discovery	NodeDiscovery init 
INFO:p2p.discovery	starting discovery proto this_enode=enode://2f6f4e78b747b384f42812c74e3633c40520dc88636d0bb0f27e92815d2846aa9[email protected]0.0.0.0:30303
INFO:app	registering service service=discovery
INFO:p2p.peermgr	PeerManager init 
INFO:app	registering service service=peermanager
INFO:eth.chainservice	initializing chain 
INFO:eth.chain	Initializing new chain 
INFO:eth.chain	new genesis difficulty=131072 genesis_hash=
INFO:eth.chainservice	chain at number=0
INFO:app	registering service service=chain
WARNING:jsonrpc	could not import solidity 
INFO:app	registering service service=jsonrpc
WARNING:jsonrpc	could not import solidity 
INFO:app	registering service service=ipc
INFO:app	registering service service=console
INFO:app	starting 
INFO:p2p.peermgr	starting peermanager 
INFO:p2p.peermgr	starting listener addr=('0.0.0.0', 30303)
INFO:p2p.discovery	starting discovery 
INFO:p2p.discovery	starting listener host=0.0.0.0 port=30303
INFO:jsonrpc	starting IPCRPCServer ipcpath=/tmp/pyethapp.ipc
INFO:jsonrpc	starting JSONRPCServer port=4000
INFO:p2p.peermgr	waiting for bootstrap 
Post edited by askREwsQw on
Sign In or Register to comment.