kogeler.chain.sudo_schedule_para_initialize (1.5.1) — module

Schedule a para to be initialized at the start of the next session.

| "added in version" 0.0.1 of kogeler.chain"

Authors: Bulat Saifullin (@BulatSaif)

Install collection

Install with ansible-galaxy collection install kogeler.chain:==1.5.1


Add to requirements.yml

  collections:
    - name: kogeler.chain
      version: 1.5.1

Description

Schedule a para to be initialized at the start of the next session by using sudo account.

This module is wrapper for substrate-interface python library.

Only for testnets, requires SUDO.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Register parachain id 1000
- name: Register parachain 
  infrastructure.chain_operations.sudo_schedule_para_initialize:
    url: 'ws://127.0.0.1:9944'
    key: "//Alice"
    key_type: uri
    id: "1000"
    genesis_head: "0x41"
    validation_code: "0x1111"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    
# use key hex seed 
- name: Register parachain 
  infrastructure.chain_operations.sudo_schedule_para_initialize:
    url: 'ws://127.0.0.1:9944'
    key: "0x56...92"
    id: "1000"
    genesis_head: "{{ lookup('file', 'path/to/genesis-state') }}"
    validation_code: "{{ lookup('file', 'path/to/genesis-wasm') }}"

Inputs

    
id:
    description: Para Id
    required: true
    type: int

key:
    description: Key to  commit transaction.
    required: true
    type: str

url:
    description: WS rpc endpoint.
    required: true
    type: str

state:
    default: present
    description: Whether to onboard (present), or cleanup (absent) a parachain.
    required: false
    type: choices=['present', 'absent']

key_type:
    default: seed
    description: Key type hex seed or uri
    required: false
    type: choices=['seed', 'uri']

parachain:
    default: true
    description: parachain
    required: false
    type: bool

genesis_head:
    description: Head data for a Para Id
    required: true
    type: bool

validation_code:
    description: Validation code for a Para Id.
    required: true
    type: str

Outputs

parachain:
  contains:
    currentCodeHash:
      description: Current wasm hash in network for ParaId
      returned: always
      sample: '0x0b004419ddaed13fd1f08044685597485b1054e61ea2d293346205fea0d6d500'
      type: str
    paraLifecycles:
      description: Current state of parachain
      returned: always
      sample: Parachain
      type: str
  description: Receipt returned by substrate-interface
  returned: always
  type: complex
receipt:
  contains:
    block_hash:
      description:
      - block_hash where extrinsic is included, you can use it in polkadot.js.org
      - Example: https://polkadot.js.org/apps/#/explorer/query/0xc3c238e11de1e0e74ca076b002934d437a4c5a044cdc91cf7835c09f82a941d6
      returned: always
      sample: '0xc3c238e11de1e0e74ca076b002934d437a4c5a044cdc91cf7835c09f82a941d6'
      type: str
    error_message:
      description: Returns the error message if the extrinsic failed in format
      returned: always
      sample:
        docs: Bad origin
        name: BadOrigin
        type: System
      type: dict
    extrinsic_hash:
      description: Extrinsic hash
      returned: always
      sample: '0xf9b9acd0dcb6cead3db84cb1046350df148e2a9ab9494e9da8ab894a43c2b115'
      type: str
    extrinsic_idx:
      description: Retrieves the index of this extrinsic in containing block
      returned: always
      sample: 4
      type: int
    finalized:
      description: Is finalized
      returned: always
      sample: false
      type: bool
    is_success:
      description:
      - Returns True if ExtrinsicSuccess event is triggered,
      - False in case of ExtrinsicFailed In case of False error_message will contain
        more details about the error
      returned: always
      sample: true
      type: bool
    total_fee_amount:
      description:
      - Contains the total fee costs deducted when executing this extrinsic.
      - This includes fee for the validator ( (Balances.Deposit event) and the fee
        deposited for the treasury (Treasury.Deposit event)
      returned: always
      sample: 54907300087520
      type: int
    triggered_events:
      description:
      - Gets triggered events for submitted extrinsic. block_hash where extrinsic
        is included is required,
      - manually set block_hash or use wait_for_inclusion when submitting extrinsic
      returned: always
      sample:
      - attributes:
        - 5FeyRQmjtdHoPH56ASFW76AJEP1yaQC1K9aEMvJTF9nzt9S9
        - 54907300087520
        event:
          attributes:
          - 5FeyRQmjtdHoPH56ASFW76AJEP1yaQC1K9aEMvJTF9nzt9S9
          - 54907300087520
          event_id: Withdraw
          event_index: 0408
          module_id: Balances
        event_id: Withdraw
        event_index: 4
        extrinsic_idx: 4
        module_id: Balances
        phase: ApplyExtrinsic
        topics: []
      - attributes:
        - '0x0b004419ddaed13fd1f08044685597485b1054e61ea2d293346205fea0d6d500'
        - 524
        event:
          attributes:
          - '0x0b004419ddaed13fd1f08044685597485b1054e61ea2d293346205fea0d6d500'
          - 524
          event_id: PvfCheckStarted
          event_index: '1305'
          module_id: Paras
        event_id: PvfCheckStarted
        event_index: 19
        extrinsic_idx: 4
        module_id: Paras
        phase: ApplyExtrinsic
        topics: []
      - attributes:
        - '0x0b004419ddaed13fd1f08044685597485b1054e61ea2d293346205fea0d6d500'
        - 524
        event:
          attributes:
          - '0x0b004419ddaed13fd1f08044685597485b1054e61ea2d293346205fea0d6d500'
          - 524
          event_id: PvfCheckAccepted
          event_index: '1306'
          module_id: Paras
        event_id: PvfCheckAccepted
        event_index: 19
        extrinsic_idx: 4
        module_id: Paras
        phase: ApplyExtrinsic
        topics: []
      - attributes:
          Ok: []
        event:
          attributes:
            Ok: []
          event_id: Sudid
          event_index: '2000'
          module_id: Sudo
        event_id: Sudid
        event_index: 32
        extrinsic_idx: 4
        module_id: Sudo
        phase: ApplyExtrinsic
        topics: []
      - attributes:
        - 5FeyRQmjtdHoPH56ASFW76AJEP1yaQC1K9aEMvJTF9nzt9S9
        - 54907300087520
        event:
          attributes:
          - 5FeyRQmjtdHoPH56ASFW76AJEP1yaQC1K9aEMvJTF9nzt9S9
          - 54907300087520
          event_id: Deposit
          event_index: '0407'
          module_id: Balances
        event_id: Deposit
        event_index: 4
        extrinsic_idx: 4
        module_id: Balances
        phase: ApplyExtrinsic
        topics: []
      - attributes:
          class: Operational
          pays_fee: 'Yes'
          weight: 11000
        event:
          attributes:
            class: Operational
            pays_fee: 'Yes'
            weight: 11000
          event_id: ExtrinsicSuccess
          event_index: '0000'
          module_id: System
        event_id: ExtrinsicSuccess
        event_index: 0
        extrinsic_idx: 4
        module_id: System
        phase: ApplyExtrinsic
        topics: []
      type: List
    weight:
      description: Contains the actual weight when executing this extrinsic
      returned: always
      sample: 11000
      type: int
  description: Receipt returned by substrate-interface
  returned: always
  type: complex