Skip to content

docs(bitcoin): document get_blockchain_info endpoint in bitcoin guide #159

@marc0olo

Description

@marc0olo

Context

The dfinity/examples submodule was bumped to d4ea422 (commit 12e1f0d), which added a get_blockchain_info endpoint to the basic_bitcoin example (Rust).

Current state

docs/guides/chain-fusion/bitcoin.mdx already has a short mention of get_blockchain_info (around line 456) with a minimal Rust snippet using ic_cdk_bitcoin_canister::get_blockchain_info. It does not:

  • show the full BlockchainInfo response fields (height, block_hash, timestamp, difficulty, UTXO count)
  • include a Motoko equivalent
  • link to the example

Task

Expand the existing get_blockchain_info section in docs/guides/chain-fusion/bitcoin.mdx to:

  1. Show the complete BlockchainInfo response struct and what each field means
  2. Add a Motoko tab alongside the existing Rust snippet
  3. Link to the example: https://github.com/dfinity/examples/tree/master/rust/basic_bitcoin (implementation at src/service/get_blockchain_info.rs)

Source material

  • .sources/examples/rust/basic_bitcoin/src/service/get_blockchain_info.rs — Rust implementation
  • .sources/examples/rust/basic_bitcoin/README.md — documents the response fields
  • The BlockchainInfo type is in ic-cdk-bitcoin-canister = "0.2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions