uaktags / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Coininfo #12

Closed spy0012 closed 5 years ago

spy0012 commented 5 years ago

Coininfo is missing from settings.json - i have added the setting true or false but i think i am missing something for it to show the page

/var/www/vhosts/explorer/views/coininfo.pug:31 29| h5.sub=t('coininfo.coin_supply') 30| .row.info-row > 31| if settings.coininfo.masternodes.enabled 32| .col-md-4 33| h4 #{totalMasternodes} 34| h5.sub=t('coininfo.total_nodes') Cannot read property 'enabled' of undefined

I don't think app.js looks for a toggle or index i will look at previous explorer i used to see if that is the case.

Sorry to keep adding issues, i am trying to fix these i was okay with jade but a lot of things changed and i haven't quite caught up.

uaktags commented 5 years ago
i am trying to fix these i was okay with jade but a lot of things changed and i haven't quite caught up.

Yea that's the same issue I'm having. Quite a few things have changed since pug evolved.

I'll take a look at the missing variable in settings.json.template. I believe one of my test servers has this working in it.

uaktags commented 5 years ago

Give that a try, let me know if that helps. Looks like I didn't update the template:

  // Coin info page
  "coininfo": {
    "basic_info_links": [
      ["Github", "http://github.com/"]
    ],
    "masternodes":{
      "enabled": true,
      "deposit_required": 50000
    },
    "block_time_sec": 120,
    "block_reward_mn": 5
  },
spy0012 commented 5 years ago

Great the page loads as it should but because of issue #10 data is not inserted, but it fixes the viewing of the page :) However it doesn't show required coins value "deposit_required": i am assuming that isn't because the the masternode details are not pulling

uaktags commented 5 years ago

Nope, its not showing because variables have changed. fix incoming to just pull from settings.

uaktags commented 5 years ago

For what its worth, in regards to coininfo, it's largely based off of another repo (probably Sigwo or Masterhash). However, they were very specific to their respected coins (atleast sigwo was, i've never seen masterhash because they deleted their repo). So alot of coininfo is uncommented out, which you can see by going to routes/index.js and going to line 130. Alot of that functionality is still to be brought in with better integration of the Coin markets.

spy0012 commented 5 years ago

I was looking in the wrong area for that setting lol, thanks

Yes the previous explorer had estimated earnings and i am sure they were incorrect roi but never really looked into it

spy0012 commented 5 years ago

Just a quick one regarding locked coins don’t show on coininfo, I am assuming it’s a command missing

spy0012 commented 5 years ago

Thanks, i was looking at the wrong option - Great work

spy0012 commented 5 years ago

Another thing i have noticed any links added to coin info get this appended a link like below and not the actual link, i will look at coininfo.pug i think its template related.

explorerurl/coininfo#{item[1]} instead of github link.

Unrelated and i tried to get this to work maybe i just don't how to parse settings but how would i add further headers to this section

image

So say after basic info i wanted another header saying Exchanges so we would have Basic info > links Exchanges > links

uaktags commented 5 years ago

Alright, how about this?

// Coin info page
  "coininfo": {
    "basic_info_links": {
      "Overview": {
        "Github":"https://github.com/ripple/rippled"
      },
      "Exchanges": {
        "HitBTC": "https://hitbtc.com/XRP-to-BTC",
        "Binance": "https://www.binance.com/en/trade/XRP_BTC"
      },
      "Misc": {
        "CoinGecko": "https://www.coingecko.com/en/coins/ripple#panel"
      }
    },

choice1

Basically, I wouldn't care what you put in here and it can be anything you want:

// Coin info page
  "coininfo": {
    "basic_info_links": {
      "Coin Website": {
        "Github":"https://github.com/ripple/rippled"
      },
      "Social Netowrk": {
        "Github": "https://hitbtc.com/XRP-to-BTC",
        "Google+": "REST-IN-PEACE"
      },
      "RickJames": {
        "I'm": "Rick James.....(.com)"
      },
"More": {
        "Is": "better.com"
      },
    },
uaktags commented 5 years ago

Or are you looking for additional cards? 2019-05-01 13_04_34-Vulc

uaktags commented 5 years ago

If this is what you're looking for, then I'll push an update for it. I'll try to leave backward compatibility for anyone that has the old way, but I do agree having a few more links would look nicer.

spy0012 commented 5 years ago

I like the last one https://github.com/uaktags/explorer/issues/12#issuecomment-488343776

Looks more organised

uaktags commented 5 years ago

Great, I'll start working on the backward compat and new settings structure for this.

uaktags commented 5 years ago
// Coin info page
  "coininfo": {
    "basic_info_links": [
      ["Github", "http://github.com/"]
    ],
    "use_enhanced_info_links": false,
    "enhanced_info_links": {
      "Overview": {
        "Github":"https://github.com/"
      },
      "Exchanges": {
        "HitBTC": "https://hitbtc.com/",
        "Binance": "https://www.binance.com/"
      },
      "Misc": {
        "CoinGecko": "https://www.coingecko.com/en/coins/"
      }
    },
    "masternodes":{
      "enabled": false,
      "deposit_required": 50000
    },
    "block_time_sec": 120,
    "block_reward_mn": 5
  },

so modify the enhanced_info_links as needed, set the "use_enhanced_info_links" to true, and you're good to go.

2019-05-01 20_38_15-Vulc

By default, it's set to false so that backward compatibility is left in place for anyone still testing.

uaktags commented 5 years ago

With that, I'm closing this issue. We can open new issues that are more to the point of what is needed.