Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qearn Frontend and Smart Contract Integration #74

Open
wants to merge 64 commits into
base: main
Choose a base branch
from

Conversation

serendipity-seeker
Copy link

@serendipity-seeker serendipity-seeker commented Aug 27, 2024

Key Features

  • Qearn Page: Interface for managing Locking and Unlocking statuses.
  • Qearn Service: Handles main logic and utilities.
  • Time Service: Manages locking epochs.
  • API Integration:
    • querySmartContract: Query SC state.
    • broadcastTransaction: Broadcast transactions to the blockchain.

Running on Testnet

Prerequisites

Setup

  1. Confirm Testnet: Ensure the testnet is running.
  2. Docker Setup: Use the following docker-compose to set up the services.
  services:
  qubic-http:
    image: ghcr.io/qubic/qubic-http:v0.7.0
    container_name: qubic-http
    environment:
      QUBIC_API_SIDECAR_SERVER_HTTP_HOST: "0.0.0.0:8000"
      QUBIC_API_SIDECAR_SERVER_GRPC_HOST: "0.0.0.0:8001"
      QUBIC_API_SIDECAR_SERVER_MAX_TICK_FETCH_URL: "http://qubic-nodes:8080/max-tick"
      QUBIC_API_SIDECAR_POOL_NODE_FETCHER_URL: "http://qubic-nodes:8080/status"
      QUBIC_API_SIDECAR_POOL_NODE_PORT: "31844"
      QUBIC_API_SIDECAR_POOL_NODE_FETCHER_TIMEOUT: "20s"
    ports:
      - "0.0.0.0:8000:8000"
    networks:
      - qubic
    depends_on:
      qubic-nodes:
        condition: service_healthy
    restart: always
  qubic-nodes:
    image: ghcr.io/qubic/qubic-nodes:v1.0.4
    container_name: qubic-nodes
    environment:
      QUBIC_NODES_QUBIC_PEER_LIST: "45.143.199.17"
      QUBIC_NODES_QUBIC_PEER_PORT: "31844"
    networks:
      - qubic
    healthcheck:
      test: [ "CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/status" ]
      interval: 5s
      timeout: 5s
      retries: 5
    restart: always

  networks:
    qubic:
  1. Modify Testnet URL: Update testnet-proxy.js:

    const testnetURL = 'http://116.202.157.215:8000'; // Update URL as HTTP server URL

Running the Application

  1. Install Dependencies:

    yarn install
  2. Start Testnet Proxy:

    node testnet-proxy.js
  3. Start the Application:

    yarn start

Live Test URL

Ensure the testnet is running before testing.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants