Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Hivemind Protocol Examples

This directory contains example code demonstrating various features of the Hivemind Protocol.

Files

  1. basic_voting.py

    • Basic example of creating and managing a simple voting issue
    • Demonstrates core functionality like creating issues, options, and opinions
    • Shows how to calculate results and find consensus
  2. advanced_features.py

    • Examples of advanced protocol features
    • Shows how to use constraints and restrictions
    • Demonstrates auto-ranking functionality
    • Includes examples of different voting mechanisms
  3. protocol_upgrade.py

    • Real-world example of using Hivemind for governance
    • Shows how to create and manage protocol upgrade proposals
    • Demonstrates proper setup of voting requirements
    • Includes complete voting workflow

Usage

Each example can be run independently. Before running, make sure to:

  1. Install the hivemind-python package
  2. Replace placeholder values (addresses, signatures) with real ones
  3. Have IPFS running locally or specify your IPFS gateway

Example:

python basic_voting.py

Note

These examples are for demonstration purposes. In a production environment, you should:

  1. Properly handle signatures and addresses
  2. Implement proper error handling
  3. Use secure methods for managing private keys
  4. Consider adding logging and monitoring
  5. Implement proper access controls