Skip to content

Commit

Permalink
docs: add dr examples to import
Browse files Browse the repository at this point in the history
Signed-off-by: Claudia Bartoli Duncan <claudia@stampery.co>
  • Loading branch information
clbartoli committed Apr 6, 2020
1 parent 3aef264 commit c3fbd41
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
35 changes: 35 additions & 0 deletions examples/data_request1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "Data request example 1",
"description": "Request to get the height of the character Luke Skywalker",
"radRequest": {
"notBefore": 0,
"retrieve": [
{
"kind": "HTTP-GET",
"url": "https://swapi.co/api/people/",
"script": [
119,
[
102,
"results"
],
[
24,
8
],
-2
]
}
],
"aggregate": {
"filters": [],
"reducer": 2
},
"tally": {
"filters": [
8
],
"reducer": 2
}
}
}
47 changes: 47 additions & 0 deletions examples/data_request2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Data request example 2",
"description": "Request to get the bitcoin price from two sources",
"radRequest": {
"timelock": 1574703683,
"retrieve": [
{
"kind": "HTTP-GET",
"url": "https://www.bitstamp.net/api/ticker/",
"script": [
119,
[
100,
"last"
]
]
},
{
"kind": "HTTP-GET",
"url": "https://api.coindesk.com/v1/bpi/currentprice.json",
"script": [
119,
[
102,
"bpi"
],
[
102,
"USD"
],
[
100,
"rate_float"
]
]
}
],
"aggregate": {
"filters": [],
"reducer": 3
},
"tally": {
"filters": [],
"reducer": 3
}
}
}
50 changes: 50 additions & 0 deletions examples/data_request3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "Data request example 3",
"description": "Request to get the last bitcoin blockhash from three sources",
"radRequest": {
"timelock": 0,
"retrieve": [
{
"kind": "HTTP-GET",
"url": "https://blockchain.info/q/latesthash",
"script": []
},
{
"kind": "HTTP-GET",
"url": "https://api-r.bitcoinchain.com/v1/status",
"script": [
119,
[
103,
"hash"
]
]
},
{
"kind": "HTTP-GET",
"url": "https://api.blockchair.com/bitcoin/stats",
"script": [
119,
[
102,
"data"
],
[
103,
"best_block_hash"
]
]
}
],
"aggregate": {
"filters": [],
"reducer": 2
},
"tally": {
"filters": [
8
],
"reducer": 2
}
}
}

0 comments on commit c3fbd41

Please sign in to comment.