├── .gitignore ├── LICENSE ├── README.md ├── docker-compose.dev.yml ├── docker-compose.yml ├── fly ├── README.md └── fly.toml ├── stacks-graphql-api ├── config.yaml └── metadata │ ├── actions.graphql │ ├── actions.yaml │ ├── allow_list.yaml │ ├── cron_triggers.yaml │ ├── databases │ ├── databases.yaml │ └── stacks │ │ └── tables │ │ ├── public_blocks.yaml │ │ ├── public_ft_events.yaml │ │ ├── public_microblocks.yaml │ │ ├── public_nft_events.yaml │ │ ├── public_smart_contracts.yaml │ │ ├── public_stx_events.yaml │ │ ├── public_txs.yaml │ │ └── tables.yaml │ ├── query_collections.yaml │ ├── remote_schemas.yaml │ ├── rest_endpoints.yaml │ └── version.yaml └── stacks-node └── config └── Config.toml /.gitignore: -------------------------------------------------------------------------------- 1 | stacks-node/persistent-data 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Léo Pradel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

stacks-graphql-api

4 |

A GraphQL API to query the Stacks blockchain.

5 | 6 |
7 | 8 | > 🚧🚧🚧 Consider this repository as highly experimental 🚧🚧🚧 9 | 10 | ## Features 11 | 12 | - Query the Stacks blockchain using a GraphQL API. 13 | - Create complex queries including relations, pagination, sorting, and filtering. 14 | - Realtime updates via GraphQL subscriptions. 15 | - Blazing fast, using [Hasura](https://github.com/hasura/graphql-engine). 16 | 17 | ## Usage example 18 | 19 | ### Queries 20 | 21 | Get the data of transaction `0x5cca607a5fa44855e2b56dd4fc41a53b871c1f75eecbf5e271c2d6439e32b745`: 22 | 23 | ```graphql 24 | { 25 | transactions_connection( 26 | where: { 27 | tx_id: { 28 | _eq: "\\x5cca607a5fa44855e2b56dd4fc41a53b871c1f75eecbf5e271c2d6439e32b745" 29 | } 30 | } 31 | ) { 32 | edges { 33 | node { 34 | id 35 | sender_address 36 | fee_rate 37 | nonce 38 | contract_call_contract_id 39 | contract_call_function_name 40 | contract_call_function_args 41 | contract_call { 42 | source_code 43 | tx_id 44 | } 45 | block { 46 | block_hash 47 | block_height 48 | burn_block_time 49 | burn_block_hash 50 | burn_block_height 51 | } 52 | ft_events { 53 | asset_event_type_id 54 | asset_identifier 55 | sender 56 | recipient 57 | } 58 | nft_events { 59 | asset_event_type_id 60 | asset_identifier 61 | sender 62 | recipient 63 | } 64 | } 65 | } 66 | } 67 | } 68 | ``` 69 | 70 | ### Subscriptions 71 | 72 | Receive an event when a new block is mined: 73 | 74 | ```graphql 75 | subscription { 76 | blocks_connection(first: 1, order_by: {block_height: desc}) { 77 | edges { 78 | node { 79 | block_height 80 | block_hash 81 | burn_block_time 82 | burn_block_hash 83 | burn_block_height 84 | # Number of transactions included in the block 85 | transactions_aggregate { 86 | aggregate { 87 | count 88 | } 89 | } 90 | } 91 | } 92 | } 93 | ``` 94 | 95 | ## Deploying with docker-compose 96 | 97 | The `docker-compose.yml` file start a stacks-blockchain node, the stacks-blockchain-api which is seeding a Postgres database, and the Hasura GraphQL API. 98 | 99 | On your server run: 100 | 101 | ```sh 102 | docker-compose up -d 103 | ``` 104 | 105 | Then to apply the metadata to the deployed Hasura instance, run: 106 | 107 | ```sh 108 | cd stacks-graphql-api 109 | hasura metadata apply --endpoint https://my-endpoint --admin-secret "super-secret" 110 | ``` 111 | 112 | Finally to interact with the API, go to https://graphqlbin.com/v2/new (or any GraphiQL client) and use https://my-server-ip:8080/v1beta1/relay for the endpoint. On the right side, you will be able to browse the GraphQL schema docs. 113 | 114 | ## Contributing 115 | 116 | Do you have an idea or want to contribute? Pull requests are very welcome! 117 | 118 | ## Known limitations 119 | 120 | - No support for balances 121 | - Some tables are not tracked and exposed yet 122 | - No clean views to convert "bytea" to "hex" in the query response as well as the "where" arguments - Hasura does not support Materialized Views for relay yet https://github.com/hasura/graphql-engine/issues/5044 123 | 124 | ## License 125 | 126 | MIT License © [Léo Pradel](https://www.leopradel.com/) 127 | -------------------------------------------------------------------------------- /docker-compose.dev.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | stacks-blockchain: 4 | image: blockstack/stacks-blockchain:2.05.0.1.0 5 | command: /bin/stacks-node start --config /src/stacks-node/Config.toml 6 | ports: 7 | - "20443:20443" 8 | - "20444:20444" 9 | volumes: 10 | - ./stacks-node/persistent-data/stacks-blockchain:/root/stacks-node/data 11 | - ./stacks-node/config:/src/stacks-node 12 | networks: 13 | - stacks-blockchain 14 | 15 | stacks-blockchain-api: 16 | image: blockstack/stacks-blockchain-api:3.0.0 17 | environment: 18 | NODE_ENV: production 19 | PG_HOST: postgres 20 | PG_PORT: 5432 21 | PG_USER: postgres 22 | PG_PASSWORD: postgres 23 | PG_DATABASE: postgres 24 | STACKS_CHAIN_ID: 0x00000001 25 | V2_POX_MIN_AMOUNT_USTX: 90000000260 26 | STACKS_CORE_EVENT_PORT: 3700 27 | STACKS_CORE_EVENT_HOST: 0.0.0.0 28 | STACKS_BLOCKCHAIN_API_PORT: 3999 29 | STACKS_BLOCKCHAIN_API_HOST: 0.0.0.0 30 | STACKS_BLOCKCHAIN_API_DB: pg 31 | STACKS_CORE_RPC_HOST: stacks-blockchain 32 | STACKS_CORE_RPC_PORT: 20443 33 | ports: 34 | - "3700:3700" 35 | - "3999:3999" 36 | networks: 37 | - stacks-blockchain 38 | depends_on: 39 | - postgres 40 | 41 | postgres: 42 | image: postgres:12.7 43 | restart: always 44 | ports: 45 | - "5432:5432" 46 | volumes: 47 | - ./stacks-node/persistent-data/postgres:/var/lib/postgresql/data 48 | environment: 49 | POSTGRES_USER: postgres 50 | POSTGRES_PASSWORD: postgres 51 | POSTGRES_DB: postgres 52 | POSTGRES_PORT: 5432 53 | networks: 54 | - stacks-blockchain 55 | 56 | graphql-engine: 57 | image: hasura/graphql-engine:v2.3.0 58 | ports: 59 | - "8080:8080" 60 | networks: 61 | - stacks-blockchain 62 | depends_on: 63 | - "postgres" 64 | restart: always 65 | environment: 66 | ## postgres database to store Hasura metadata 67 | HASURA_GRAPHQL_METADATA_DATABASE_URL: "postgres://postgres:postgres@postgres:5432/postgres" 68 | ## this env var can be used to add the above postgres database to Hasura as a data source. this can be removed/updated based on your needs 69 | PG_DATABASE_URL: "postgres://postgres:postgres@postgres:5432/postgres" 70 | ## enable the console served by server 71 | HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console 72 | ## enable debugging mode. It is recommended to disable this in production 73 | HASURA_GRAPHQL_DEV_MODE: "true" 74 | HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log 75 | ## uncomment next line to set an admin secret 76 | # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey 77 | 78 | volumes: 79 | db_data: 80 | 81 | networks: 82 | stacks-blockchain: 83 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | stacks-blockchain: 4 | image: blockstack/stacks-blockchain:2.05.0.1.0 5 | command: /bin/stacks-node start --config /src/stacks-node/Config.toml 6 | ports: 7 | - "20443:20443" 8 | - "20444:20444" 9 | volumes: 10 | - ./stacks-node/persistent-data/stacks-blockchain:/root/stacks-node/data 11 | - ./stacks-node/config:/src/stacks-node 12 | networks: 13 | - stacks-blockchain 14 | 15 | stacks-blockchain-api: 16 | image: blockstack/stacks-blockchain-api:3.0.0 17 | environment: 18 | NODE_ENV: production 19 | PG_HOST: postgres 20 | PG_PORT: 5432 21 | PG_USER: "${POSTGRES_USER}" 22 | PG_PASSWORD: "${POSTGRES_PASSWORD}" 23 | PG_DATABASE: "${POSTGRES_DB}" 24 | STACKS_CHAIN_ID: 0x00000001 25 | V2_POX_MIN_AMOUNT_USTX: 90000000260 26 | STACKS_CORE_EVENT_PORT: 3700 27 | STACKS_CORE_EVENT_HOST: 0.0.0.0 28 | STACKS_BLOCKCHAIN_API_PORT: 3999 29 | STACKS_BLOCKCHAIN_API_HOST: 0.0.0.0 30 | STACKS_BLOCKCHAIN_API_DB: pg 31 | STACKS_CORE_RPC_HOST: stacks-blockchain 32 | STACKS_CORE_RPC_PORT: 20443 33 | ports: 34 | - "3700:3700" 35 | - "3999:3999" 36 | networks: 37 | - stacks-blockchain 38 | depends_on: 39 | - postgres 40 | 41 | postgres: 42 | image: postgres:12.7 43 | restart: always 44 | ports: 45 | - "5432:5432" 46 | volumes: 47 | - ./stacks-node/persistent-data/postgres:/var/lib/postgresql/data 48 | environment: 49 | POSTGRES_USER: "${POSTGRES_USER}" 50 | POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}" 51 | POSTGRES_DB: "${POSTGRES_DB}" 52 | POSTGRES_PORT: 5432 53 | networks: 54 | - stacks-blockchain 55 | 56 | graphql-engine: 57 | image: hasura/graphql-engine:v2.3.0 58 | ports: 59 | - "8080:8080" 60 | networks: 61 | - stacks-blockchain 62 | depends_on: 63 | - "postgres" 64 | restart: always 65 | environment: 66 | HASURA_GRAPHQL_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}" 67 | HASURA_GRAPHQL_ENABLE_CONSOLE: "false" 68 | HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "user" 69 | HASURA_GRAPHQL_ENABLE_TELEMETRY: "false" 70 | # Change the value in production 71 | HASURA_GRAPHQL_ADMIN_SECRET: "super-secret" 72 | 73 | volumes: 74 | db_data: 75 | 76 | networks: 77 | stacks-blockchain: 78 | -------------------------------------------------------------------------------- /fly/README.md: -------------------------------------------------------------------------------- 1 | # stacks-graphql-api 2 | 3 | The demo version of stacks-graphql-api is deployed on fly.io. 4 | 5 | ## Deployment 6 | 7 | 1. Set the secrets 8 | 9 | ```sh 10 | cd fly 11 | flyctl secrets set \ 12 | HASURA_GRAPHQL_DATABASE_URL="postgres://user:pass@serverhost.com:5432/databasename" \ 13 | HASURA_GRAPHQL_ADMIN_SECRET="OurAdminSecret" 14 | ``` 15 | 16 | 2. Disable autoscaling 17 | 18 | ```sh 19 | flyctl autoscale disable 20 | ``` 21 | 22 | 3. Deploy 23 | 24 | ```sh 25 | flyctl deploy 26 | ``` 27 | 28 | 4. Apply the metadata to the deployed hasura instance 29 | 30 | ```sh 31 | cd stacks-graphql-api 32 | hasura metadata apply --endpoint https://my-endpoint --admin-secret "OurAdminSecret" 33 | ``` 34 | -------------------------------------------------------------------------------- /fly/fly.toml: -------------------------------------------------------------------------------- 1 | app = "stacks-graphql-api-hasura" 2 | 3 | kill_signal = "SIGINT" 4 | kill_timeout = 5 5 | processes = [] 6 | 7 | [env] 8 | HASURA_GRAPHQL_ENABLE_CONSOLE = "false" 9 | HASURA_GRAPHQL_UNAUTHORIZED_ROLE = "user" 10 | HASURA_GRAPHQL_ENABLE_TELEMETRY = "false" 11 | 12 | [experimental] 13 | allowed_public_ports = [] 14 | auto_rollback = true 15 | 16 | [build] 17 | image = "hasura/graphql-engine:v2.1.1" 18 | 19 | [[services]] 20 | http_checks = [] 21 | internal_port = 8080 22 | processes = ["app"] 23 | protocol = "tcp" 24 | script_checks = [] 25 | 26 | [services.concurrency] 27 | hard_limit = 25 28 | soft_limit = 20 29 | type = "connections" 30 | 31 | [[services.ports]] 32 | handlers = ["http"] 33 | port = 80 34 | 35 | [[services.ports]] 36 | handlers = ["tls", "http"] 37 | port = 443 38 | 39 | [[services.tcp_checks]] 40 | grace_period = "1s" 41 | interval = "15s" 42 | restart_limit = 0 43 | timeout = "2s" 44 | -------------------------------------------------------------------------------- /stacks-graphql-api/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | metadata_directory: metadata 4 | actions: 5 | kind: synchronous 6 | handler_webhook_baseurl: http://localhost:3000 7 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/actions.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pradel/stacks-graphql-api/fabc73c7eeea5b370e8ecfbb1aaf4f2a68aae07f/stacks-graphql-api/metadata/actions.graphql -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: stacks 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: postgres://postgres:postgres@postgres:5432/postgres 6 | isolation_level: read-committed 7 | use_prepared_statements: false 8 | tables: "!include stacks/tables/tables.yaml" 9 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_blocks.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: blocks 3 | schema: public 4 | array_relationships: 5 | - name: ft_events 6 | using: 7 | manual_configuration: 8 | column_mapping: 9 | index_block_hash: index_block_hash 10 | insertion_order: null 11 | remote_table: 12 | name: ft_events 13 | schema: public 14 | - name: nft_events 15 | using: 16 | manual_configuration: 17 | column_mapping: 18 | index_block_hash: index_block_hash 19 | insertion_order: null 20 | remote_table: 21 | name: nft_events 22 | schema: public 23 | - name: smart_contracts 24 | using: 25 | manual_configuration: 26 | column_mapping: 27 | index_block_hash: index_block_hash 28 | insertion_order: null 29 | remote_table: 30 | name: smart_contracts 31 | schema: public 32 | - name: stx_events 33 | using: 34 | manual_configuration: 35 | column_mapping: 36 | index_block_hash: index_block_hash 37 | insertion_order: null 38 | remote_table: 39 | name: stx_events 40 | schema: public 41 | - name: transactions 42 | using: 43 | manual_configuration: 44 | column_mapping: 45 | index_block_hash: index_block_hash 46 | insertion_order: null 47 | remote_table: 48 | name: txs 49 | schema: public 50 | select_permissions: 51 | - permission: 52 | columns: 53 | - index_block_hash 54 | - block_hash 55 | - block_height 56 | - burn_block_time 57 | - burn_block_hash 58 | - burn_block_height 59 | - miner_txid 60 | - parent_index_block_hash 61 | - parent_block_hash 62 | - parent_microblock_hash 63 | - parent_microblock_sequence 64 | - canonical 65 | - execution_cost_read_count 66 | - execution_cost_read_length 67 | - execution_cost_runtime 68 | - execution_cost_write_count 69 | - execution_cost_write_length 70 | filter: {} 71 | limit: 100 72 | role: user 73 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_ft_events.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: ft_events 3 | schema: public 4 | object_relationships: 5 | - name: block 6 | using: 7 | manual_configuration: 8 | column_mapping: 9 | index_block_hash: index_block_hash 10 | insertion_order: null 11 | remote_table: 12 | name: blocks 13 | schema: public 14 | - name: transaction 15 | using: 16 | manual_configuration: 17 | column_mapping: 18 | tx_id: tx_id 19 | insertion_order: null 20 | remote_table: 21 | name: txs 22 | schema: public 23 | select_permissions: 24 | - permission: 25 | columns: 26 | - id 27 | - event_index 28 | - tx_id 29 | - tx_index 30 | - block_height 31 | - index_block_hash 32 | - parent_index_block_hash 33 | - microblock_hash 34 | - microblock_sequence 35 | - microblock_canonical 36 | - canonical 37 | - asset_event_type_id 38 | - asset_identifier 39 | - amount 40 | - sender 41 | - recipient 42 | filter: {} 43 | limit: 100 44 | role: user 45 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_microblocks.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: microblocks 3 | schema: public 4 | select_permissions: 5 | - permission: 6 | columns: 7 | - id 8 | - canonical 9 | - microblock_canonical 10 | - block_hash 11 | - index_block_hash 12 | - microblock_hash 13 | - microblock_parent_hash 14 | - parent_block_hash 15 | - parent_burn_block_hash 16 | - parent_index_block_hash 17 | - block_height 18 | - microblock_sequence 19 | - parent_block_height 20 | - parent_burn_block_height 21 | - parent_burn_block_time 22 | - receive_timestamp 23 | filter: {} 24 | limit: 100 25 | role: user 26 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_nft_events.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: nft_events 3 | schema: public 4 | object_relationships: 5 | - name: block 6 | using: 7 | manual_configuration: 8 | column_mapping: 9 | index_block_hash: index_block_hash 10 | insertion_order: null 11 | remote_table: 12 | name: blocks 13 | schema: public 14 | - name: transaction 15 | using: 16 | manual_configuration: 17 | column_mapping: 18 | tx_id: tx_id 19 | insertion_order: null 20 | remote_table: 21 | name: txs 22 | schema: public 23 | select_permissions: 24 | - permission: 25 | columns: 26 | - id 27 | - event_index 28 | - tx_id 29 | - tx_index 30 | - block_height 31 | - index_block_hash 32 | - parent_index_block_hash 33 | - microblock_hash 34 | - microblock_sequence 35 | - microblock_canonical 36 | - canonical 37 | - asset_event_type_id 38 | - asset_identifier 39 | - value 40 | - sender 41 | - recipient 42 | filter: {} 43 | limit: 100 44 | role: user 45 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_smart_contracts.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: smart_contracts 3 | schema: public 4 | object_relationships: 5 | - name: block 6 | using: 7 | manual_configuration: 8 | column_mapping: 9 | index_block_hash: index_block_hash 10 | insertion_order: null 11 | remote_table: 12 | name: blocks 13 | schema: public 14 | - name: transaction 15 | using: 16 | manual_configuration: 17 | column_mapping: 18 | tx_id: tx_id 19 | insertion_order: null 20 | remote_table: 21 | name: txs 22 | schema: public 23 | select_permissions: 24 | - permission: 25 | columns: 26 | - id 27 | - tx_id 28 | - canonical 29 | - contract_id 30 | - block_height 31 | - index_block_hash 32 | - parent_index_block_hash 33 | - microblock_hash 34 | - microblock_sequence 35 | - microblock_canonical 36 | - source_code 37 | - abi 38 | filter: {} 39 | limit: 100 40 | role: user 41 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_stx_events.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: stx_events 3 | schema: public 4 | object_relationships: 5 | - name: block 6 | using: 7 | manual_configuration: 8 | column_mapping: 9 | block_height: block_height 10 | insertion_order: null 11 | remote_table: 12 | name: blocks 13 | schema: public 14 | select_permissions: 15 | - permission: 16 | columns: 17 | - id 18 | - event_index 19 | - tx_id 20 | - tx_index 21 | - block_height 22 | - index_block_hash 23 | - parent_index_block_hash 24 | - microblock_hash 25 | - microblock_sequence 26 | - microblock_canonical 27 | - canonical 28 | - asset_event_type_id 29 | - amount 30 | - sender 31 | - recipient 32 | filter: {} 33 | limit: 100 34 | role: user 35 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/public_txs.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: txs 3 | schema: public 4 | configuration: 5 | custom_column_names: {} 6 | custom_name: transactions 7 | custom_root_fields: {} 8 | object_relationships: 9 | - name: block 10 | using: 11 | manual_configuration: 12 | column_mapping: 13 | block_height: block_height 14 | insertion_order: null 15 | remote_table: 16 | name: blocks 17 | schema: public 18 | - name: contract_call 19 | using: 20 | manual_configuration: 21 | column_mapping: 22 | contract_call_contract_id: contract_id 23 | insertion_order: null 24 | remote_table: 25 | name: smart_contracts 26 | schema: public 27 | - name: smart_contract 28 | using: 29 | manual_configuration: 30 | column_mapping: 31 | smart_contract_contract_id: contract_id 32 | insertion_order: null 33 | remote_table: 34 | name: smart_contracts 35 | schema: public 36 | array_relationships: 37 | - name: ft_events 38 | using: 39 | manual_configuration: 40 | column_mapping: 41 | tx_id: tx_id 42 | insertion_order: null 43 | remote_table: 44 | name: ft_events 45 | schema: public 46 | - name: nft_events 47 | using: 48 | manual_configuration: 49 | column_mapping: 50 | tx_id: tx_id 51 | insertion_order: null 52 | remote_table: 53 | name: nft_events 54 | schema: public 55 | select_permissions: 56 | - permission: 57 | columns: 58 | - id 59 | - tx_id 60 | - tx_index 61 | - raw_result 62 | - index_block_hash 63 | - block_hash 64 | - block_height 65 | - parent_block_hash 66 | - burn_block_time 67 | - parent_burn_block_time 68 | - type_id 69 | - anchor_mode 70 | - status 71 | - canonical 72 | - post_conditions 73 | - nonce 74 | - fee_rate 75 | - sponsored 76 | - sponsor_address 77 | - sender_address 78 | - origin_hash_mode 79 | - event_count 80 | - execution_cost_read_count 81 | - execution_cost_read_length 82 | - execution_cost_runtime 83 | - execution_cost_write_count 84 | - execution_cost_write_length 85 | - raw_tx 86 | - microblock_canonical 87 | - microblock_sequence 88 | - microblock_hash 89 | - parent_index_block_hash 90 | - token_transfer_recipient_address 91 | - token_transfer_amount 92 | - token_transfer_memo 93 | - smart_contract_contract_id 94 | - smart_contract_source_code 95 | - contract_call_contract_id 96 | - contract_call_function_name 97 | - contract_call_function_args 98 | - poison_microblock_header_1 99 | - poison_microblock_header_2 100 | - coinbase_payload 101 | filter: {} 102 | limit: 100 103 | role: user 104 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/databases/stacks/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - "!include public_blocks.yaml" 2 | - "!include public_ft_events.yaml" 3 | - "!include public_nft_events.yaml" 4 | - "!include public_smart_contracts.yaml" 5 | - "!include public_stx_events.yaml" 6 | - "!include public_txs.yaml" 7 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /stacks-graphql-api/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /stacks-node/config/Config.toml: -------------------------------------------------------------------------------- 1 | [node] 2 | working_dir = "/root/stacks-node/data" 3 | rpc_bind = "0.0.0.0:20443" 4 | p2p_bind = "0.0.0.0:20444" 5 | bootstrap_node = "02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444,02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444,03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444" 6 | wait_time_for_microblocks = 10000 7 | 8 | [[events_observer]] 9 | endpoint = "stacks-blockchain-api:3700" 10 | retry_count = 255 11 | events_keys = ["*"] 12 | 13 | [burnchain] 14 | chain = "bitcoin" 15 | mode = "mainnet" 16 | peer_host = "bitcoin.blockstack.com" 17 | username = "blockstack" 18 | password = "blockstacksystem" 19 | rpc_port = 8332 20 | peer_port = 8333 21 | 22 | [connection_options] 23 | read_only_call_limit_write_length = 0 24 | read_only_call_limit_read_length = 100000 25 | read_only_call_limit_write_count = 0 26 | read_only_call_limit_read_count = 30 27 | read_only_call_limit_runtime = 1000000000 28 | --------------------------------------------------------------------------------