# 5. BOS Referendum - Vote Tally

> Aggregates proposals/votes/voter staked weights from `eosio.forum` & `auditor.bos`.

#### Install

```
git clone https://github.com/boscore/referendum.git
cd referendum
git checkout feature/vote-tally
cd vote-tally
npm install
```

#### Quick Start

```
npm start
```

#### ENV Variables

```
# Configuration
CHAIN="bos"
NODEOS_ENDPOINT="https://bos.eosn.io"
CONTRACT_FORUM="eosio.forum"
CONTRACT_TOKEN="eosio.token"
TOKEN_SYMBOL="BOS"

# AWS Config
AWS_BUCKET="bos.referendum"
AWS_ACCESS_KEY_ID="<ACCESS KEY>"
AWS_SECRET_ACCESS_KEY="<SECRET KEY>"
AWS_REGION="us-east-1"
```

#### Using `eosc forum`

**vote**

```
bosc forum vote [voter] [proposal_name] [vote_value]
```

**proposal**

```
bosc forum propose [proposer] [proposal_name] [title] [proposal_expiration_date]
```

#### S3 Bucket URL template

* [https://api.boswps.com/{scope}/{table}/{block\_num}.json](https://api.boswps.com/referendum/tallies/latest.json)

**referendum (tally) Aggregated Data**

**eosio.forum**

* [referendum::forum.tallies](https://api.boswps.com/referendum/forum.tallies/latest.json)
* [referendum::forum.accounts](https://api.boswps.com/referendum/forum.accounts/latest.json)
* [referendum::forum.proxies](https://api.boswps.com/referendum/forum.proxies/latest.json)

**auditor.bos**

* [referendum::auditor.tallies](https://api.boswps.com/referendum/auditor.tallies/latest.json)
* [referendum::auditor.accounts](https://api.boswps.com/referendum/auditor.accounts/latest.json)
* [referendum::auditor.proxies](https://api.boswps.com/referendum/auditor.proxies/latest.json)

**eosio**

* [referendum::delband](https://api.boswps.com/referendum/delband/latest.json)
* [referendum::voters](https://api.boswps.com/referendum/voters/latest.json)

#### `auditor.bos` TABLES

* [auditor.bos::votes](https://api.boswps.com/auditor.bos/votes/latest.json)
* [auditor.bos::votejson](https://api.boswps.com/auditor.bos/votejson/latest.json)
* [auditor.bos::candidates](https://api.boswps.com/auditor.bos/candidates/latest.json)
* [auditor.bos::auditors](https://api.boswps.com/auditor.bos/auditors/latest.json)
* [auditor.bos::config](https://api.boswps.com/auditor.bos/config/latest.json)
* [auditor.bos::bios](https://api.boswps.com/auditor.bos/bios/latest.json)

#### `eosio.forum` TABLES

* [eosio.forum::vote](https://api.boswps.com/eosio.forum/vote/latest.json)
* [eosio.forum::proposal](https://api.boswps.com/eosio.forum/proposal/latest.json)

**eosio TABLES**

* [eosio::voters](https://api.boswps.com/eosio/voters/latest.json)
* [eosio::stats](https://api.boswps.com/eosio/stats/latest.json)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boscore.gitbook.io/docs/essentials/bos-ecosystem/boscore-improvement-proposal/5.-bos-referendum-vote-tally.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
