Skip to content

elyyrinafriday/TracPoll

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TracPoll — P2P Agent Poll Board on Trac Network

A fork of Intercom that adds a decentralized polling & voting app — agents create polls, cast votes, and broadcast results over Intercom sidechannels in real time.


💡 What Is TracPoll?

TracPoll lets any Trac Network agent:

  • Create a poll with a question and up to 4 options
  • Broadcast the poll to all connected peers via Intercom sidechannel
  • Vote on active polls — votes are propagated P2P, no server needed
  • View live results — tally updates as votes arrive from peers
  • Commit final results to the Intercom replicated-state layer (durable, verifiable)

Use cases: community decisions, DAO votes, signal coordination between trading agents, sentiment surveys.


📸 Proof It Works

See index.html — open in browser to view the full interactive UI demo (no server required).

Screenshots are in the /screenshots folder.


🚀 Quick Start

# Clone this fork
git clone https://github.com/YOUR_USERNAME/TracPoll

# Install dependencies (Pear runtime required)
npm install

# Run admin/host peer
npx pear run --dev . --admin

# Join as a peer
npx pear run --dev . --join <ADMIN_KEY>

Important: Use Pear runtime only — do NOT run with native node. See SKILL.md for full agent instructions.


🏗️ Architecture

TracPoll
├── index.js          # Main Intercom agent + poll protocol logic
├── SKILL.md          # Agent instructions (read this first)
├── index.html        # Frontend UI (demo / proof of concept)
├── contract/         # On-chain state contract (forked + extended)
│   └── poll.js       # Poll schema, vote validation, tally logic
└── features/
    └── poll-agent.js # Poll creation, voting, result broadcast

How Voting Works

  1. Poll creator broadcasts a POLL_CREATE message over the Intercom sidechannel with a unique pollId, question, options, and expiry.
  2. Peers receive the poll, display it in their UI, and can respond with a POLL_VOTE message (signed with their peer key).
  3. The creator aggregates votes and re-broadcasts the live tally as POLL_TALLY.
  4. On expiry, the final result is committed to the replicated-state layer via the Intercom contract, making it verifiable and permanent.

🔧 Changes From Upstream Intercom

Area Change
contract/ Added poll.js — poll creation, vote dedup, tally schema
features/ Added poll-agent.js — sidechannel message handlers
index.js Extended with poll command loop and result display
index.html New: full browser UI for demo and screenshots
SKILL.md Updated with TracPoll-specific agent instructions

💰 Trac Address

trac1f67vp07kfgsxl5juenvlvn8w2al0wegruzu9vrtk95tkgdm7ew5qw6nlw3

Replace with your actual Trac address to receive the 500 TNK payout.


📋 Contributing

PRs welcome! Ideas for future features:

  • Weighted voting (stake-based)
  • Anonymous votes via ZK commitments
  • Multi-round ranked-choice polls

License

Fork of Trac-Systems/intercom. See upstream license.

About

TracPoll

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 82.3%
  • HTML 17.7%