laconicd/gql
Prathamesh Musale 8e9f08b652
All checks were successful
Integration Tests / test-integration (push) Successful in 3m6s
E2E Tests / test-e2e (push) Successful in 4m21s
Lint / Run golangci-lint (push) Successful in 4m36s
Unit Tests / test-unit (push) Successful in 2m49s
SDK Tests / sdk_tests_nameservice_expiry (push) Successful in 9m3s
SDK Tests / sdk_tests (push) Successful in 9m25s
SDK Tests / sdk_tests_auctions (push) Successful in 15m30s
Add CI workflows for SDK tests (#23)
Part of https://www.notion.so/Port-laconicd-to-cosmos-sdk-v0-50-x-43b30ab4e33a49c5912ebb2871cb777c

Reviewed-on: deep-stack/laconic2d#23
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-03-13 06:19:15 +00:00
..
cerc-io/laconic2d Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
flags.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
generated.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
gqlgen.yml Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
graphiql.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
models_gen.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
README.md Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
resolver.go Handle not found errors in GQL query resolvers (#20) 2024-03-12 08:40:23 +00:00
scalar.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
server.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
status.go Add CI workflows for SDK tests (#23) 2024-03-13 06:19:15 +00:00
util.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00
version.go Setup and integrate GQL server (#12) 2024-02-29 12:45:38 +00:00

cerc-io laconic gql

Browser : http://localhost:9473 for gql

Start server

laconic2d start --gql-playground --gql-server

Basic node status:

{
  getStatus {
    version
    node {
      id
      network
      moniker
    }
    sync {
      latest_block_height
      catching_up
    }
    num_peers
    peers {
      is_outbound
      remote_ip
    }
    disk_usage
  }
}

Full node status:

{
  getStatus {
    version
    node {
      id
      network
      moniker
    }
    sync {
      latest_block_hash
      latest_block_time
      latest_block_height
      catching_up
    }
    validator {
      address
      voting_power
      proposer_priority
    }
    validators {
      address
      voting_power
      proposer_priority
    }
    num_peers
    peers {
      node {
        id
        network
        moniker
      }
      is_outbound
      remote_ip
    }
    disk_usage
  }
}

Get records by IDs.

{
  getRecordsByIds(ids: ["bafyreigswvbm4dbpnbwkyegrcxd6kynqe4bivflo6esedgxnuofpzonwdy"]) {
    id
    names
    bondId
    createTime
    expiryTime
    owners
    attributes {
      key
      value {
        string
      }
    }
  }
}

Query records.

{
  queryRecords(attributes: [{ key: "type", value: { string: "crn:bot" } }]) {
    id
    names
    bondId
    createTime
    expiryTime
    owners
    attributes {
      key
      value {
        string
      }
    }
  }
}

Get account details:

{
  getAccounts(addresses: ["laconic17t5ywvqxntu0afc96tz0yxcx92ss0e2alhx2c2"]) {
    address
    pubKey
    number
    sequence
    balance {
      type
      quantity
    }
  }
}

Query bonds:

{
  queryBonds(
    attributes: [
      {
        key: "owner"
        value: { string: "laconic17t5ywvqxntu0afc96tz0yxcx92ss0e2alhx2c2" }
      }
    ]
  ) {
    id
    owner
    balance {
      type
      quantity
    }
  }
}

Get bonds by IDs.

{
  getBondsByIds(
    ids: [
      "1c2b677cb2a27c88cc6bf8acf675c94b69051125b40c4fd073153b10f046dd87"
      "c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440"
    ]
  ) {
    id
    owner
    balance {
      type
      quantity
    }
  }
}

Query Bonds by Owner

{
  queryBondsByOwner(
    ownerAddresses: ["laconic17t5ywvqxntu0afc96tz0yxcx92ss0e2alhx2c2"]
  ) {
    owner
    bonds {
      id
      owner
      balance {
        type
        quantity
      }
    }
  }
}

Query auctions by ids

{
  getAuctionsByIds(
    ids: ["be98f2073c246194276554eefdb4c95b682a35a0f06fbe619a6da57c10c93e90"]
  ) {
    id
    ownerAddress
    createTime
    minimumBid {
      type
      quantity
    }
    commitFee {
      type
      quantity
    }
    commitsEndTime
    revealFee {
      type
      quantity
    }
    revealsEndTime
    winnerBid {
      type
      quantity
    }
    winnerPrice {
      type
      quantity
    }
    winnerAddress
    bids {
      bidderAddress
      commitHash
      commitTime
      commitFee {
        type
        quantity
      }
      revealFee {
        type
        quantity
      }
      revealTime
      bidAmount {
        type
        quantity
      }
      status
    }
  }
}

LookUp Authorities

{
  lookupAuthorities(names: []) {
    ownerAddress
    ownerAddress
    height
    bondId
    status
    expiryTime
    auction {
      id
      ownerAddress
      createTime
      minimumBid {
        type
        quantity
      }
      commitFee {
        type
        quantity
      }
      commitsEndTime
      revealFee {
        type
        quantity
      }
      revealsEndTime
      winnerBid {
        type
        quantity
      }
      winnerPrice {
        type
        quantity
      }
      winnerAddress
      bids {
        bidderAddress
        commitHash
        commitTime
        commitFee {
          type
          quantity
        }
        revealFee {
          type
          quantity
        }
        revealTime
        bidAmount {
          type
          quantity
        }
        status
      }
    }
  }
}

LookUp Names

{
  lookupNames(names: ["crn://hello/test"]) {
    latest {
      id
      height
    }
    history {
      id
      height
    }
  }
}

Resolve Names

{
  resolveNames(names: ["asd"]) {
    id
    names
    bondId
    createTime
    expiryTime
    owners
    attributes {
      key
      value {
        string
      }
    }
  }
}