# Has anybody written any Rust application against the Ledger API?

**URL:** <https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [October 31, 2021, 7:35am UTC](https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390 "2021-10-31T07:35:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [October 31, 2021, 7:35am UTC](https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390/1 "2021-10-31T07:35:53Z")

</div>

I would be interested how you included the whole tree of `.proto` files.

This is my starting point and it only explains how single `.proto` files can be used:

> <https://github.com/hyperium/tonic/blob/debcafe08cd64f03bff2fee0eaa1521e47794a8a/examples/helloworld-tutorial.md>

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [November 1, 2021, 8:04am UTC](https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390/2 "2021-11-01T08:04:26Z")

</div>

Not sure of whether you can pass a directory and have it walk recursively (although that’s probably a nice contribution to make to the project, if they don’t) but it looks like you can use `tonic_build::configure()` to add more files (see the examples [here](https://github.com/hyperium/tonic/blob/debcafe08cd64f03bff2fee0eaa1521e47794a8a/tonic-build/README.md#configuration)).

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [November 22, 2021, 5:57pm UTC](https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390/3 "2021-11-22T17:57:04Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [February 14, 2022, 8:58am UTC](https://forum.canton.network/t/has-anybody-written-any-rust-application-against-the-ledger-api/3390/4 "2022-02-14T08:58:49Z")

</div>

Yes, this is the `build.rs` which does the job:

```haskell
fn main() -> Result<(), Box<dyn std::error::Error>> {
    tonic_build::configure()
        .build_server(false)
        .compile(
            &[ // the list of protos
                "com/daml/ledger/api/v1/admin/config_management_service.proto",
                "com/daml/ledger/api/v1/admin/package_management_service.proto",
                "com/daml/ledger/api/v1/admin/participant_pruning_service.proto",
                "com/daml/ledger/api/v1/admin/party_management_service.proto",
                "com/daml/ledger/api/v1/testing/reset_service.proto",
                "com/daml/ledger/api/v1/testing/time_service.proto",
                "com/daml/ledger/api/v1/active_contracts_service.proto",
                "com/daml/ledger/api/v1/command_completion_service.proto",
                "com/daml/ledger/api/v1/command_service.proto",
                "com/daml/ledger/api/v1/command_submission_service.proto",
                "com/daml/ledger/api/v1/commands.proto",
                "com/daml/ledger/api/v1/completion.proto",
                "com/daml/ledger/api/v1/event.proto",
                "com/daml/ledger/api/v1/experimental_features.proto",
                "com/daml/ledger/api/v1/ledger_configuration_service.proto",
                "com/daml/ledger/api/v1/ledger_identity_service.proto",
                "com/daml/ledger/api/v1/ledger_offset.proto",
                "com/daml/ledger/api/v1/package_service.proto",
                "com/daml/ledger/api/v1/transaction.proto",
                "com/daml/ledger/api/v1/transaction_filter.proto",
                "com/daml/ledger/api/v1/transaction_service.proto",
                "com/daml/ledger/api/v1/value.proto",
                "com/daml/ledger/api/v1/version_service.proto",
            ],
            &["."], // specify the root location to search proto dependencies
        )?;
    Ok(())
}

```
