Skip to content

Document the purpose of node_transaction (mempool) vs. block_transaction + node_block (accepted tip) #59

@elderapo

Description

@elderapo

The graphql query:

query GetTx {
  node_transaction(
    where: {
      transaction: {
        hash: {
          _eq: "\\x45fdd101bce6b63c1c128f0fcbec111d93f304a3e09db4706229d60a417109c6"
        }
      }
    }
  ) {
    transaction {
      hash
    }
  }
}

returns:

{
  "data": {
    "node_transaction": []
  }
}

even though the transaction has been confirmed . Maybe because it's the coinbase?


@Edit1: It's possible to find this transaction by looking up the block it was included in:

query GetTxFromBlock {
  node_block(
    where: {
      block: {
        height: {
          _eq: 784836
        }
      }
    }
  ) {
    block {
      hash
      height

      transactions(
        where: {
          transaction: {
            hash: {
              _eq: "\\x45fdd101bce6b63c1c128f0fcbec111d93f304a3e09db4706229d60a417109c6"
            }
          }
        }
      ) {
        transaction {
          hash
        }
      }
    }
  }
}

returns:

{
  "data": {
    "node_block": [
      {
        "block": {
          "hash": "\\x000000000000000003ab734df9176286ea22513052eb4ee1e239cfa6249ee514",
          "height": "784836",
          "transactions": [
            {
              "transaction": {
                "hash": "\\x45fdd101bce6b63c1c128f0fcbec111d93f304a3e09db4706229d60a417109c6"
              }
            }
          ]
        }
      }
    ]
  }
}

@edit2: The following query also works:

query GetTx {
  transaction(
    where: {
      hash: {
        _eq: "\\x45fdd101bce6b63c1c128f0fcbec111d93f304a3e09db4706229d60a417109c6"
      }
    }
  ) {
    hash
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions