0

How can I get protocol parameters only for the latest epoch using GraphQL?

I can get protocol parameters with cardano-cli:

cardano-cli query protocol-parameters \
  --testnet-magic 1097911063 \
  --out-file $HOME/cardano/protocol.json

I can get protocol parameters for multiple epochs with help of this query

https://github.com/input-output-hk/cardano-graphql/blob/master/packages/api-cardano-db-hasura/src/example_queries/epochs/epochProtocolParams.graphql

1 Answer 1

1

I've found the solution:

query currentEpochProtocolParams {
  cardano {
    currentEpoch {
      number
      protocolParams {
        a0
        coinsPerUtxoWord
        collateralPercent
        costModels
        decentralisationParam
        eMax
        extraEntropy
        keyDeposit
        maxBlockBodySize
        maxBlockExMem
        maxBlockExSteps
        maxBlockHeaderSize
        maxCollateralInputs
        maxTxExMem
        maxTxExSteps
        maxTxSize
        maxValSize
        minFeeA
        minFeeB
        minPoolCost
        minUTxOValue
        nOpt
        poolDeposit
        priceMem
        priceStep
        protocolVersion
        rho
        tau
      }
    }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.