Skip to content

[Docker build error] External miner fails to call runtime export #192

Open

Description

@exunico

Hey, I'm having some problems with starting a testnet miner.

Im getting External miner fails to call runtime export: “Exported method QPoWApi_verify_nonce_* not found” (or equivalent WASM export-not-found error).

Node target: tag v0.1.6 (runtime spec_version: 108).
Runtime API in v0.1.6:
primitives/consensus/qpow/src/lib.rs trait QPoWApi exposes:
verify_nonce_on_import_block([u8; 32], [u8; 64]) -> bool
verify_nonce_local_mining([u8; 32], [u8; 64]) -> bool
runtime/src/apis.rs implements both (plus verify_historical_block(...)).

Is this because the miner compiled for an older API/runtime (e.g., pre-108), expecting different method names/signatures, so it can’t find the QPoWApi_verify_nonce_* exports in the v0.1.6 runtime?

Activity

  1. exunico commented on Sep 1, 2025

    @exunico
    Author

    I Manged to get the miner working.

    It was a lot fiddling, but this is my env, config and actions. hope it helps.

    Quantus Mining Node Deployment Report

    Date: September 1, 2025
    Node Version: Latest Docker image (ghcr.io/quantus-network/quantus-node:latest)
    Environment: Ubuntu 22.04 LTS with Docker
    Final Status: ✅ Successfully deployed and mining

    Executive Summary

    This report documents the issues encountered during Quantus mining node deployment and the fixes required to achieve a stable, mining configuration. The node is now successfully running with 14+ peers, actively importing blocks, and directing rewards to the specified wallet address.

    Issues Encountered & Solutions

    1. Docker Container Restart Loop

    Issue: Container would start but immediately restart in a loop, preventing stable operation.

    Root Cause: Unsupported command-line flags in the Docker run command:

    • --ws-port 9944 flag is not supported in current node version
    • --rpc-external requires --unsafe-rpc-external for validator nodes

    Solution Applied:

    # Removed unsupported flag
    --ws-port 9944
    
    # Changed to required validator flag
    --rpc-external → --unsafe-rpc-external

    Final Working Docker Command:

    docker run -d \
        --name quantus-node \
        --restart unless-stopped \
        -v "$(pwd)/quantus_node_data":/var/lib/quantus \
        -p 30333:30333 \
        -p 9933:9933 \
        -p 9944:9944 \
        -p 9615:9615 \
        ghcr.io/quantus-network/quantus-node:latest \
        --rpc-port 9933 \
        --unsafe-rpc-external \
        --rpc-cors all \
        --ws-external \
        --prometheus-port 9615 \
        --validator \
        --base-path /var/lib/quantus \
        --chain live_resonance \
        --node-key-file /var/lib/quantus/node_key.p2p \
        --rewards-address "qzmNCqKCCLk51kY5dHkuMHrK89pdTLWspnxodoVX3ETMGaXUQ" \
        --name "$(hostname)-miner"

    2. Installation Method Detection Issues

    Issue: Management scripts couldn't detect Docker installation after container removal, causing startup failures.

    Root Cause: Detection logic relied on running containers rather than Docker availability and data directory presence.

    Solution Applied:

    detect_install_method() {
        # Check if Docker is available and we have node data (indicates Docker setup)
        if command -v docker &> /dev/null && [ -d "./quantus_node_data" ]; then
            echo "docker"
        # ... other detection logic
    }

    3. RPC Monitoring Limitations

    Issue: Existing monitoring scripts used faucet_getAccountInfo RPC method which doesn't exist on the live_resonance chain.

    Root Cause: RPC methods available in documentation/examples don't match production chain capabilities.

    Investigation Results:

    • faucet_getAccountInfo - Not available
    • system_accountNextIndex - Returns empty
    • state_getStorage - Returns empty for balance queries

    Solution Applied:
    Switched to log-based monitoring instead of RPC balance queries:

    • Monitor block import logs for mining activity
    • Track consensus participation through log events
    • Use system_health and system_peers for node status

    4. Rewards Address Management

    Issue: No easy way to change rewards address without manual Docker container recreation.

    Solution Applied:
    Created interactive change-address command in management script:

    • View current rewards address
    • Enter existing address with validation
    • Generate new address with secure backup instructions
    • Automatic node restart with new address

    Current Node Status

    ✅ Operational Metrics:

    • Peers: 14+ connected
    • Sync Status: Fully synchronized
    • Block Height: #197190+ (actively importing)
    • Mining Status: Active (producing and finalizing blocks)
    • RPC Access: Available on port 9933
    • Rewards Address: qzmNCqKCCLk51kY5dHkuMHrK89pdTLWspnxodoVX3ETMGaXUQ

    Recommendations for Documentation Updates

    1. Docker Command Reference

    Update official Docker examples to:

    • Remove --ws-port flag (unsupported)
    • Use --unsafe-rpc-external for validator nodes
    • Clarify port mapping requirements

    2. RPC Method Documentation

    • Document which RPC methods are available on live_resonance chain
    • Provide alternative monitoring approaches when balance queries aren't available
    • Update example monitoring scripts

    3. Troubleshooting Guide

    Add section covering:

    • Container restart loop diagnosis
    • Flag compatibility issues
    • Alternative monitoring methods

    Scripts Created

    1. Enhanced Management Script (manage-quantus.sh)

    • Fixed installation detection
    • Added interactive rewards address management
    • Corrected Docker run parameters
    • Comprehensive node operations (start/stop/restart/update/backup)

    2. Monitoring Adaptations

    • Log-based monitoring instead of unavailable RPC methods
    • Node health and peer status checking
    • Block import tracking

    Technical Environment

    • OS: Ubuntu 22.04 LTS
    • Container Runtime: Docker
    • Network: live_resonance chain
    • Node Type: Validator with mining enabled
    • Storage: Persistent volume mounted to /var/lib/quantus

    Conclusion

    The Quantus mining node is now successfully deployed and operational. The main challenges were related to Docker command flags and RPC method availability. With the implemented fixes, the node maintains stable operation and active mining participation.

    The enhanced management scripts provide a robust foundation for ongoing node operations and maintenance.

  2. changed the title [-]External miner fails to call runtime export[/-] [+][Docker build error] External miner fails to call runtime export[/+] on Sep 20, 2025
  3. n13 commented on Sep 20, 2025

    @n13
    Collaborator

    Thank you for all this, we will update the docker build

  4. self-assigned this
    on Sep 22, 2025
  5. czareko commented on Sep 22, 2025

    @czareko
    Contributor

    @exunico, thank you.
    I will close this issue when all changes will be applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions