VidYen / VidYen-WordPress-Plugins

VidYen Plugins for WordPress
GNU General Public License v2.0
9 stars 2 forks source link

Monero Ocean API #130

Open VidYen opened 5 years ago

VidYen commented 5 years ago

Btw... I remember there was a Monero Ocean API I could tie in...

https://api.moneroocean.stream

https://cryptonote-pool-api.restlet.io/

VidYen commented 5 years ago

https://api.moneroocean.stream/pool/stats

VidYen commented 5 years ago

Ok.... so it looks like this https://api.moneroocean.stream/miner/{address}/stats/{worker}

This gives me a really good idea...

VidYen commented 5 years ago

Yes, it can get a h/s, but it doesn't update as often to do live hash tracking (as MO was not intended for a Coinhive like system) but it could be used for other stats.

https://cryptonote-pool-api.restlet.io/#type_miner_stats

{"lts":1543182916,"identifer":"vidyenlive","hash":2,"hash2":2,"totalHash":1167791,"validShares":9887,"invalidShares":17}

VidYen commented 5 years ago

After discussion with MO, I realized in order to avoid adblock, I would need to do curls server side... So I'm thinking of just doing a [vyps-vy256-stat] shortcode for workers on site.

VidYen commented 5 years ago

Another note could be found here:

"Is it possible to easily share/store link to a specific payment details? Yes. You can use https://moneroocean.stream/#/dashboard?addr=<your payment address> link to easily open your payment details in other browser."

For when we want to just have a link to the admin panel.

VidYen commented 5 years ago

this might get us a variable:

https://cryptonote-pool-api.restlet.io/#type_network_difficulty

VidYen commented 5 years ago

Found it!

https://api.moneroocean.stream/pool/stats/

VidYen commented 5 years ago

{"pool_list":["pplns"],"pool_statistics":{"hashRate":7802828,"miners":792,"totalHashes":286968407142795,"lastBlockFoundTime":1551819294,"lastBlockFound":1784376,"totalBlocksFound":3864,"totalMinersPaid":3669,"totalPayments":11024,"roundHashes":90963391844,"totalAltBlocksFound":46405,"altBlocksFound":{"11181":747,"11898":5597,"12211":554,"17750":1029,"18981":6243,"19091":1368,"19734":419,"20189":6129,"22023":627,"24182":950,"26968":769,"31014":1266,"34568":4195,"38081":6982,"48782":9530},"activePort":18081,"activePorts":[18081,"11181","11898","12211","17750","18981","20189","22023","24182","34568","38081","48782"],"activePortProfit":0.0000023206159963336237,"coinProfit":{"11181":3.424542291919844e-7,"11898":7.315262522216173e-7,"12211":0.000006075479190322598,"17750":0.00000492876867769033,"18081":0.0000023206159963336237,"18981":0.0000029495374591602746,"20189":0.000002423754352941236,"22023":0.0000039048699849038545,"24182":0.000005981777799155499,"31014":0.000005898907629557413,"34568":0.000005735642913664514,"38081":0.000002792543864879004,"48782":0.000003149911601548772},"coinComment":{"11181":"","11898":"","12211":"","17750":"","18081":"","18981":"","20189":"","22023":"","24182":"","31014":"Too small block value that can not be traded on TradeOgre\n","34568":"","38081":"","48782":""},"minBlockRewards":{"11181":0.03768804964424127,"11898":0.044363064190761456,"12211":0.04650418806600967,"17750":0.10521872371604062,"18081":3.06684935425012,"18981":0.05755352007714985,"20189":0.03764620885919805,"22023":0.0527273600217922,"24182":0.07465175481555128,"31014":0.0015882642203062316,"34568":0.03392261028799267,"38081":0.012523369655545447,"48782":0.02314051412597699},"pending":4.585112996499823,"price":{"btc":0.0130075,"usd":50.5232771765,"eur":44.6837968004},"currentEfforts":{"11181":5060692650,"11898":11531927885,"12211":341094660,"17750":1572026320,"18081":90963391844,"18981":954865036,"20189":405125673,"22023":2158039695,"24182":1855220,"31014":146994837,"34568":167411630,"38081":253105933,"48782":4379381038},"pplnsPortShares":{"11181":0.000029924910091069465,"11898":0.13660123857775094,"12211":0.024233140967511252,"17750":0.013361766244623517,"18081":0.017800715958708378,"18981":0.45084260800675013,"20189":0.032659539921584366,"22023":0.04355215268043849,"24182":0.05315212317719469,"34568":0.037320739033095095,"38081":0.033666336476977,"48782":0.15677971404527508},"pplnsWindowTime":27526.118,"portHash":{"11181":2020,"11898":5688293,"12211":38164,"17750":58969,"18081":935,"18981":121569,"20189":632668,"24182":342108,"34568":148661,"38081":321,"48782":3542604},"portMinerCount":{"11181":1,"11898":95,"12211":11,"17750":2,"18981":19,"20189":141,"24182":60,"34568":7,"38081":3,"48782":453}},"last_payment":1551816640}
VidYen commented 5 years ago

Felty256Today at 12:16 PM @MoneroOcean question... how do you arrive at the XMR rewards price? is there a way to look at block difficulty via your api and say each valid share is worth "x" of XMR? had a request to simplify reward credit payouts and i'm using the price of XMR but I like the site owner set their own multiplier and i realized there might be a more direct route MoneroOceanToday at 12:18 PM take coin block value and see how much XMR you can get using exchange API after that divide that value by XMR block amount and you will get this number Felty256Today at 12:18 PM can this be done on an indvidual basis using valid shares? MoneroOceanToday at 12:19 PM it is basically profitability value from the "Profit" column you can directly multiply coin hashes to that value Felty256Today at 12:20 PM ah i think i have the json downloaded and formatted to get the price recently MoneroOceanToday at 12:20 PM and get XMR based profits Felty256Today at 12:24 PM is it activePortProfit? i'm pulling this from the pool api

"activePortProfit":0.0000023080676031093277,
"coinProfit":
{
  "11181":3.44501332479476e-7,
  "11898":9.123710706481599e-7,
  "12211":0.000008150224630367548,
  "17750":0.000004589302012954752,
  "18081":0.0000023080676031093277,
  "18981":0.0000022610248998455255,
  "20189":0.000002410621526953633,
  "22023":0.000003747216743608779,
  "24182":0.0000051195663702384794,
  "31014":0.000005254363809070405,
  "34568":0.000005680064978454587,
  "38081":0.0000021781769480614217,
  "48782":0.000003135082268149105
},

would i take that and times it by total hashes in this info? {"lts":1552493285,"identifer":"savona","hash":10,"hash2":1,"totalHash":3011432,"validShares":9545,"invalidShares":7} along with the cut the site owner wants MoneroOceanToday at 12:27 PM yes Felty256Today at 12:28 PM ah MoneroOceanToday at 12:28 PM coinProfit is basically amount in XMR of 1 h/s per day Felty256Today at 12:28 PM but i want to use the activePortProfit? 0.0000023080676031093277 * 3011432 MoneroOceanToday at 12:28 PM activePortProfit is for XMR like 18081 port coin (it is XMR port) 18981 is graft etc Felty256Today at 12:29 PM hrm... this might get complicated because with algo switching i've seen it go from pico to half mid mining MoneroOceanToday at 12:29 PM 18981, // GRFT
38081, // Masari
48782, // Lethean
12211, // Ryo
11181, // Aeon
17750, // Haven
24182, // BitTube
20189, // Stellite
22023, // Loki
11898, // TurtleCoin
34568, // Wownero
31014, // Saronite
you miners can mine different coins at different times? I thought webminer pool set one coin for all miners at the same time so you can just use hashrate proportions like before Felty256Today at 12:31 PM

right now its doing pico but i have seen it throw half in there on occasion MoneroOceanToday at 12:32 PM so it is pico for all miners that are connected to one webminer pool Felty256Today at 12:32 PM yes mine MoneroOceanToday at 12:32 PM not yours Felty256Today at 12:32 PM currently, notgiven said he would add the current algo being mined to the server MoneroOceanToday at 12:32 PM all miners connected to one web miner pool Felty256Today at 12:32 PM this is client only well to tell MoneroOceanToday at 12:33 PM yes, I know Felty256Today at 12:33 PM but yes its running through my wmp server MoneroOceanToday at 12:33 PM but it is implelemted on server as hardcoded perf now Felty256Today at 12:33 PM but it has switched on its own before without my interaction but i've only seen pico and half-cn MoneroOceanToday at 12:35 PM string msg4 = ",\"algo-perf\": {\"cn/0\":100,\"cn/1\":96,\"cn/2\":84,\"cn/3\":84,\"cn/r\":37,\"cn-lite/0\":200,\"cn-lite/1\":200,\"cn-lite/2\":166,\"cn-pico/trtl\":630,\"cn/half\":120}}"; PoolConnection.cs ^^ it is hardcoded for all miners this way so do not matter what your local webminer is capable of I think it can approximate stuff pretty good but not ideal for all cases of course Felty256Today at 12:38 PM hrm.... if one were to make a variable reward system... should i just make a guestimate on either totalhashes or valid shares and tie it to something like block difficulty? it doesn't have to be precise as most of these people are using arbitrary rewards anyways like 10,000 gems = your reward MoneroOceanToday at 12:38 PM you get algo in job from pool so you can take best profit for that algo from pool api and use that but web miner pool need to be improved to run perf on local client side and be able to get several jobs from pool it is not easy thing to do since now it can only split one job from pool and it need to be able to work with several jobs in parallel (for different algos) it is the same thing for XNP I just use one algo job for all miners it will be much more complex to implement otherwise Felty256Today at 12:42 PM question... is validshares better to use for rewards than hashes if in cash the algo is switched? MoneroOceanToday at 12:42 PM not really Felty256Today at 12:44 PM hrm.... i'm starting to believe this might something i will have to tell people "stop using rewards that cost money and just use virtual rewards" this user really wants and automatic way to pay users in crypto for mining but i think its a bad idea to do it directly since his upfront costs of payout because then we've got 4 moving variables include the crypto he wants to payout in MoneroOceanToday at 12:46 PM stuff is tricky here, yep that is why I do not do PPS Felty256Today at 12:47 PM i'm going to write in the documentation of the plugin the philosophy of virtual rewards and physical rewards lol but thanks i've got enough information to play with for now MoneroOceanToday at 12:49 PM you are welcome

VidYen commented 5 years ago

Added this for prosperity. I will see if the co-op can handle. In mean time I'm updating the instructions to reflect educating the user.