bbc1.core.bbc_core module — BBc1 1.2 documentation

# bbc1.core.bbc_core module

:” .

exec python “$0” “$@”

class `bbc1.core.bbc_core.` `BBcCoreService`(p2p_port=None, core_port=None, use_domain0=False, ip4addr=None, ip6addr=None, workingdir='.bbc1', configfile=None, use_nodekey=None, use_ledger_subsystem=False, default_conffile=None, loglevel='all', logname='-', server_start=True)

  Bases: `object`

  Base service object of BBc-1

  `count_transactions`(domain_id, asset_group_id=None, asset_id=None, user_id=None)

    Count transactions that match given conditions

    When Multiple conditions are given, they are considered as AND condition.

    Parameters: | domain_id (bytes) – target domain_id asset_group_id (bytes) – asset_group_id that target transactions should have asset_id (bytes) – asset_id that target transactions should have user_id (bytes) – user_id that target transactions should have
    Returns: | the number of transactions
    Return type: | int

  `insert_transaction`(domain_id, txdata, asset_files)

    Insert transaction into ledger

    Parameters: | domain_id (bytes) – target domain_id txdata (bytes) – serialized transaction data asset_files (dict) – dictionary of {asset_id: content} for the transaction
    Returns: | inserted transaction_id or error message
    Return type: | dict|str

  `quit_program`()

    Processes when quiting program

  `remove_from_notification_list`(domain_id, asset_group_id, user_id)

    Remove entry from insert completion notification list

    This method checks validation only.

    Parameters: | domain_id (bytes) – target domain_id asset_group_id (bytes) – target asset_group_id of which you want to get notification about the insertion user_id (bytes) – user_id that registers in the list

  `search_transaction_with_condition`(domain_id, asset_group_id=None, asset_id=None, user_id=None, direction=0, count=1)

    Search transactions that match given conditions

    When Multiple conditions are given, they are considered as AND condition.

    Parameters: | domain_id (bytes) – target domain_id asset_group_id (bytes) – asset_group_id that target transactions should have asset_id (bytes) – asset_id that target transactions should have user_id (bytes) – user_id that target transactions should have direction (int) – 0: descend, 1: ascend count (int) – The maximum number of transactions to retrieve (self.search_max_count is the upper bound)
    Returns: | dictionary having transaction_id, serialized transaction data, asset files
    Return type: | dict

  `send_inserted_notification`(domain_id, asset_group_ids, transaction_id, only_registered_user=False)

    Broadcast NOTIFY_INSERTED

    Parameters: | domain_id (bytes) – target domain_id asset_group_ids (list) – list of asset_group_ids transaction_id (bytes) – transaction_id that has just inserted only_registered_user (bool) – If True, notification is not sent to other nodes

  `validate_transaction`(txdata, asset_files=None)

    Validate transaction by verifying signature

    Parameters: | txdata (bytes) – serialized transaction data asset_files (dict) – dictionary of {asset_id: content} for the transaction
    Returns: | if validation fails, None returns. int (short): 2-byte value of BBcFormat type or None
    Return type: | BBcTransaction

`bbc1.core.bbc_core.` `activate_ledgersubsystem`()

  Load module of ledger_subsystem if installed

`bbc1.core.bbc_core.` `daemonize`(pidfile='/tmp/bbc1.pid')

  Run in background