Package: pystarport
pystarport is like acosmos starportwithout the scaffolding feature. it's mainly used for development and testing. It's developed for the Crypto.org Chain, but
it can also be used for any cosmos-sdk based projects.Configurationa typical configuration for a devnet is like this:chainmaind:
  cmd: chain-maind  # chain binary to use, optional
  validators:  # genesis validators
    - coins: 10cro
      staked: 10cro
    - coins: 10cro
      staked: 10cro
  accounts:  # genesis accounts
    - name: community
      coins: 100cro
    - name: ecosystem
      coins: 200cro
    - name: reserve
      coins: 200cro
      vesting_coins: 100cro # if not provided, the all of coins will be vested
      vesting: "1d"
    - name: launch
      coins: 100cro
  genesis:  # patch genesis states
   app_state:
     staking:
       params:
         unbonding_time: "10s"Thevalidatorssection defines how many nodes to run, for each node, a home directory is initialized indata/node{i}, and a validator account with specified coins is created.Theaccountsdefines other non-validator accounts, they are created innode0's keyring.In thegenesissection you can override any genesis configuration with the same json path.UsageNAME
    pystarport serve - prepare and start a devnet from scatch

SYNOPSIS
    pystarport serve <flags>

DESCRIPTION
    prepare and start a devnet from scatch

FLAGS
    --data=DATA
        Type: str
        Default: './data'
        path to the root data directory
    --config=CONFIG
        Type: str
        Default: './config.yaml'
        path to the configuration file
    --base_port=BASE_PORT
        Type: int
        Default: 26650
        the base port to use, the service ports of different nodes are calculated based on this
    --cmd=CMD
        Type: str
        Default: 'chain-maind'
        the chain binary to usePort rulesThe rules to calculate service ports based on base port is defined in theports.pymodule.For example, with default base port26650, the url of api servers of the nodes would be:Node0:http://127.0.0.1:26654Node1:http://127.0.0.1:26664The swagger doc of node0 ishttp://127.0.0.1:26654/swagger/The default rpc port used bychain-maindis26657, that's the default node0's rpc port, so you can usechain-maindwithout change to access node0's rpc.Supervisorpystarportembeded asupervisorto manage processes of multiple nodes, you can usepystarport supervisorctlto manage the processes:$ pystarport supervisorctl status
node0                            RUNNING   pid 35210, uptime 0:00:29
node1                            RUNNING   pid 35211, uptime 0:00:29
$ pystarport supervisorctl help

default commands (type help <topic>):
=====================================
add    exit      open  reload  restart   start   tail
avail  fg        pid   remove  shutdown  status  update
clear  maintail  quit  reread  signal    stop    versionOr enter an interactive shell:$ pystarport supervisorctl
node0                            RUNNING   pid 35210, uptime 0:01:53
node1                            RUNNING   pid 35211, uptime 0:01:53
supervisor>CliAfter started the chain, you can usechain-maindcli directly, there are also some wrapper commands provided bypystarport cli. It understands the directory structure and port rules, also assumingkeyring-backend=test, and there
are shortcuts for commonly used commands, so arguments are shorter.$ pystarport cli - --help
...Transaction BotA simple transaction bot that works for cluster created by pystarport as well as a local nodeCopy and modifybot.yaml.sampletobot.yamlwith your desired bot configurations.If you are running on a pystarport created cluster:Make sure you have provide thenodefor each job in thebot.yamlRun the command$ pystarport bot --chain-id=[cluster_chain_id] - startIf you are running on a local node$ pstarport bot --node_rpc=tcp://127.0.0.1:26657 --data=/path/to/your/local/node/home/ - startdocker-composeWhen used withdocker-composeor multiple machines, you need to config hostnames, and you probabely want to use a samebase_portsince you don't have port conflicts, you can config thevalidatorslike this:validators:-coins:10crostaked:10crobase_port:26650hostname:node0-coins:10crostaked:10crobase_port:26650hostname:node1pystarport init --gen_compose_filewill also generate adocker-compose.ymlfile for you.IBCIt can setup multiple devnets at once, and connect them with ibc relayer.ibc-0:
  validators:
    - coins: 10cro
      staked: 10cro
      base_port: 26650
    - coins: 10cro
      staked: 10cro
  accounts:
    - name: relayer
      coins: 100cro
  genesis:
    app_state:
      transfer:
        params:
          receive_enabled: true
          send_enabled: true
ibc-1:
  validators:
    - coins: 10cro
      staked: 10cro
      base_port: 26750
    - coins: 10cro
      staked: 10cro
      base_port: 26760
  accounts:
    - name: relayer
      coins: 100cro
  genesis:
    app_state:
      transfer:
        params:
          receive_enabled: true
          send_enabled: true
relayer: # refer here (https://hermes.informal.systems/config.html) for more configs
  global:
    strategy: 'packets'
    log_level: 'info'
  chains:
    - id: "ibc-0" # id is needed to match chain id
      trusting_period: "20s"
    - id: "ibc-1" # id is needed to match chain id
      trusting_period: "20s"With following commands to setup ibc, you are ready to play with ibc functionalities:# spawn the devnets
pystarport serve --config ibc.yaml
# setup ibc channel
hermes -c data/relayer.toml create channel ibc-0 ibc-1 --port-a transfer --port-b transfer
# start relayer process
supervisorctl -c data/tasks.ini start relayer-demoDevelopmentSet up development environmentMore aboutpoetry.poetry installRecommended VS Code workspace settingsRemember to runpoetry env infoafterpoetry installand update thispython.defaultInterpreterPath{"python.formatting.provider":"black",// after running `poetry env info`, change python.defaultInterpreterPath to Path under Virtualenv"python.defaultInterpreterPath":"~/Library/Caches/pypoetry/virtualenvs/to_be_updated","editor.formatOnSave":true,"python.linting.flake8Enabled":true,"python.formatting.blackArgs":["--line-length=88"],"python.sortImports.args":["--profile","black"],"[python]":{"editor.codeActionsOnSave":{"source.organizeImports":true}}}TestInstall jsonnetMore aboutjsonnet.make testFAQHave this error on Mac: `AF_UNIX path too long´Set environment variableTMPPATH=/tmpto shorten the unix domain socket path.