Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Run with docker
docker compose build && docker compose up
Environment variables
Property | Default value | Description |
---|---|---|
APP_PORT
3000
Port used by the server
APP_DEFAULT_PAGINATION_LIMIT
25
Number of items returned by default
APP_MAX_PAGINATION_LIMIT
1000
Maximal number of items returned
APP_REQUIRE_API_KEY
true
Whether app should require api key
APP_API_KEY
super-secret-api-key
Api key
DB_NAME
admin
Database name
DB_HOST
localhost
Database host
DB_PORT
27017
Database port
DB_USERNAME
root
Database username
DB_PASSWORD
password
Database password
id - String!
begin - Float!
- Unix timestamp in milliseconds pointing to date when to start the chart. For example,to draw a monthly chart starting in January 2021, use 1609459200000.
n - Int!
- Number of objects to be returned for chart. For example, to draw a monthly chart, use 30.
length - Float!
- Amount of time in milliseconds from one time period to another. For example, to draw a monthly chart, use 1 day (86400000 milliseconds).
[DeviceChartDocument!]!
{"id": "abc123", "begin": 987.65, "n": 987, "length": 123.45}
order - String
- Order in which records will be sorted. Correct values are "asc" for ascending and "desc" for descending . Default = "asc
"
orderBy - String
- Field name used for sorting. For example { order: "desc", orderBy: "updatedAt" } returns most recently updated items first
search - String
- Used to search for match in multiple fields. It appends a new field (score) to returned items. For example query devices { search: "teltonika", order: "desc", orderby: "score" } returns devices that have "teltonika" string in one of the fields and places best matches first
skip - Int
- Used for pagination. Indicates how many records starting from the first one should be skipped. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default = 0
take - Int
- Used for pagination. Indicates how many records should be returned in the current request. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default value is 25. Maximum amount is 1000 . Default = 25
;
filter - SuppliersFilter
Default = {}
PaginatedSuppliers!
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
The Boolean scalar type represents true or false.
id - ID!
address - String!
supplier - String
owner - String
name - String
description - String
lat - Float
lng - Float
alt - Float
location - Location
distance - Float
- Returned only when fetching Devices from a circle using geoSearchCircle. This is the distance between the Device and a chosen point measured in meters.
visible - Boolean
active - Boolean
connected - Boolean
removed - Boolean
details - Details
custom - String
whitelist - [String!]!
createdAt - DateTime
updatedAt - DateTime
whitelisted - Boolean
score - Float
The Float
scalar type represents signed double-precision fractional values as specified by IEEE 754.
987.65
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID scalar type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
issuer - String
owner - String
name - String
device - String
burned - Boolean
deviceWhitelisted - Boolean
- Filter keys by Supplier device whitelist. For example, if set to true, this will return only keys for devices that are whitelisted by their Suppliers. If set to false,it will return only keys for devices that are not whitelisted by their Suppliers.If not given, it's not filtered at all.
The String scalar type represents textual data, represented as UTF-8 character sequences. The String scalar type is most often used by GraphQL to represent free-form human-readable text.
Data Service is a publicly available server that each Supplier can optionally use in its server infrastructure. This tool allows the implementation of advanced filtering, sorting and aggregation of data.
Data Service functionality is based on communication via gRPC (https://grpc.io/ ). Skey nodes send information to subscribed data service workers about any changes happening on blockchain.
Data Service consistconsists of two elements connected to the same database:
Data Service Worker - its task is to subscribe to gRPC and filter relevant blockchain data and handle changes. It filters and reacts to state updates such as transfers, issuing new keys, dApp invocations, data entries etc. Changes are saved in a structured form in the mongoDB database.
Data Service API - an application used to retrieve data from a database. It has no possibility to modify or create new documents. It uses graphQL interfaces to create multiple queries and pipelines for example fetching the list of devices that the selected address has access to.
The communication is authenticated using the api key added as the http header - for example:
{ "x-api-key": "superhiper=secret=key" }
order - String
- Order in which records will be sorted. Correct values are "asc" for ascending and "desc" for descending . Default = "asc
"
orderBy - String
- Field name used for sorting. For example { order: "desc", orderBy: "updatedAt" } returns most recently updated items first
search - String
- Used to search for match in multiple fields. It appends a new field (score) to returned items. For example query devices { search: "teltonika", order: "desc", orderby: "score" } returns devices that have "teltonika" string in one of the fields and places best matches first
skip - Int
- Used for pagination. Indicates how many records starting from the first one should be skipped. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default = 0
take - Int
- Used for pagination. Indicates how many records should be returned in the current request. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default value is 25. Maximum amount is 1000 . Default = 25
filter - EventsFilter
Default = {}
PaginatedEvents!
order - String
- Order in which records will be sorted. Correct values are "asc
" for ascending and "desc
" for descending . Default = "asc
"
orderBy - String
- Field name used for sorting. For example { order: "desc
", orderBy: "updatedAt
" } returns most recently updated items first
search - String
- Used to search for match in multiple fields. It appends a new field (score) to returned items. For example query devices { search: "teltonika
", order: "desc
", orderby: "score
" } returns devices that have "teltonika" string in one of the fields and places best matches first
skip - Int
- Used for pagination. Indicates how many records starting from the first one should be skipped. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default = 0
take - Int
- Used for pagination. Indicates how many records should be returned in the current request. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default value is 25. Maximum amount is 1000 . Default = 25
filter - DevicesFilter
Default = {}
geoSearch - GeoSearchInput
- Returns list of devices that are inside of selected rectangle. For example, for points [lat:49, lng: 16] as bottomLeft and [lat:54, lng:24] as upperRight, it's going to return all devices in Poland
geoSearchCircle - GeoSearchCircleInput
- Returns list of devices within radius of a selected point
keysOwner - String
- Returns list of devices to which an address has keys. For example, User with address user_1 is the owner of keys key_1 and key_2, key_1 is for device_1 and key_2 is for device_2. There are also user_2, device_3 and key_3. The method will return [device_1, device_2]. This is helpful when user need a list of devices he can interact with
includeRemoved - Boolean
- By default the list will not include Devices which have been removed by the Supplier. To also get Devices removed, set this flag to true. Default = false
Returns a PaginatedDevices!
Run with docker
Environment variables
APP_LOGS
true
Enable logging
APP_MIN_HEIGHT
1
Blockchain height from which worker starts synchronizing data
APP_TRACK_ALL_ACCOUNTS
true
Synchronize data for all blockchain accounts, even those that are not smart contracts
BLOCKCHAIN_DAPP_FATHER_ADDRESS
Address of blockchain account containing list of approved addresses
BLOCKCHAIN_NODE_URL
http://localhost:6869
Blockchain node url
BLOCKCHAIN_CHAIN_ID
R
Blockchain chain id
DB_NAME
admin
Database name
DB_HOST
localhost
Database host
DB_PORT
27017
Database port
DB_USERNAME
root
Database username
DB_PASSWORD
password
Database password
GRPC_HOST
localhost
Blockchain node GRPC service host
GRPC_PEERS
List of additional grpc nodes
GRPC_UPDATES_PORT
6881
Port of GRPC updates services
GRPC_API_PORT
6877
Port of GRPC api services
REDIS_QUEUE
default
Name of redis queue
REDIS_HOST
localhost
Redis host
REDIS_PORT
6379
Redis port
TEST_DAPP_FATHER_SEED
Dapp father address used for testing
TEST_GENESIS_SEED
Seed for address with tokens used for testing
TEST_INTEGRATION_DELAY
1200
Delay in milliseconds used for some tests
order - String
- Order in which records will be sorted. Correct values are "asc" for ascending and "desc" for descending . Default = "asc
"
orderBy - String
- Field name used for sorting. For example { order: "desc", orderBy: "updatedAt" } returns last updated items first
search - String
- Used to search for match in multiple fields. It appends a new field (score) to returned items. For example query devices { search: "teltonika", order: "desc", orderby: "score" } returns devices that have "teltonika" string in one of the fields and places best matches first
skip - Int
- Used for pagination. Indicates how many records starting from the first one should be skipped. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. . Default = 0
take - Int
- Used for pagination. Indicates how many records should be returned in the current request. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default value is 25. Maximum amount is 1000 . Default = 25
filter - KeysFilte
r - Default = {}
PaginatedKeys!
id - String!
begin - Float!
- Unix timestamp in milliseconds establishing the date when to start the chart. For example,to draw a monthly chart starting in January 2021 use 1609459200000
n - Int!
- Number of objects to be returned for chart. For example, to draw a monthly chart, use 30
length - Float!
- Amount of time in milliseconds from one time period to another. For example, to draw a monthly chart, use 1 day (86400000 milliseconds)
[KeyChartDocument!]!
{"id": "abc123", "begin": 987.65, "n": 123, "length": 123.45}
skip - Int
- Used for pagination. Indicates how many records starting from the first one should be skipped. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. . Default = 0
take - Int
- Used for pagination. Indicates how many records should be returned in the current request. For example, { skip: 20, take: 10 } equals 3 page and 10 items for each page. Default value is 25. Maximum amount is 1000 . Default = 25
input - String!
SearchResults!
{"skip": 0, "take": 25, "input": "xyz789"}
id - String!
begin - Float!
- Unix timestamp in milliseconds indicating the date when to start the chart. For example, to draw a monthly chart starting in January 2021 use 1609459200000
n - Int!
- Number of objects to be returned for chart. For example, to draw a monthly chart, use 30
length - Float!
- Amount of time in milliseconds from one time period to another. For example, to draw a monthly chart, use 1 day (86400000 milliseconds)
[SupplierChartDocument!]!
{"id": "xyz789", "begin": 123.45, "n": 987, "length": 123.45}