# How to query votes to DAO proposals ## With `junod` (from a Command Line Interface): 1. Install **junod** ([see instructions on docs.junonetwork.io](https://docs.junonetwork.io/validators/joining-mainnet#junod-installation)) 2. Get access to a node's RPC or one with a public RPC ([you can find a list here](https://cosmos.directory/juno/nodes)), eg = `https://rpc-juno.mib.tech:443` 3. Set your junod to use such node address once for all, with `junod config node https://rpc-juno.mib.tech:443` 4. Get your DAO address from the URL of its DAODAO page, eg Dev Dep = `juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle` 5. Get the `address` of its proposal module with: ``` junod q wasm contract-state smart juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle '{"proposal_modules":{}}' ``` eg = `juno14djpgdk7x2qt3zuc5g33qtzjtk5e6qc263cwdv59mses3knz9hfq0wrcee` 3. Pick the proposal you want to query by `id`, either from it's number in the list at your DAO proposals page, from the URL of the proposal page, or from a list returned by querying: ``` junod q wasm contract-state smart juno14djpgdk7x2qt3zuc5g33qtzjtk5e6qc263cwdv59mses3knz9hfq0wrcee '{"list_proposals":{}}' ``` 4. Finally query the votes on the proposal with: ``` junod q wasm contract-state smart juno14djpgdk7x2qt3zuc5g33qtzjtk5e6qc263cwdv59mses3knz9hfq0wrcee '{"list_votes":{"proposal_id": 9}}' ``` ## With HTTP (from your browser or a REST client like cURL): :::warning Querying smart contracts with HTTP will require sending some query_data as base64-encoded & URL-encoded in the request URL: you can find free encoders online, eg: https://www.base64encode.org/ and https://www.urlencoder.org/ In this tutorial we will query: |query_data|base64 encoded|URL encoded| |-|-|-| |'{"proposal_modules":{}}'|eyJwcm9wb3NhbF9tb2R1bGVzIjp7fX0=|eyJwcm9wb3NhbF9tb2R1bGVzIjp7fX0%3D| |'{"list_proposals":{}}'|eyJsaXN0X3Byb3Bvc2FscyI6e319|eyJsaXN0X3Byb3Bvc2FscyI6e319 |'{"list_votes":{"proposal_id": 9}}'|eyJsaXN0X3ZvdGVzIjp7InByb3Bvc2FsX2lkIjogOX19|eyJsaXN0X3ZvdGVzIjp7InByb3Bvc2FsX2lkIjogOX19 ::: :::info - If you want to use your browser, I suggest you add a JSON parser extension that will nicely format the query responses for better readability, like [*JSON Formatter*](https://chromewebstore.google.com/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa). - If you want to use cURL from your command line, you should wrap all the URLs shown in the steps below in commands like this: `curl -X GET "[URL]" -H "accept: application/json"` ::: 1. Get access to a node's REST API or one with a public REST API ([you can find a list here](https://cosmos.directory/juno/nodes)), eg = `https://api.juno.chaintools.tech/` 2. Get your DAO address from the URL of its DAODAO page, eg Dev Dep = `juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle` 3. Get the `address` of its Proposal module at `[node_address]/cosmwasm/wasm/v1/contract/[address]/smart/[query_data]`, eg: ``` https://api.juno.chaintools.tech/cosmwasm/wasm/v1/contract/juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle/smart/eyJwcm9wb3NhbF9tb2R1bGVzIjp7fX0%3D ``` 4. Pick the proposal you want to query by `id`, either from it's number in the list at your DAO proposals page, from the URL of the proposal page, or from a list returned by visiting: ``` https://api.juno.chaintools.tech/cosmwasm/wasm/v1/contract/juno14djpgdk7x2qt3zuc5g33qtzjtk5e6qc263cwdv59mses3knz9hfq0wrcee/smart/eyJsaXN0X3Byb3Bvc2FscyI6e319 ``` 5. Finally get the votes on the proposal at: ``` https://api.juno.chaintools.tech/cosmwasm/wasm/v1/contract/juno14djpgdk7x2qt3zuc5g33qtzjtk5e6qc263cwdv59mses3knz9hfq0wrcee/smart/eyJsaXN0X3ZvdGVzIjp7InByb3Bvc2FsX2lkIjogOX19 ```