getConstants

Tezos RPC

Archive Method

Only on the full archive nodes. Complex queries might take longer and incur additional cost

How to use it

// Import required libraries and modules from Tatum SDK
import { TatumSDK, Tezos, Network } from '@tatumio/tatum';

// Initialize the Tatum SDK for Tezos
const tatum = await TatumSDK.init<Tezos>({ network: Network.TEZOS });

// Fetch the constants from the Tezos blockchain
const constants = await tatum.rpc.getConstants();

// Log the constants
console.log('Tezos Constants:', constants);

// Always destroy the Tatum SDK instance when done to stop any background processes
await tatum.destroy();

Overview

The getConstants method allows you to retrieve all the constants from the Tezos blockchain. These constants include various operational parameters like proof of work nonce size, max operation data length, and others that are crucial for understanding the blockchain's current configuration.

Example use cases:

  1. Blockchain Configuration Analysis:
    Developers and researchers can use this method to obtain detailed information about the Tezos blockchain's current configuration, aiding in development and analysis.

  2. Smart Contract Development:
    Smart contract developers can use these constants to better understand the operational parameters of the Tezos blockchain, ensuring their contracts are optimized for the current environment.

  3. Operational Monitoring:
    This method can be used for monitoring the blockchain's parameters, which can be crucial for applications that depend on these constants for their operation.

Request Parameters

The getConstants method does not require any parameters.

Return Object

