Node¶
Node¶
-
class
Node
(**kwargs)¶ Implements the node api endpoints.
-
async_loops
(**kwargs) → List[pystratis.api.node.responsemodels.asyncloopsmodel.AsyncLoopsModel]¶ Gets the currently running async loops.
Parameters: **kwargs – Extra keyword arguments. Returns: A list of active asynchronous loops. Return type: List[AsyncLoopsModel] Raises: APIError
– Error thrown by node API. See message for details.
-
decode_raw_transaction
(raw_hex: Union[str, pystratis.core.types.hexstr.hexstr], **kwargs) → pystratis.api.global_responsemodels.transactionmodel.TransactionModel¶ Decodes raw transaction hex into a transaction model.
Parameters: - raw_hex (hexstr, str) – The transaction hexstring.
- **kwargs – Extra keyword arguments.
Returns: A transaction model.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
delete_datafolder_chain
(**kwargs) → None¶ Schedules data folder storing chain state in the datafolder for deletion on the next graceful shutdown.
Parameters: **kwargs – Extra keyword arguments. Returns: None Raises: APIError
– Error thrown by node API. See message for details.
-
get_blockheader
(block_hash: Union[str, pystratis.core.types.uint256.uint256], is_json_format: bool = True, **kwargs) → pystratis.api.node.responsemodels.blockheadermodel.BlockHeaderModel¶ Gets the specified block header.
Parameters: - block_hash (str, uint256) – The specified block hash.
- is_json_format (bool, optional) – If block header should be returned as json. Default=True.
- **kwargs – Extra keyword arguments.
Returns: The block headers.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
get_raw_transaction
(trxid: Union[pystratis.core.types.uint256.uint256, str], verbose: bool = False, **kwargs) → Union[pystratis.core.types.hexstr.hexstr, pystratis.api.global_responsemodels.transactionmodel.TransactionModel]¶ Gets a raw transaction from a transaction id.
Requires txindex=1 in node configuration.
Parameters: - trxid (uint256, str) – The transaction hash.
- verbose (bool, optional) – If output should include verbose transaction data. Default=False.
- **kwargs – Extra keyword arguments.
Returns: A raw transaction.
Return type: Union[hexstr, TransactionModel]
Raises: APIError
– Error thrown by node API. See message for details.
-
get_txout
(trxid: Union[pystratis.core.types.uint256.uint256, str], vout: int, include_mempool: bool = True, **kwargs) → pystratis.api.node.responsemodels.gettxoutmodel.GetTxOutModel¶ Gets a specified txout from a given transaction.
Parameters: - trxid (uint256, str) – The trxid to check.
- vout (int) – The vout.
- include_mempool (bool, optional) – Include mempool in check. Default=True.
- **kwargs – Extra keyword arguments.
Returns: The specified txout.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
get_txout_proof
(txids: List[Union[str, pystratis.core.types.uint256.uint256]], block_hash: Union[pystratis.core.types.uint256.uint256, str], **kwargs) → pystratis.core.types.hexstr.hexstr¶ The merkle proof that the specified transaction exist in a given block.
Should have txindex enabled if not specifying blockhash.
Parameters: Returns: The merkle proof.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
log_levels
(log_rules: List[pystratis.api.logrule.LogRule], **kwargs) → None¶ Changes log level for the specified loggers.
Parameters: - log_rules (List[LogRule]) – A list of log rules to change.
- **kwargs – Extra keyword arguments.
Returns: None
Raises: APIError
– Error thrown by node API. See message for details.
-
log_rules
(**kwargs) → List[pystratis.api.logrule.LogRule]¶ Returns the enabled log rules.
Parameters: **kwargs – Extra keyword arguments. Returns: A list of active log rules. Return type: List[LogRule] Raises: APIError
– Error thrown by node API. See message for details.
-
rewind
(height: int, **kwargs) → str¶ Signals the node to rewind to the specified height. This will be done via writing a flag to the .conf file so that on startup it be executed.
Parameters: - height (int) – The specified height to rewind to on restart.
- **kwargs – Extra keyword arguments.
Returns: str
Raises: APIError
– Error thrown by node API. See message for details.
-
shutdown
(**kwargs) → None¶ Triggers node shutdown.
Parameters: **kwargs – Extra keyword arguments. Returns: None Raises: APIError
– Error thrown by node API. See message for details.
-
status
(publish: bool = False, **kwargs) → pystratis.api.node.responsemodels.statusmodel.StatusModel¶ Gets the node status.
Parameters: - publish (bool) – If true, publish a full node event with the status.
- **kwargs – Extra keyword arguments.
Returns: Information about the node status.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
stop
(**kwargs) → None¶ Triggers node shutdown.
Parameters: **kwargs – Extra keyword arguments. Returns: None Raises: APIError
– Error thrown by node API. See message for details.
-
validate_address
(address: str, **kwargs) → pystratis.api.node.responsemodels.validateaddressmodel.ValidateAddressModel¶ Validate an address
Parameters: - address (str) – The address to validate.
- **kwargs – Extra keyword arguments.
Returns: Information on the validity of the provided address, and if valid, if it is a witness or script address.
Return type: Raises: APIError
– Error thrown by node API. See message for details.
-
TransactionModel¶
-
class
TransactionModel
A pydantic model for a transaction.