### Install and Start PostgreSQL on macOS Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Use Homebrew to install and start the PostgreSQL service. ```bash brew install postgresql@16 ``` ```bash brew services start postgresql@16 ``` -------------------------------- ### Start PostgreSQL Server Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Starts the PostgreSQL server using the initialized data directory and logs output to a file. ```bash pg_ctl -D .data -l logfile start ``` -------------------------------- ### Swap Transaction Example Source: https://context7.com/penumbra-zone/penumbra/llms.txt Example demonstrating how to execute a private swap through the DEX using the Penumbra Rust SDK. ```APIDOC ## Swap Transaction Example Execute a private swap through the DEX. ### Steps 1. Parse input and target assets. 2. Obtain the claim address. 3. Calculate the estimated claim fee. 4. Plan the swap using `Planner`. 5. Submit the swap transaction. 6. After confirmation, claim the swap outputs using `Planner` and `SwapClaimPlan`. ### Code Example ```rust use penumbra_sdk_asset::{asset, Value}; use penumbra_sdk_dex::swap_claim::SwapClaimPlan; use penumbra_sdk_wallet::plan::Planner; // Parse input and target asset let input: Value = "100penumbra".parse()?; let into = asset::REGISTRY.parse_unit("gm").base(); // Get claim address for swap outputs let (claim_address, _) = fvk.incoming().payment_address(AddressIndex::new(0)); // Calculate estimated claim fee let estimated_claim_fee = gas_prices .fee(&swap_claim_gas_cost()) .apply_tier(FeeTier::Low.into()); // Plan the swap let mut planner = Planner::new(OsRng); planner .set_gas_prices(gas_prices) .set_fee_tier(FeeTier::Low.into()) .swap(input, into.id(), estimated_claim_fee, claim_address)?; let plan = planner.plan(&view_client, AddressIndex::new(0)).await?; // Submit swap transaction app.build_and_submit_transaction(plan).await?; // After confirmation, claim the swap outputs let swap_record = view_client.swap_by_commitment(swap_commitment).await?; let mut claim_planner = Planner::new(OsRng); claim_planner .set_gas_prices(gas_prices) .swap_claim(SwapClaimPlan { swap_plaintext, position: swap_record.position, output_data: swap_record.output_data, epoch_duration: params.sct_params.epoch_duration, proof_blinding_r: Fq::rand(&mut OsRng), proof_blinding_s: Fq::rand(&mut OsRng), }); let claim_plan = claim_planner.plan(&view_client, AddressIndex::new(0)).await?; app.build_and_submit_transaction(claim_plan).await?; ``` ``` -------------------------------- ### Run Indexer Tools Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Execute the pindexer binary or fmd_clues example to process database data. ```bash cargo run --bin pindexer -- -s "postgresql://localhost:5432/testnet_raw?sslmode=disable" -d "postgresql://localhost:5432/testnet_compiled?sslmode=disable" ``` ```bash cargo run --example fmd_clues -- -s "postgresql://localhost:5432/testnet_raw?sslmode=disable" -d "postgresql://localhost:5432/testnet_compiled?sslmode=disable" ``` -------------------------------- ### Install System Dependencies Source: https://github.com/penumbra-zone/penumbra/wiki/Deployment-checklist Installs essential packages required for building and running Penumbra. This includes Python, Docker, build tools, and SSL libraries. ```bash sudo apt-get install python3 docker-compose build-essential pkg-config libssl-dev clang libclang-dev ``` -------------------------------- ### Install Rust Toolchain Source: https://github.com/penumbra-zone/penumbra/wiki/Deployment-checklist Installs the Rust programming language toolchain using the official installer script. This is necessary for compiling Rust-based projects like Penumbra. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Initialize elcuity Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/bin/elcuity/README.md Base command structure for starting elcuity with required gRPC and view service endpoints. ```bash elcuity --grpc-url <...> --view-service <...> ``` -------------------------------- ### Transaction Planning with Rust SDK Source: https://context7.com/penumbra-zone/penumbra/llms.txt Example demonstrating how to programmatically build transactions using the Penumbra SDK in Rust. ```APIDOC ## Transaction Planning with Rust SDK Build transactions programmatically using the Penumbra SDK. ### Usage 1. Initialize a `Planner`. 2. Configure gas prices and fee tier. 3. Add transaction outputs using the `output` method. 4. Call `plan` to generate the transaction plan. 5. Use `app.build_and_submit_transaction` to submit the plan. ### Code Example ```rust use penumbra_sdk_keys::keys::AddressIndex; use penumbra_sdk_asset::Value; use penumbra_sdk_wallet::plan::Planner; use rand_core::OsRng; // Create a planner for building transactions let mut planner = Planner::new(OsRng); // Set gas prices and fee tier planner .set_gas_prices(gas_prices) .set_fee_tier(FeeTier::Low.into()); // Add an output to send funds let destination: Address = "penumbra1...".parse()?; let value: Value = "100penumbra".parse()?; planner.output(value, destination); // Build the transaction plan let plan = planner .memo("Payment memo".to_string()) .plan(&view_client, AddressIndex::new(0)) .await?; // Build and submit the transaction app.build_and_submit_transaction(plan).await?; ``` ``` -------------------------------- ### Install CometBFT Schema Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Applies the required SQL schema to the database. ```bash psql --file=crates/util/cometindex/vendor/schema.sql "postgresql://localhost:5432/testnet_raw?sslmode=disable" ``` -------------------------------- ### Install SQLx CLI Source: https://github.com/penumbra-zone/penumbra/wiki/Deployment-checklist Installs the SQLx Command Line Interface, a tool for working with SQL databases in Rust projects. This is often used for database migrations and schema management. ```bash cargo install sqlx-cli ``` -------------------------------- ### Verify Start Position Source: https://github.com/penumbra-zone/penumbra/blob/main/docs/protocol/src/governance/action/delegator_vote.md Verifies that the staked note's position is less than the proposal's start position, ensuring the note existed prior to the proposal. Also certifies the start position commitment index is zero. ```rust pos < start_pos ``` -------------------------------- ### Run Interactive TCT Visualization Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/misc/tct-visualize/README.md Starts the interactive visualization server accessible at http://0.0.0.0:8080. ```bash cargo run --release --bin tct-live-edit ``` -------------------------------- ### Phase 1 Contribution Proofs Source: https://github.com/penumbra-zone/penumbra/blob/main/docs/protocol/src/setup/contributions.md These are the discrete logarithm proofs generated as part of a contribution in Phase 1 of the setup ceremony. They attest to the knowledge of new secret values. ```plaintext 1. $\pi_1 \gets P_{\text{DL}}(\text{ctx}, \hat{\alpha} \cdot [\alpha]_1, [\alpha]_1; \hat{\alpha})$ 2. $\pi_2 \gets P_{\text{DL}}(\text{ctx}, \hat{\beta} \cdot [\beta]_1, [\beta]_1; \hat{\beta})$ 3. $\pi_3 \gets P_{\text{DL}}(\text{ctx}, \hat{x} \cdot [x]_1, [x]_1; \hat{x})$ ``` -------------------------------- ### Auction NFT Denom String Examples Source: https://github.com/penumbra-zone/penumbra/blob/main/docs/padr/PADR-001_Dutch_Auctions.md Examples of how auction NFT denom strings are constructed, combining sequence number and bech32 encoded AuctionId. ```text auctionnft_{seq}_{bech32(id)} auctionnft_0_paucid17cx8tf0l9476ep4vzktj65jt924a2e2f6njkfw39jnpd78xfp2zs0yastl auctionnft_1_paucid17cx8tf0l9476ep4vzktj65jt924a2e2f6njkfw39jnpd78xfp2zs0yastl auctionnft_2_paucid17cx8tf0l9476ep4vzktj65jt924a2e2f6njkfw39jnpd78xfp2zs0yastl ``` -------------------------------- ### Check pcli Version Source: https://github.com/penumbra-zone/penumbra/blob/main/tools/summonerd/templates/main.html Verify that the Penumbra command-line interface (pcli) is installed and is using the required version (v0.64.0). ```bash pcli --version ``` -------------------------------- ### Plan and Submit Transactions with Rust SDK Source: https://context7.com/penumbra-zone/penumbra/llms.txt Demonstrates initializing a transaction planner, setting gas parameters, and submitting a transaction. ```rust use penumbra_sdk_keys::keys::AddressIndex; use penumbra_sdk_asset::Value; use penumbra_sdk_wallet::plan::Planner; use rand_core::OsRng; // Create a planner for building transactions let mut planner = Planner::new(OsRng); // Set gas prices and fee tier planner .set_gas_prices(gas_prices) .set_fee_tier(FeeTier::Low.into()); // Add an output to send funds let destination: Address = "penumbra1...".parse()?; let value: Value = "100penumbra".parse()?; planner.output(value, destination); // Build the transaction plan let plan = planner .memo("Payment memo".to_string()) .plan(&view_client, AddressIndex::new(0)) .await?; // Build and submit the transaction app.build_and_submit_transaction(plan).await?; ``` -------------------------------- ### Initialize Penumbra Wallet Source: https://context7.com/penumbra-zone/penumbra/llms.txt Commands for setting up a new wallet, importing existing phrases, or configuring multisig and view-only modes. ```bash # Generate a new wallet with seed phrase (displayed in alternate screen) pcli --grpc-url https://grpc.testnet.penumbra.zone init soft-kms generate # Generate wallet and output seed phrase to stdout pcli --grpc-url https://grpc.testnet.penumbra.zone init soft-kms generate --stdout # Import existing seed phrase pcli --grpc-url https://grpc.testnet.penumbra.zone init soft-kms import-phrase # Initialize with encrypted storage (password protected) pcli --grpc-url https://grpc.testnet.penumbra.zone init --encrypted soft-kms generate # Initialize threshold signing (2-of-3 multisig) pcli init threshold deal --threshold 2 --home ./signer1 ./signer2 ./signer3 \ --grpc-url https://grpc.testnet.penumbra.zone # View-only mode initialization pcli --grpc-url https://grpc.testnet.penumbra.zone init view-only # Wipe all configuration and keys pcli init unsafe-wipe ``` -------------------------------- ### Initial Dutch Auction State Construction Source: https://github.com/penumbra-zone/penumbra/blob/main/docs/padr/PADR-001_Dutch_Auctions.md Constructs the initial state for a Dutch auction. The sequence number starts at 0, and the next trigger is set to the auction's start height. Input reserves are initialized with the description's input amount. ```rust DutchAuctionState { // The sequence number starts at 0. seq: 0, // No position has been created yet, this will occur at the first trigger. current_position: None, // Trigger processing when the auction is scheduled to start. next_trigger: description.start_height, // The amount to be auctioned has not yet been put in a position. input_reserves: description.input.amount, // No outputs have yet been received. output_reserves: 0, } ``` -------------------------------- ### Download migration archive Source: https://github.com/penumbra-zone/penumbra/wiki/Performing-upgrades Copy the migration archive from the pod to the local environment. ```bash kubectl cp penumbra-devnet-val-0:/penumbra-config/penumbra-devnet-val/pd-migrated-state-archive.tar.gz -c pd pd-migrated-state-archive.tar.gz ``` -------------------------------- ### Create upgrade proposal template Source: https://github.com/penumbra-zone/penumbra/wiki/Performing-upgrades Generates a template file for an upgrade proposal. ```bash pcli tx proposal template upgrade-plan > upgrade.toml ``` -------------------------------- ### Test Database Connection Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Verify the connection to the newly created database using a connection string. ```bash psql "postgresql://localhost:5432/testnet_raw?sslmode=disable" ``` -------------------------------- ### Operate a Penumbra Node Source: https://context7.com/penumbra-zone/penumbra/llms.txt Commands for starting, configuring, and maintaining a Penumbra full node. ```bash pd start pd start \ --abci-bind 0.0.0.0:26658 \ --grpc-bind 0.0.0.0:8080 \ --metrics-bind 0.0.0.0:9000 \ --cometbft-addr http://127.0.0.1:26657 pd start --grpc-auto-https pd.example.com pd start --grpc-auto-https pd.example.com --acme-staging pd start --enable-expensive-rpc pd network generate \ --chain-id my-testnet \ --epoch-duration 100 \ --unbonding-delay 1000 \ --active-validator-limit 10 pd network join \ --node https://rpc.testnet.penumbra.zone \ --moniker my-node \ --external-address 1.2.3.4:26656 pd network join \ --node https://rpc.testnet.penumbra.zone \ --archive-url https://snapshots.example.com/snapshot.tar.gz pd export --home ~/.penumbra/testnet/node0/pd --export-directory ./export pd migrate --home ~/.penumbra/testnet/node0/pd ready-to-start ``` -------------------------------- ### Submit upgrade proposal Source: https://github.com/penumbra-zone/penumbra/wiki/Performing-upgrades Submits the upgrade proposal using the generated configuration file. ```bash pcli tx proposal submit --file upgrade.toml --deposit-amount 10000000 ``` -------------------------------- ### Clone Penumbra Repository Source: https://github.com/penumbra-zone/penumbra/wiki/Deployment-checklist Use this command to clone the Penumbra repository from GitHub. Ensure you have Git installed. ```bash git clone https://github.com/penumbra-zone/penumbra.git ``` -------------------------------- ### Initialize PostgreSQL Data Directory Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Initializes the database cluster in the current directory. ```bash [user@hostname:~/penumbra]$ initdb --pgdata=.data ``` -------------------------------- ### Create PostgreSQL Database Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Create the testnet_raw database using the psql command-line interface. ```sql $ psql postgres psql (16.3 (Homebrew)) Type "help" for help. postgres=# CREATE DATABASE testnet_raw; CREATE DATABASE postgres=# \q ``` -------------------------------- ### Configure TCT Visualization Options Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/misc/tct-visualize/README.md Displays help information for configuring the interactive visualization tool. ```bash cargo run --release --bin tct-live-edit -- --help ``` -------------------------------- ### Query Indexed Event Data Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Example SQL query to retrieve events joined with block data for a specific height. ```sql testnet_raw=# SELECT * FROM events JOIN blocks ON events.block_id = blocks.rowid WHERE blocks.height = 426939 ; rowid | block_id | tx_id | type | rowid | height | chain_id | created_at -------+----------+-------+-------------------------------------------------------------+-------+--------+---------------------------+------------------------------- 99043 | 7534 | | block | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99044 | 7534 | | penumbra.core.component.sct.v1.EventAnchor | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99045 | 7534 | | penumbra.core.component.sct.v1.EventBlockRoot | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99046 | 7534 | 4350 | tx | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99047 | 7534 | 4350 | tx | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99048 | 7534 | 4350 | penumbra.core.component.shielded_pool.v1.EventSpend | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99049 | 7534 | 4350 | penumbra.core.component.sct.v1.EventCommitment | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99050 | 7534 | 4350 | penumbra.core.component.shielded_pool.v1.EventOutput | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99051 | 7534 | 4350 | penumbra.core.component.sct.v1.EventCommitment | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99052 | 7534 | 4350 | penumbra.core.component.shielded_pool.v1.EventOutput | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99053 | 7534 | 4350 | penumbra.core.component.shielded_pool.v1.EventBroadcastClue | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99054 | 7534 | 4350 | penumbra.core.component.shielded_pool.v1.EventBroadcastClue | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99055 | 7534 | 4351 | tx | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99056 | 7534 | 4351 | tx | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99057 | 7534 | 4351 | penumbra.core.component.shielded_pool.v1.EventSpend | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99058 | 7534 | 4351 | penumbra.core.component.sct.v1.EventCommitment | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99059 | 7534 | 4351 | penumbra.core.component.shielded_pool.v1.EventOutput | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99060 | 7534 | 4351 | penumbra.core.component.sct.v1.EventCommitment | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99061 | 7534 | 4351 | penumbra.core.component.shielded_pool.v1.EventOutput | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99062 | 7534 | 4351 | penumbra.core.component.shielded_pool.v1.EventBroadcastClue | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 99063 | 7534 | 4351 | penumbra.core.component.shielded_pool.v1.EventBroadcastClue | 7534 | 426939 | penumbra-testnet-deimos-8 | 2024-06-07 01:38:33.440578-04 (21 rows) ``` -------------------------------- ### Configure Rust Environment Source: https://github.com/penumbra-zone/penumbra/wiki/Deployment-checklist Sources the Rust environment variables to make Cargo and other Rust tools available in the current shell session. This should be run after installing the Rust toolchain. ```bash source $HOME/.cargo/env ``` -------------------------------- ### Cycle Asset Swaps Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/bin/elcuity/README.md Repeatedly swaps assets in a defined cycle. Automatically tops up UM to the starting amount to prevent cycle termination due to fee-related value loss. ```bash elcuity swap --starting-amount AMOUNT --cyle ASSET1 --cycle ASSET2 ... ``` -------------------------------- ### Derive Spend Authorization and Nullifier Keys Source: https://github.com/penumbra-zone/penumbra/blob/main/docs/protocol/src/addresses_keys/spend_key.md This pseudocode illustrates the derivation of the spend authorization key (ask) and nullifier key (nk) from the spend key bytes using BLAKE2b-512 with specific labels and inputs. The ask is derived modulo r, and the nk is derived modulo q. ```pseudocode ask = from_le_bytes(prf_expand("Penumbra_ExpndSd", spend_key_bytes, 0)) mod r nk = from_le_bytes(prf_expand("Penumbra_ExpndSd", spend_key_bytes, 1)) mod q ``` -------------------------------- ### Manage Liquidity Positions with pcli Source: https://context7.com/penumbra-zone/penumbra/llms.txt Commands for creating, closing, and withdrawing liquidity positions on the Penumbra DEX. ```bash pcli tx position order buy "100penumbra@1.2gm" --auto-close pcli tx position order buy "100penumbra@1.2gm" --num-copies 5 pcli tx position close-all pcli tx position close plpid1... plpid2... pcli tx position withdraw-all pcli tx position withdraw plpid1... pcli tx position replicate xyk penumbra gm 1000penumbra 1000gm --fee-bps 30 ``` -------------------------------- ### Run pindexer with PostgreSQL connections Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/bin/pindexer/README.md Executes the pindexer binary with source and destination PostgreSQL connection strings. ```bash cargo run --bin pindexer -- -s "postgresql://localhost:5432/testnet_raw?sslmode=disable" -d "postgresql://localhost:5432/testnet_compiled?sslmode=disable" ``` -------------------------------- ### Sync pcli with the testnet node Source: https://github.com/penumbra-zone/penumbra/wiki/Testnet-Acceptance-Tests Synchronize the local pcli client with the testnet-preview node. ```bash cargo run --bin pcli -- -n testnet-preview.penumbra.zone sync ``` -------------------------------- ### Run state migration Source: https://github.com/penumbra-zone/penumbra/wiki/Performing-upgrades Execute the migration process after updating the container image tag. ```bash pd migrate --target-directory /penumbra-config/penumbra-devnet-val/pd-exported-state/ --migrate-archive /penumbra-config/penumbra-devnet-val/pd-migrated-state-archive.tar.gz ``` -------------------------------- ### Create Databases via psql Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Creates the required testnet databases within the PostgreSQL shell. ```sql $ psql postgres postgres=# CREATE DATABASE testnet_raw; CREATE DATABASE postgres=# CREATE DATABASE testnet_compiled; CREATE DATABASE postgres=# \q ``` -------------------------------- ### Liquidity Positions Source: https://context7.com/penumbra-zone/penumbra/llms.txt Commands for creating and managing concentrated liquidity positions on the DEX. ```bash # Create a buy order: buy 100 penumbra at 1.2 gm per penumbra pcli tx position order buy "100penumbra@1.2gm" # Create a sell order with fee spread of 10 basis points pcli tx position order sell "100penumbra@1.2gm/10bps" ``` -------------------------------- ### Execute Private Swap via DEX Source: https://context7.com/penumbra-zone/penumbra/llms.txt Shows the workflow for planning a swap, submitting the transaction, and subsequently claiming the swap outputs. ```rust use penumbra_sdk_asset::{asset, Value}; use penumbra_sdk_dex::swap_claim::SwapClaimPlan; use penumbra_sdk_wallet::plan::Planner; // Parse input and target asset let input: Value = "100penumbra".parse()?; let into = asset::REGISTRY.parse_unit("gm").base(); // Get claim address for swap outputs let (claim_address, _) = fvk.incoming().payment_address(AddressIndex::new(0)); // Calculate estimated claim fee let estimated_claim_fee = gas_prices .fee(&swap_claim_gas_cost()) .apply_tier(FeeTier::Low.into()); // Plan the swap let mut planner = Planner::new(OsRng); planner .set_gas_prices(gas_prices) .set_fee_tier(FeeTier::Low.into()) .swap(input, into.id(), estimated_claim_fee, claim_address)?; let plan = planner.plan(&view_client, AddressIndex::new(0)).await?; // Submit swap transaction app.build_and_submit_transaction(plan).await?; // After confirmation, claim the swap outputs let swap_record = view_client.swap_by_commitment(swap_commitment).await?; let mut claim_planner = Planner::new(OsRng); claim_planner .set_gas_prices(gas_prices) .swap_claim(SwapClaimPlan { swap_plaintext, position: swap_record.position, output_data: swap_record.output_data, epoch_duration: params.sct_params.epoch_duration, proof_blinding_r: Fq::rand(&mut OsRng), proof_blinding_s: Fq::rand(&mut OsRng), }); let claim_plan = claim_planner.plan(&view_client, AddressIndex::new(0)).await?; app.build_and_submit_transaction(claim_plan).await?; ``` -------------------------------- ### Configure CometBFT Indexer Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Update the comet config.toml file to enable the PostgreSQL indexer. ```toml [tx_index] indexer = "psql" psql-conn = "postgresql://localhost:5432/testnet_raw?sslmode=disable" ``` -------------------------------- ### Compile proto structs Source: https://github.com/penumbra-zone/penumbra/blob/main/tools/proto-compiler/README.md Execute the compiler tool to generate Rust structs from proto definitions. ```bash cargo run ``` -------------------------------- ### DEX Swaps Source: https://context7.com/penumbra-zone/penumbra/llms.txt Commands for executing private token swaps and querying market data on the ZSwap DEX. ```bash # Swap 100 penumbra for gm tokens pcli tx swap 100penumbra --into gm # Swap from specific account pcli tx swap 100penumbra --into gm --source 1 # Swap with high fee tier pcli tx swap 100penumbra --into gm --fee-tier high # Query DEX trading pairs pcli query dex trading-pairs # Query liquidity on a trading pair pcli query dex liquidity penumbra:gm ``` -------------------------------- ### Configure CometBFT Indexer Source: https://github.com/penumbra-zone/penumbra/blob/main/crates/util/cometindex/README.md Updates the CometBFT configuration file to use PostgreSQL for transaction indexing. ```toml # ~/.penumbra/network_data/node0/cometbft/config/config.toml [tx_index] indexer = "psql" psql-conn = "postgresql://localhost:5432/testnet_raw?sslmode=disable" ```