ethermine_api 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +103 -5
- data/lib/ethermine_api/pool.rb +1 -1
- data/lib/ethermine_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c7018122fea85c09ed0300b6b6279bc10164d67
|
|
4
|
+
data.tar.gz: 04b61d0f351b196a55e010d3d0908dcd1ec50360
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c558baa11717abe624481888f0e170041946ee89fbcb8c8ed6175186b937386957715125860d782119565eabde50f15b4ca3a0bff904207fdbd19de32f7af352
|
|
7
|
+
data.tar.gz: d22620f476e095f5e8d94518e9f017aad263c0ea68524d58f4b9f077b7aa706f3cc62e16ea24fcf830b8c9749e04016c1d851892869efad9fbf43c158a811c94
|
data/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# EthermineApi
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
3
|
+
Light weight [ethermine.org](https://ethermine.org) api wrapper written in Ruby
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
@@ -22,7 +20,107 @@ Or install it yourself as:
|
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
> Ethpool, Ethermine & Flypool provide a harmonized API for accessing all publicly
|
|
24
|
+
> available information.
|
|
25
|
+
> Access to the API is limited to 100 requests / 15 minutes / ip.
|
|
26
|
+
> All information is cached for 2 minutes so there is no point in making more
|
|
27
|
+
> frequent requests.
|
|
28
|
+
|
|
29
|
+
[ethermine.org api doc](https://api.ethermine.org/docs/)
|
|
30
|
+
|
|
31
|
+
### Pool
|
|
32
|
+
|
|
33
|
+
#### Basic Pool Stats
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
EthermineApi::Pool.stats
|
|
37
|
+
# => #<OpenStruct status="OK", data=#<OpenStruct minedBlocks=[#<OpenStruct number=4380856, miner="f6F26015F0760f7A4B7f93E765bc48883Daf79a5", time=1508297435>, #<OpenStruct number=4380847, miner="848F0a6dC1ABe357b56892884C97387348858CA2", time=1508297307>, #<OpenStruct number=4380847, miner="10a7b4813166d8aa2ee61762d727010524a3927d", time=1508297282>, #<OpenStruct number=4380843, miner="3509F7bd9557F8a9b793759b3E3bfA2Cd505ae31", time=1508297257>, #<OpenStruct number=4380842, miner="bc049f47d8d6cdcf8d784aeb66bc0bbdd7dc1a45", time=1508297254>,#<OpenStruct number=4380830, miner="2F73FDA67B06b617a5d5F4de2c81b3427D53C680", time=1508297118>, #<OpenStruct number=4380826, miner="a23a1970cdb3eb47bff9e04171141776fe8a6cb1", time=1508297084>, #<OpenStruct number=4380823, miner="f88798b68067166e6d2fb1c50b7934db688fa118", time=1508297024>, #<OpenStruct number=4380821, miner="92CF722FAbF55fb8Bff11beebaC58897D242D8a6", time=1508297003>, #<OpenStruct number=4380820, miner="00F8f4508ddF1F210C1874060B4Ceab5dDAbd13E", time=1508296997>], topMiners=[#<OpenStruct miner="f1b3e00955d7cbcde70f4337e333cd84da3a1c36", hashRate=461864222222.22217>, #<OpenStruct miner="276b88fe9f3d8dc71a53034cc052f62648e3e99f", hashRate=196604222222.22223>, #<OpenStruct miner="b7b03ce91e5826bd8d223b15dedbdb8ef4ddd4a8", hashRate=184991888888.8889>, #<OpenStruct miner="362c89a6d8a1597ff41eb03e1e897d0d95827c54", hashRate=125916722222.22234>, #<OpenStruct miner="a65f825e4f82c26aee244512cba7add256bc0788", hashRate=123880111111.11111>, #<OpenStruct miner="482f7753b3d62c7d1fd0fdcb8fcc2d61704dfced", hashRate=81146333333.33336>, #<OpenStruct miner="58801ebec6685d0d5461a30999fa5df91549a59e", hashRate=78271888888.88887>, #<OpenStruct miner="68847a67605350c471b7a46c0ef27206512a6a14", hashRate=70088000000>, #<OpenStruct miner="0d4efc9557218e6ac6431c9d45ed7b4770cbe252", hashRate=69118111111.11111>, #<OpenStruct miner="d060904aa97c021ec31c8a502a8b2443f51a38bd", hashRate=64865666666.666664>], poolStats=#<OpenStruct hashRate=28705896277778.773, miners=66733, workers=230401, blocksPerHour=69.63>, price=#<OpenStruct usd=307.1, btc=0.05606>>>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Credits list (only for ethpool.org)
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
EthermineApi::Pool.credits(base_url: 'http://api.ethpool.org')
|
|
44
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct miner="87e22465bfe36496ae21a23c0be5f5956480e25b", hashrate=414166666.6666666, credit=2645199800000000>, #<OpenStruct miner="4ef8295f6D04452DD8aD040bf43Da859379Dc564", hashrate=238333333.33333337, credit=2634510200000000>, #<OpenStruct miner="249586e792dB363A179A259060bF32fd6C36c013", hashrate=257722222.2222222, credit=2632519800000000>, #<OpenStruct miner="2B9F67024dC91dEbab6A322d27201f5F80f6b06A", hashrate=945888888.888889, credit=2631665684962467>,...]>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Mined Block Stats
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
EthermineApi::Pool.blocks_history
|
|
51
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct time=1508212736, nbrBlocks=15, difficulty=1469986226066083>, #<OpenStruct time=1508216246, nbrBlocks=76, difficulty=1498157811667782>, #<OpenStruct time=1508219985, nbrBlocks=65, difficulty=1495924338718297>, #<OpenStruct time=1508223454, nbrBlocks=77, difficulty=1470413115601682>, #<OpenStruct time=1508227187, nbrBlocks=65, difficulty=1460372702365663>, #<OpenStruct time=1508230751, nbrBlocks=70, difficulty=1460910425240631>, #<OpenStruct time=1508234363, nbrBlocks=75, difficulty=1456608509189655>, #<OpenStruct time=1508237945, nbrBlocks=67, difficulty=1423382928506978>, #<OpenStruct time=1508241532, nbrBlocks=52, difficulty=1425447900135137>, #<OpenStruct time=1508245190, nbrBlocks=63, difficulty=1400461436689854>, #<OpenStruct time=1508248720, nbrBlocks=76, difficulty=1410667703939148>, #<OpenStruct time=1508252389, nbrBlocks=71, difficulty=1409925035518444>, #<OpenStruct time=1508255870, nbrBlocks=71, difficulty=1389940935574532>, #<OpenStruct time=1508259561, nbrBlocks=77, difficulty=1407629306676071>, #<OpenStruct time=1508263181, nbrBlocks=61, difficulty=1399384875766905>, #<OpenStruct time=1508266793, nbrBlocks=69, difficulty=1393112908301133>, #<OpenStruct time=1508270344, nbrBlocks=85, difficulty=1390290461807211>, #<OpenStruct time=1508273983, nbrBlocks=78, difficulty=1404529417941880>, #<OpenStruct time=1508277469, nbrBlocks=67, difficulty=1407907030026226>, #<OpenStruct time=1508281198, nbrBlocks=76, difficulty=1424382704053059>, #<OpenStruct time=1508284770, nbrBlocks=79, difficulty=1442483911584531>, #<OpenStruct time=1508288359, nbrBlocks=70, difficulty=1435421392397694>, #<OpenStruct time=1508291898, nbrBlocks=76, difficulty=1433857401029767>, #<OpenStruct time=1508295581, nbrBlocks=58, difficulty=1433133675561812>, #<OpenStruct time=1508298258, nbrBlocks=62, difficulty=1426020651269258>]>
|
|
52
|
+
|
|
53
|
+
#### Network Stats
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
EthermineApi::Pool.network_stats
|
|
57
|
+
# => #<OpenStruct status="OK", data=#<OpenStruct time=1508298297, blockTime=14.2129, difficulty=1417655795160128, hashrate=107244424361637, usd=306.59, btc=0.05612>>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Server Hashrate Stats
|
|
61
|
+
|
|
62
|
+
```ruby
|
|
63
|
+
EthermineApi::Pool.servers_stats
|
|
64
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct miner="87e22465bfe36496ae21a23c0be5f5956480e25b", hashrate=414166666.6666666, credit=2645199800000000>, #<OpenStruct miner="4ef8295f6D04452DD8aD040bf43Da859379Dc564", hashrate=238333333.33333337, credit=2634510200000000>, #<OpenStruct miner="249586e792dB363A179A259060bF32fd6C36c013", hashrate=257722222.2222222, credit=2632519800000000>, #<OpenStruct miner="2B9F67024dC91dEbab6A322d27201f5F80f6b06A", hashrate=945888888.888889, credit=2631665684962467>, #<OpenStruct miner="667C28528018a7Aa3179f3E3DA620E15EDBEED79", hashrate=1324111111.1111112, credit=2626431262474482>,...]>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Miner
|
|
68
|
+
|
|
69
|
+
#### History
|
|
70
|
+
|
|
71
|
+
```ruby
|
|
72
|
+
EthermineApi::Miner.history(id: <miner hash>)
|
|
73
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct time=1508212800, reportedHashrate=0, currentHashrate=223833333.33333334, validShares=193, invalidShares=0, staleShares=13, averageHashrate=255819830.24691355, activeWorkers=3>, #<OpenStruct time=1508213400, reportedHashrate=0, currentHashrate=223111111.1111111, validShares=193, invalidShares=0, staleShares=12, averageHashrate=255527777.77777773, activeWorkers=3>, #<OpenStruct time=1508214000, reportedHashrate=0, currentHashrate=228666666.6666667, validShares=198, invalidShares=0, staleShares=12, averageHashrate=255189429.01234564, activeWorkers=3>,...]>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### Payouts
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
EthermineApi::Miner.payouts(id: <miner hash>)
|
|
80
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct start=4246675, end=4342309, amount=1000144114602165800, txHash="0x376914aba43724b4637bfac6c0ba3d852f01de6ac9e82f988d8e9663e1f52475",paidOn=1507307206>, #<OpenStruct start=4157914, end=4246641, amount=1000300147302413600, txHash="0xeb92d2762a20b7e6ff46ad8f63aeec36227c2674fd0d6da5920b8e22fe261e92", paidOn=1504755124>, #<OpenStruct start=4099637, end=4157883, amount=1000299829170798700, txHash="0x36d380088e9a236a9900aaec0c8e54b3237344071afc79ea394aa63a4cfd1d6f", paidOn=1502740295>, #<OpenStruct start=3976116, end=4099603, amount=1000219294965464200, txHash="0x669907742afefae8c00cc4c2e086caf9890f1efa787ca7b109370465dc45167a", paidOn=1501505905>]>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Rounds
|
|
84
|
+
|
|
85
|
+
```ruby
|
|
86
|
+
EthermineApi::Miner.rounds(id: <miner hash>)
|
|
87
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct time=1508212800, reportedHashrate=0, currentHashrate=223833333.33333334, validShares=193, invalidShares=0, staleShares=13, averageHashrate=255819830.24691355, activeWorkers=3>, #<OpenStruct time=1508213400, reportedHashrate=0, currentHashrate=223111111.1111111, validShares=193, invalidShares=0, staleShares=12, averageHashrate=255527777.77777773, activeWorkers=3>, #<OpenStruct time=1508214000, reportedHashrate=0, currentHashrate=228666666.6666667, validShares=198, invalidShares=0, staleShares=12, averageHashrate=255189429.01234564, activeWorkers=3>,
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Settings
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
EthermineApi::Miner.settings(id: <miner hash>)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Statistics
|
|
97
|
+
|
|
98
|
+
```ruby
|
|
99
|
+
EthermineApi::Miner.stats(id: <miner hash>)
|
|
100
|
+
# => #<OpenStruct status="OK", data=#<OpenStruct time=1508299200, lastSeen=1508299199, reportedHashrate=0, currentHashrate=261666666.66666666, validShares=229, invalidShares=0, staleS│107 After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will hares=10, averageHashrate=206439927.73261067, activeWorkers=3, unpaid=366918340027796600, unconfirmed=nil, coinsPerMin=2.4173574397324627e-05, usdPerMin=0.007394696408141603, btcPerM│ allow you to experiment.
|
|
101
|
+
in=1.3510610730664735e-06>>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Worker
|
|
105
|
+
|
|
106
|
+
#### All Worker Statistics
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
EthermineApi::Worker.all(miner_id: <miner hash>)
|
|
110
|
+
# => #<OpenStruct status="OK", data=[#<OpenStruct worker="bitty-balls", time=1508299200, lastSeen=1508299195, reportedHashrate=0, currentHashrate=123611111.1111111, validShares=108, invalidShares=0, staleShares=5, averageHashrate=130379629.62962958>, #<OpenStruct worker="bitty-booge", time=1508299200, lastSeen=1508299157, reportedHashrate=0, currentHashrate=111055555.55555555, validShares=98, invalidShares=0, staleShares=3, averageHashrate=89804783.95061725>, #<OpenStruct worker="bitty-boosh", time=1508299200, lastSeen=1508299199, reportedHashrate=0, currentHashrate=27000000, validShares=23, invalidShares=0, staleShares=2, averageHashrate=27170524.69135802>]>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Individual Historical Worker Statistics
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
EthermineApi::Worker.history(id: <worker id>, miner_id: <miner hash>)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### Individual Worker Statistics
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
EthermineApi::Worker.stats(id: <worker id>, miner_id: <miner hash>)
|
|
123
|
+
```
|
|
26
124
|
|
|
27
125
|
## Development
|
|
28
126
|
|
|
@@ -40,4 +138,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
|
40
138
|
|
|
41
139
|
## Code of Conduct
|
|
42
140
|
|
|
43
|
-
Everyone interacting in the EthermineApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
141
|
+
Everyone interacting in the EthermineApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/natemacinnes/ethermine_api/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/ethermine_api/pool.rb
CHANGED