# How to get package\_id for submit\_command with gRPC

**URL:** <https://forum.canton.network/t/how-to-get-package-id-for-submit-command-with-grpc/6802>\
**Category:** App Development\
**Tags:** dar, grpc, ledger-api\
**Created:** [August 15, 2023, 7:35pm UTC](https://forum.canton.network/t/how-to-get-package-id-for-submit-command-with-grpc/6802 "2023-08-15T19:35:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bernhard](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bernhard/32/356_2.png) [@bernhard](https://forum.canton.network/u/bernhard)\
**Post date:** [August 16, 2023, 6:56am UTC](https://forum.canton.network/t/how-to-get-package-id-for-submit-command-with-grpc/6802/2 "2023-08-16T06:56:32Z")

</div>

There’s no real safe way of doing that on a shared ledger. Imagine you uploaded a package `Foo` and someone else also uploaded a malicious package `Foo`. If you just look for _some_ package `Foo` at runtime, you run the risk of accidentally picking up the wrong one.

If you have full control of the Participant node and can thus make sure there is only one such, you can do this:

Use the [PackageService](https://docs.daml.com/app-dev/grpc/proto-docs.html#packageservice) to first list all package Ids using `ListPackages`, then fetch each package using `GetPackage` and deserialize them until you find one that matches what you are looking for.

The deserialization is demonstrated using JavaScript [here](https://discuss.daml.com/t/getting-all-choices-for-a-given-party-or-contract/4830/4).

---

_[View the full topic](https://forum.canton.network/t/how-to-get-package-id-for-submit-command-with-grpc/6802)._