The getConstants method returns an object containing various constants from the Tezos blockchain. These constants include, but are not limited to:

  • proof_of_work_nonce_size (number): Size of the nonce in proof of work.
  • nonce_length (number): Length of the nonce.
  • max_anon_ops_per_block (number): Maximum anonymous operations per block.
  • max_operation_data_length (number): Maximum data length for operations.
  • max_proposals_per_delegate (number): Max proposals per delegate.
  • max_micheline_node_count (number): Max node count in Micheline.
  • max_micheline_bytes_limit (number): Max byte size for Micheline.
  • max_allowed_global_constants_depth (number): Max depth for global constants.
  • cache_layout_size (number): Size of cache layout.
  • michelson_maximum_type_size (number): Maximum size for Michelson types.
  • smart_rollup_max_wrapped_proof_binary_size (number): Max size for wrapped proof binaries in smart rollups.
  • smart_rollup_message_size_limit (number): Message size limit in smart rollups.
  • smart_rollup_max_number_of_messages_per_level (number): Max messages per level in smart rollups.
  • preserved_cycles (number): Number of cycles to preserve.
  • blocks_per_cycle (number): Number of blocks per cycle.
  • blocks_per_commitment (number): Blocks per commitment.
  • nonce_revelation_threshold (number): Threshold for nonce revelation.
  • blocks_per_stake_snapshot (number): Blocks per stake snapshot.
  • cycles_per_voting_period (number): Cycles per voting period.
  • hard_gas_limit_per_operation (number): Hard gas limit per operation.
  • hard_gas_limit_per_block (number): Hard gas limit per block.
  • proof_of_work_threshold (number): Threshold for proof of work.
  • minimal_stake (number): Minimal stake requirement.
  • vdf_difficulty (number): Difficulty for VDF.
  • seed_nonce_revelation_tip (number): Tip for seed nonce revelation.
  • origination_size (number): Size of origination.
  • baking_reward_fixed_portion (number): Fixed portion of baking reward.
  • baking_reward_bonus_per_slot (number): Bonus reward per slot for baking.
  • endorsing_reward_per_slot (number): Reward per slot for endorsing.
  • cost_per_byte (number): Cost per byte.
  • hard_storage_limit_per_operation (number): Hard storage limit per operation.
  • quorum_min (number): Minimum quorum.
  • quorum_max (number): Maximum quorum.
  • min_proposal_quorum (number): Minimum proposal quorum.
  • liquidity_baking_subsidy (number): Subsidy for liquidity baking.
  • liquidity_baking_toggle_ema_threshold (number): EMA threshold for liquidity baking toggle.
  • max_operations_time_to_live (number): Max TTL for operations.
  • minimal_block_delay (number): Minimum delay between blocks.
  • delay_increment_per_round (number): Delay increment per round.
  • consensus_committee_size (number): Size of the consensus committee.
  • consensus_threshold (number): Threshold for consensus.
  • minimal_participation_ratio (number): Minimum participation ratio.
  • max_slashing_period (number): Maximum slashing period.
  • frozen_deposits_percentage (number): Percentage of frozen deposits.
  • double_baking_punishment (number): Punishment for double baking.
  • ratio_of_frozen_deposits_slashed_per_double_endorsement (number): Ratio of frozen deposits slashed per double endorsement.
  • cache_script_size (number): Size limit for cached scripts.
  • cache_stake_distribution_cycles (number): Number of cycles for caching stake distribution.
  • cache_sampler_state_cycles (number): Cycles for caching sampler state.
  • tx_rollup_enable (boolean): Flag to enable transaction rollups.
  • tx_rollup_origination_size (number): Size limit for origination in transaction rollups.
  • tx_rollup_hard_size_limit_per_inbox (number): Hard size limit per inbox in transaction rollups.
  • tx_rollup_hard_size_limit_per_message (number): Hard size limit per message in transaction rollups.
  • tx_rollup_max_withdrawals_per_batch (number): Maximum withdrawals allowed per batch in transaction rollups.
  • tx_rollup_commitment_bond (mutez): Bond required for commitment in transaction rollups.
  • tx_rollup_finality_period (number): Finality period for transaction rollups.
  • tx_rollup_withdraw_period (number): Withdrawal period for transaction rollups.
  • tx_rollup_max_inboxes_count (number): Maximum inboxes count for transaction rollups.
  • tx_rollup_max_messages_per_inbox (number): Maximum messages per inbox in transaction rollups.
  • tx_rollup_max_commitments_count (number): Maximum commitments count in transaction rollups.
  • tx_rollup_cost_per_byte_ema_factor (number): EMA factor for cost per byte in transaction rollups.
  • tx_rollup_max_ticket_payload_size (number): Maximum ticket payload size in transaction rollups.
  • tx_rollup_rejection_max_proof_size (number): Maximum proof size for rejection in transaction rollups.
  • tx_rollup_sunset_level (number): Sunset level for transaction rollups.
  • dal_parametric (object): Parameters for Data Availability Layer.
  • smart_rollup_enable (boolean): Flag to enable smart rollups.
  • smart_rollup_arith_pvm_enable (boolean): Enable arithmetic proof verification mechanism in smart rollups.
  • smart_rollup_origination_size (number): Origination size limit for smart rollups.
  • smart_rollup_challenge_window_in_blocks (number): Challenge window in blocks for smart rollups.
  • smart_rollup_stake_amount (mutez): Stake amount required for smart rollups.
  • smart_rollup_commitment_period_in_blocks (number): Commitment period in blocks for smart rollups.
  • smart_rollup_max_lookahead_in_blocks (number): Maximum lookahead in blocks for smart rollups.
  • smart_rollup_max_active_outbox_levels (number): Maximum active outbox levels in smart rollups.
  • smart_rollup_max_outbox_messages_per_level (number): Maximum outbox messages per level in smart rollups.
  • smart_rollup_number_of_sections_in_dissection (number): Number of sections in dissection for smart rollups.
  • smart_rollup_timeout_period_in_blocks (number): Timeout period in blocks for smart rollups.
  • smart_rollup_max_number_of_cemented_commitments (number): Max number of cemented commitments in smart rollups.
  • smart_rollup_max_number_of_parallel_games (number): Max number of parallel games in smart rollups.
  • zk_rollup_enable (boolean): Flag to enable zero-knowledge rollups.
  • zk_rollup_origination_size (number): Origination size for zero-knowledge rollups.
  • zk_rollup_min_pending_to_process (number): Minimum pending transactions to process in zero-knowledge rollups.

(Note: The actual return object will contain a comprehensive list of all Tezos constants, and the fields might vary based on the blockchain's implementation and version.)