コード例 #1
0
ファイル: console.py プロジェクト: raiden-network/raiden
import IPython
from devp2p.service import BaseService
from ethereum.slogging import getLogger
from ethereum._solidity import compile_file
from ethereum.utils import denoms
from gevent.event import Event
from IPython.lib.inputhook import inputhook_manager
from pyethapp.utils import bcolors as bc
from pyethapp.jsonrpc import address_encoder
from pyethapp.console_service import GeventInputHook, SigINTHandler

from raiden.utils import events, get_contract_path

# ipython needs to accept "--gui gevent" option
IPython.core.shellapp.InteractiveShellApp.gui.values += ('gevent',)
inputhook_manager.register('gevent')(GeventInputHook)


def print_usage():
    print("\t{}use `{}raiden{}` to interact with the raiden service.".format(
        bc.OKBLUE, bc.HEADER, bc.OKBLUE))
    print("\tuse `{}chain{}` to interact with the blockchain.".format(bc.HEADER, bc.OKBLUE))
    print("\tuse `{}discovery{}` to find raiden nodes.".format(bc.HEADER, bc.OKBLUE))
    print("\tuse `{}tools{}` for convenience with tokens, channels, funding, ...".format(
        bc.HEADER, bc.OKBLUE))
    print("\tuse `{}denoms{}` for ether calculations".format(bc.HEADER, bc.OKBLUE))
    print("\tuse `{}lastlog(n){}` to see n lines of log-output. [default 10] ".format(
        bc.HEADER, bc.OKBLUE))
    print("\tuse `{}lasterr(n){}` to see n lines of stderr. [default 1]".format(
        bc.HEADER, bc.OKBLUE))
    print("\tuse `{}help(<topic>){}` for help on a specific topic.".format(bc.HEADER, bc.OKBLUE))
コード例 #2
0
ファイル: console.py プロジェクト: westernwilliam/raiden
import IPython
from devp2p.service import BaseService
from ethereum.slogging import getLogger
from ethereum._solidity import compile_file
from ethereum.utils import denoms
from gevent.event import Event
from IPython.lib.inputhook import inputhook_manager
from pyethapp.utils import bcolors as bc
from pyethapp.jsonrpc import address_decoder, default_gasprice
from pyethapp.console_service import GeventInputHook, SigINTHandler

from raiden.utils import events, get_contract_path, safe_address_decode

# ipython needs to accept "--gui gevent" option
IPython.core.shellapp.InteractiveShellApp.gui.values += ('gevent', )
inputhook_manager.register('gevent')(GeventInputHook)


def print_usage():
    print("\t{}use `{}raiden{}` to interact with the raiden service.".format(
        bc.OKBLUE, bc.HEADER, bc.OKBLUE))
    print("\tuse `{}chain{}` to interact with the blockchain.".format(
        bc.HEADER, bc.OKBLUE))
    print("\tuse `{}discovery{}` to find raiden nodes.".format(
        bc.HEADER, bc.OKBLUE))
    print(
        "\tuse `{}tools{}` for convenience with tokens, channels, funding, ..."
        .format(bc.HEADER, bc.OKBLUE))
    print("\tuse `{}denoms{}` for ether calculations".format(
        bc.HEADER, bc.OKBLUE))
    print("\tuse `{}lastlog(n){}` to see n lines of log-output. [default 10] ".