forked from blockchain-unica/blockapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
322b1db
commit 99bb78a
Showing
53 changed files
with
4,884 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
BlockchainDLib/.idea/libraries/* | ||
BlockchainDLib/.idea/misc.xml | ||
BlockchainDLib/.idea/modules.xml | ||
BlockchainDLib/.idea/modules/blockchaindlib-build.iml | ||
BlockchainDLib/.idea/modules/blockchaindlib.iml | ||
BlockchainDLib/.idea/sbt.xml | ||
BlockchainDLib/.idea/scala_compiler.xml | ||
BlockchainDLib/.idea/workspace.xml | ||
BlockchainDLib/org/bitcoinj/core/annotations.xml | ||
BlockchainDLib/project/target/**/*.class | ||
.idea/libraries/* | ||
.idea/misc.xml | ||
.idea/modules.xml | ||
.idea/modules/blockchaindlib-build.iml | ||
.idea/modules/blockchaindlib.iml | ||
.idea/sbt.xml | ||
.idea/scala_compiler.xml | ||
.idea/workspace.xml | ||
org/bitcoinj/core/annotations.xml | ||
project/target/**/*.class | ||
.idea/blockchain-api.iml | ||
.idea/misc.xml | ||
.idea/modules.xml | ||
.idea/vcs.xml | ||
.idea/workspace.xml | ||
BlockchainDLib/.idea/uiDesigner.xml | ||
BlockchainDLib/.idea/vcs.xml | ||
BlockchainDLib/project/target/** | ||
BlockchainDLib/target/** | ||
.idea/uiDesigner.xml | ||
.idea/vcs.xml | ||
project/target/** | ||
target/** |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Case study, Size (GB), Creation time (h), Query time (s), Updated to | ||
Basic view of the blockchain, 300, 9, 2860, 2017-06-27 | ||
\opreturn metadata, 0.5, 2, 0.5, 2017-06-27 | ||
Exchange rates, 30, 15, 477, 2017-06-27 | ||
Transaction fees, 23, 35, 448, 2017-06-27 | ||
Address tags, 0.8, 10, 1.8, 2017-06-27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
0-300,32.8493401875896 | ||
300-600,15.279544797252 | ||
600-900,9.64042220938312 | ||
900-1200,9.19924984277733 | ||
1200-1500,7.75422467828595 | ||
1500-1800,9.2913426492978 | ||
1800-2100,10.4874137955854 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
db.txWithRates.aggregate([ | ||
{ | ||
$project: { | ||
"outputSum" : 1, | ||
"range": { | ||
$concat: [ | ||
{ $cond: [{$and:[ {$gte:["$rate", 0 ]}, {$lt: ["$rate", 300]}]}, "0-300", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 300 ]}, {$lt: ["$rate", 600]}]}, "300-600", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 600 ]}, {$lt: ["$rate", 900]}]}, "600-900", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 900 ]}, {$lt: ["$rate", 1200]}]}, "900-1200", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 1200 ]}, {$lt: ["$rate", 1500]}]}, "1200-1500", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 1500 ]}, {$lt: ["$rate", 1800]}]}, "1500-1800", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 1800 ]}, {$lt: ["$rate", 2100]}]}, "1800-2100", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 2100 ]}, {$lt: ["$rate", 2400]}]}, "2100-2400", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 2400 ]}, {$lt: ["$rate", 2700]}]}, "2400-2700", ""] }, | ||
{ $cond: [{$and:[ {$gte:["$rate", 2700 ]}, {$lt: ["$rate", 3000]}]}, "2700-3000", ""] } | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
$group: { | ||
"_id" : "$range", | ||
count: { | ||
$sum: 1 | ||
}, | ||
sumOut: { $sum: "$outputSum" }, | ||
} | ||
}, | ||
{ | ||
$project : { | ||
_id: 1, | ||
avgOut: { $divide: [ "$sumOut", "$count" ] } | ||
} | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
n_ranges = 10 | ||
max_value = 3000 | ||
|
||
for i in xrange(n_ranges): | ||
min = max_value/n_ranges * i | ||
max = max_value/n_ranges * (i+1) | ||
print '{ $cond: [{$and:[ {$gte:["$rate", ' + str(min) + ' ]}, {$lt: ["$rate", ' + str(max) + ']}]}, "' + str(min) + "-" + str(max) + '", ""] },' | ||
|
||
|
Oops, something went wrong.