Skip to content

Stratum

Bases: Base

ORM model for the local stratum endpoint.

Attributes:

Name Type Description
uid int

Primary key.

time datetime

Timestamp of the record.

full_json dict

Full JSON data.

hashrate_15m int

Hashrate for the last 15 minutes.

hashrate_1h int

Hashrate for the last hour.

hashrate_24h int

Hashrate for the last 24 hours.

total_hashes int

Total number of hashes.

shares_found int

Number of shares found.

shares_failed int

Number of shares failed.

average_effort float

Average effort.

current_effort float

Current effort.

connections int

Number of connections.

incoming_connections int

Number of incoming connections.

block_reward_share_percent float

Block reward share percentage.

workers dict

List of workers.

Source code in p2pool/models.py
class Stratum(Base):
    """
    ORM model for the local stratum endpoint.

    Attributes:
        uid (int): Primary key.
        time (datetime): Timestamp of the record.
        full_json (dict): Full JSON data.
        hashrate_15m (int): Hashrate for the last 15 minutes.
        hashrate_1h (int): Hashrate for the last hour.
        hashrate_24h (int): Hashrate for the last 24 hours.
        total_hashes (int): Total number of hashes.
        shares_found (int): Number of shares found.
        shares_failed (int): Number of shares failed.
        average_effort (float): Average effort.
        current_effort (float): Current effort.
        connections (int): Number of connections.
        incoming_connections (int): Number of incoming connections.
        block_reward_share_percent (float): Block reward share percentage.
        workers (dict): List of workers.
    """
    __tablename__ = 'stratum'
    uid = Column(Integer, primary_key=True)
    time = Column(DateTime, default=datetime.now)
    full_json = Column(JSON)
    hashrate_15m = Column(Integer)
    hashrate_1h = Column(Integer)
    hashrate_24h = Column(Integer)
    total_hashes = Column(Integer)
    shares_found = Column(Integer)
    shares_failed = Column(Integer)
    average_effort = Column(Float)
    current_effort = Column(Float)
    connections = Column(Integer)
    incoming_connections = Column(Integer)
    block_reward_share_percent = Column(Float)
    workers = Column(JSON)