{"id":27801526,"url":"https://github.com/nautls/ergo-graphql","last_synced_at":"2025-05-01T05:01:52.878Z","repository":{"id":37022870,"uuid":"492634216","full_name":"nautls/ergo-graphql","owner":"nautls","description":"Ergo Platform GraphQL server","archived":false,"fork":false,"pushed_at":"2024-11-20T01:41:57.000Z","size":1906,"stargazers_count":16,"open_issues_count":19,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-27T01:33:17.481Z","etag":null,"topics":["blockchain","ergo","explorer","graphql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nautls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-16T00:11:41.000Z","updated_at":"2024-11-20T01:42:01.000Z","dependencies_parsed_at":"2024-06-21T17:39:39.092Z","dependency_job_id":"1c95fa6c-994b-4a87-8d48-b17cc2fa26b6","html_url":"https://github.com/nautls/ergo-graphql","commit_stats":{"total_commits":360,"total_committers":4,"mean_commits":90.0,"dds":"0.37777777777777777","last_synced_commit":"928491983b29013e0608f4ce83081176f00c7864"},"previous_names":["capt-nemo429/ergo-graphql"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nautls%2Fergo-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nautls%2Fergo-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nautls%2Fergo-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nautls%2Fergo-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nautls","download_url":"https://codeload.github.com/nautls/ergo-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251825376,"owners_count":21649941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ergo","explorer","graphql"],"created_at":"2025-05-01T05:01:18.945Z","updated_at":"2025-05-01T05:01:52.830Z","avatar_url":"https://github.com/nautls.png","language":"TypeScript","readme":"# ergo-graphql\n\nErgo GraphQL server is on top of [Ergo Platform's explorer database schema](https://github.com/ergoplatform/explorer-backend/blob/master/modules/explorer-core/src/main/resources/db/V9__Schema.sql).\n\nThis repository also includes a [TypeScript package for client-side static typing](/packages/ts-types/).\n\n## Project Setup (Manual)\n\n```\n$ npm ci\n```\n\n### Environment file pattern\n\nThe `.env` file must be placed in the root directory following the pattern described below.\n\n```env\nDB_HOST =                 # database host address\nDB_PORT =                 # database host port\nDB_NAME =                 # database name\nDB_USER_NAME =            # database username\nDB_USER_PWD =             # database password\nDB_SSL =                  # optional: true or false\n\nERGO_NODE_ADDRESS =       # http ergo node address\n\nREDIS_HOST = localhost    # optional: redis host address\nREDIS_PORT = 6379         # optional: redis host port\nREDIS_USER_NAME =         # optional: redis username\nREDIS_USER_PWD =          # optional: redis user password\n\nMAX_QUERY_DEPTH = 5       # optional: maximum query depth\n```\n\n### Compile and run for development\n\n```\n$ npm run dev\n```\n\n### Compile and run for production\n\n```\n$ npm run build\n$ npm run start\n```\n\n### Run unit tests\n\n```\n$ npm run test\n```\n\n### Lint\n\n```\n$ npm run lint\n```\n\n## Project Setup (Docker)\n\nYou can use Docker to setup the project, or just the redis, as well.\n\n### Building the `ergo-graphql` Docker image\n```\n$ docker -t ergo-graphql build .\n```\n\nUsing docker-compose, you can run the whole project, or just the redis container.\n\n### Running the redis container\n```\n$ docker compose up -d redis # For older versions, use docker-compose\n```\n\n### Running the whole project\n```\n$ docker compose up -d\n```\n\n## Requesting Data\n\nYou can either install some REST-API client (like [Insomnia](https://insomnia.rest/) and [Postman](https://www.postman.com/)). Or you can use curl to send a query as well:\n```\n$ curl -H 'Content-Type: application/json' -X POST -d '{\"query\": \"query {...}\"}' http://server.url\n```\n\nWe have a set of queries/mutation as well:\n### Boxes (Query)\nWith this query, you can get boxes of the ergo blockchain. The arguments of this query are:\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 50.\n- `boxId`(String): To filter a unique box by id; It's deprecated, please use `boxIds` instead.\n- `boxIds`([String!]): To filter a set of unique boxes by id.\n- `registers`(Registers): To filter boxes that have special registers\nfrom R4 to R9. Note that `registers` filter should be used in combination with `spent` and at least one of `boxId`, `transactionId`, `headerId`, `address`, `ergoTree` or `ergoTreeTemplateHash` fields.\n- `transactionId`(String): To filter output boxes of a unique transaction.\n- `headerId`(String): To filter boxes by their header id.\n- `spent`(Boolean): To filter spent or unspent boxes.\n- `tokenId`(String): To filter boxes which contain a certain token.\n- `address`(String): To filter boxes of a specific address; It's deprecated, please use `addresses` instead.\n- `addresses`([String!]): To filter boxes that belong to an array of addresses.\n- `ergoTree`(String): To filter boxes that have specific ergo trees; It's deprecated, please use `ergoTrees` instead.\n- `ergoTrees`([String!]): To filter boxes that have ergo trees belonging to an array.\n- `ergoTreeTemplateHash`(String): To filter boxes that have a certain ergo tree template hash.\n- `minHeight`(Int): To get boxes after a certain height in the blockchain (inclusive).\n- `maxHeight`(Int): To get boxes before a certain height in the blockchain (inclusive).\n- `heightType`(HeightFilterType): It could be either `settlement` or `creation` which indicated the type of height you want to filter boxes by.\n\n### Tokens (Query)\n\nGet tokens that have been minted on the ergo blockchain. The arguments of this query are:\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 50.\n- `tokenId`(String): To filter a unique token by its id; It's deprecated, please use `tokenIds` instead.\n- `tokenIds`([String!]): To filter a set of unique tokens by id.\n- `boxId`(String): To filter tokens by their minting box id.\n- `name`(String): To filter tokens by their names. You can use wildcards like \"name*\". Keep in mind that the number of wildcard chars can't exceed 2. \n\n### Inputs (Query)\n\nTo get input boxes of transactions in the ergo blockchain. The arguments of this query are:\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 50.\n- `transactionId`(String): To get input boxes of a special transaction.\n- `boxId`(String): To filter a unique box by id.\n- `headerId`(String): To get input boxes of a special header.\n\n### Transactions (Query)\n\nTo get the transactions of Ergo Blockchain. The arguments of this query are:\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 50.\n- `transactionId`(String): To filter a unique transaction by is id; It's deprecated, please use `transactionIds` instead.\n- `transactionIds`([String!]): To filter a set of unique transactions by id.\n- `headerId`(String): To filter transaction by the header id.\n- `inclusionHeight`(int): To filter transactions by the block height in which they included in the blockchain.\n- `address`(String): To filter transactions of an specific address; It's deprecated, please use `addresses` instead.\n- `addresses`([String!]): To filter transactions that belong to a set of addresses.\n- `minHeight`(Int): To filter transactions occurring after a certain height.\n- `maxHeight`(Int): To filter transactions occurring before a certain height.\n\n\n### DataInputs (Query)\n\nTo get information about boxes that have been used as data input in the blockchain. The arguments of this query are:\n\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 50.\n- `transactionId`(String): To filter dataInputs of an specific transaction, filtering by its id.\n- `boxId`(String): To filter data inputs by box id.\n- `headerId`(String): To filter dataInputs of a block which has a specific headerId.\n\n### BlockHeaders (Query)\n\nTo get info about the block headers of the blockchain. The arguments of this query are:\n\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 10.\n- `headerId`(String): To filter headers by their id.\n- `parentId`(String): To fetch a block header using its parent id.\n- `height`(Int): To retrieve a block header at a certain height.\n\n### Addresses (Query)\nTo get information about some addresses on the blockchain. The argument of this query are:\n- `addresses`([String!]): The list of addresses to filter.\n\n### Mempool (Query)\nTo get mempool boxes of the blockchain. This query does not have any arguments/filters.\n\n### Block (Query)\nTo get info about the block headers of the blockchain. The arguments of this query are:\n- `skip`(Int): How many items to skip; Default value is 0.\n- `take`(Int): How many items to take; Default value is 10.\n- `headerId`(String): To filter the block by header id.\n- `height`(Int): To filter a block with certain height.\n- `minHeight`(Int): To filter all blocks after a certain height.\n- `maxHeight`(Int): To filter all block before a certain height.\n\n### State (Query)\nTo get the state of the graphql instance. This status contains `difficulty`, `height`, and the `network`.\nThis query does not have any arguments/filters.\n\n### Info (Query)\nTo check info of the running graphql instance. This contains `version` for now.\n\n### CheckTransaction (Mutation)\nTo check whether a transaction is valid. It will return transaction id if it's valid, and empty string otherwise.\nThe input of ths mutation is signedTransaction of type `SignedTransaction` which is:\n```\ntype SignedTransaction {\n  id: String!\n  inpts: [TransactionInput!]!\n  dataInputs: [TransactionDataInput!]!\n  outputs: [TransactionOutput!]!\n  size: Int\n}\n``` \n\n### SubmitTransaction (Mutation)\nTo submit a transaction into the ergo blockchain. This will send the tx to the instance's node; if the operation suceeds it'll return the id of transaction. Input is the same `SignedTransaction` as defined above.\n\n","funding_links":[],"categories":["🛠️ Development Tooling \u003ca id=\"development-tooling\"\u003e\u003c/a\u003e"],"sub_categories":["🔌 Node Interaction \u0026 APIs \u003ca id=\"node-interaction--apis\"\u003e\u003c/a\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnautls%2Fergo-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnautls%2Fergo-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnautls%2Fergo-graphql/lists"}