Coder Social home page Coder Social logo

neo-scan's Introduction

Neoscan

Gitlab Coveralls

Elixir + Phoenix Blockchain explorer for NEO

Contents

How to Contribute

To run, first install Elixir and Phoenix at:

Development

Run Docker

You can skip this section if you do not wish to run docker.

Using docker you can start the project with:

  • docker-compose up -d
  • docker exec -it phoenixdev sh
  • cd /data

Run Tests

To run the tests:

  • Install dependencies with mix deps.get --only test
  • Create and migrate your database with MIX_ENV=test mix ecto.create && mix ecto.migrate
  • Run mix test

Raise Main Net Phoenix

To start the Application/Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with cd apps, cd neoscan_web, then cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Raise Test Net Phoenix

To start the Application/Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with cd apps, cd neoscan_web, then cd assets && npm install
  • Start Phoenix endpoint with NEO_SEEDS="https://seed1.neo.org:20331;http://seed2.neo.org:20332" mix phx.server

Now you can visit localhost:4000 from your browser.

Make sure the username and password for your PostgreSQL match the contents of "apps/neoscan/config/dev.exs"

PostgreSQL Fu

Dump your database with pg_dump, i.e.,

To tarball:

pg_dump -U postgres -h localhost -W -F t neoscan_dev > neoscan_dev_testnet.tar

To file:

pg_dump -U postgres -h localhost -W neoscan_dev > neoscan_dev_testnet

Restore:

pg_restore --dbname=neoscan_dev --verbose neoscan_dev_testnet.tar

Notes

  • Docker runs as root so if you go back and forth between source repository and docker style execution you will need to be mindful to chown any files that were created. These can easily be found when you see a permission denied error on some build step.

Learn more

neo-scan's People

Contributors

adrienmo avatar block-shaman avatar cc1776 avatar containerman17 avatar dependabot[bot] avatar dvdschwrtz avatar fabwa avatar jhepkema avatar jwcastillo avatar kevaundray avatar localhuman avatar lucianoengel avatar mbenatti avatar msied avatar slipo avatar spasma avatar telcy avatar uvmetal avatar vladucu avatar woodehh avatar yongjiema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo-scan's Issues

rename repository

@lucianoengel can you rename the repository to follow the informal standard for the case ?
something like: neoscan, neo-scan or neo-explorer

Inccorrect gas reported

http://testnet-api.wallet.cityofzion.io/v2/address/claims/ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s

{
    "address": "ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s",
    "claims": [
        {
            "claim": 232522,
            "end": 867240,
            "index": 0,
            "start": 844201,
            "sysfee": 48210,
            "txid": "4536a2539babf4b4b29e308bc396dc23e407232a5ae88a5ca028d47bd80653c2",
            "value": 1
        }
    ],
    "net": "TestNet",
    "total_claim": 232522,
    "total_unspent_claim": 108267556
}

https://neoscan-testnet.io/api/test_net/v1/get_claimable/ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s

{
    "claimable": [
        {
            "value": 1,
            "unclaimed": 0.00232514,
            "txid": "4536a2539babf4b4b29e308bc396dc23e407232a5ae88a5ca028d47bd80653c2",
            "start_height": 844201,
            "n": 0,
            "end_height": 867240
        }
    ],
    "address": "ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s"
}

Note the difference in claim and unclaimed. They should have the same numbers. I believe that neoscan is wrong because the NEO node is rejecting my tx created by the neoscan data.
Have not tried to claim gas with neonDB data tho. I will leave this in this state for as long as possible.

Block 1,952,187 not fully processed

We noticed that one of our balances isn't displaying correctly on neoscan:

https://neoscan.io/address/AZXKdEc2M73qeQMmPj2zmKJFDWmzQf8Gyr

It's short 1 NEO. Neoscan is currently showing a balance of 361 NEO, but the actual balance is 362 (and a local neo-python node confirms this). I've tracked it down to block 1,952,187, which apparently didn't get processed fully:

https://neoscan.io/block/64f9b553f89b48305f8d4bc4879624d4abb35659830f2c4ce856fc7e4dce037b

It reports 29 transactions in the block (which is correct), but page 2 of transactions shows no results:

https://neoscan.io/block/64f9b553f89b48305f8d4bc4879624d4abb35659830f2c4ce856fc7e4dce037b/2

In particular, here's our transaction that is missing, which is throwing off the address balance:

https://neoscan.io/transaction/6eda62442a3f5ae98f6520b6118760060ec7e0a4480729e0f6c9aa59e747ae39

Note that this transaction does not show up in the address' transaction list, as you'd probably expect since that transaction seems to not have been imported properly.

[TestNet] Error 500 after going to transaction page

Environment:
Win 10 Home (64 bit) Version 1709 Build 16299.371

Browser:
Chrome 66.0.3359.139 (64 bit)

Description:
In most cases I'm getting internal server error after going to transaction pages. While going through "Last 5 Transactions" section and opening each transaction it seems that some of them works and some don't. I've found three different states of transaction pages:

  1. Internal server error
  2. Working properly
  3. Empty transaction (?)

Examples:

  1. Internal server error:
    https://neoscan-testnet.io/transaction/2af70f710396c3bd487031b2ca6987cf74ecfa6aa3b135c4035bbfa7984952f7
    https://neoscan-testnet.io/transaction/a789f1eda99929b291923f19c606ee775b03170b007a85b22e15909e99fd0b0b
    https://neoscan-testnet.io/transaction/72d5fb61f24a92351fc778d291a6aaf2a1d1e7decd3ab0d91eff939136661407
  2. Working properly:
    https://neoscan-testnet.io/transaction/3c96442c8ced50c4d8f2dc4216cf47d41f77ca1d65c17853bbdb4eea635c51fb
    https://neoscan-testnet.io/transaction/54e3028e69a6d31423158fa56cdf202107fd33831c34e0085cd7a0701bc16c8b
  3. Empty transactions (?):
    https://neoscan-testnet.io/transaction/3a466f42dabaf9d65bf93d7bb71794a2056b881075cbd947bb6eec604b25e541
    https://neoscan-testnet.io/transaction/3a466f42dabaf9d65bf93d7bb71794a2056b881075cbd947bb6eec604b25e541

Replace "Neo Slack" link in footer with "Neo Discord"

As of December 10, 2017 CoZ moved its NEO community chat from slack to discord. The neoscan_web app needs to be updated to reflect this: https://www.reddit.com/r/NEO/comments/7is3oz/neo_slack_moving_to_discord/

screen shot 2018-02-26 at 5 42 41 pm

I attempted this on my own, but there appears to be some non-standard knowledge involved with how the svg is generated, and how .po files are generated from .pot. Seems like low-hanging fruit for the original contributor @lucianoengel

Wrong claim numbers

During testing for neon-js, I noticed that the claim numbers are wrong for neoscan.

https://neoscan.io/api/main_net/v1/get_claimable/ATsmYxUsJaU1AcZm3RCcTAhrvYUNMPaCvq:

{
    "claimable": [
        {
            "value": 825,
            "unclaimed": 6.50298,
            "txid": "9adfbd49621c45bae64e8f11e2cd9a42c5330d9f39220390d6b7b5081bf606f6",
            "start_height": 1485981,
            "n": 0,
            "end_height": 1584386
        },
        {
            "value": 30,
            "unclaimed": 0.0208548,
            "txid": "d24f3a0d7d62d08165b30be5a0352f1bcf883be6cee182c125bc2138c2a17ceb",
            "start_height": 1575820,
            "n": 0,
            "end_height": 1584386
        },
        {
            "value": 25,
            "unclaimed": 0.175424,
            "txid": "bae94b0741a1982b0a1d1246fcfa62f88e3b746f89856f91efcd3db6b519e790",
            "start_height": 1496799,
            "n": 0,
            "end_height": 1584386
        },
        {
            "value": 29,
            "unclaimed": 0.13658043,
            "txid": "8d287bee9482a64e4b5034feddfb12611229bc7e7ebefbea8830dba73ff6f3b7",
            "start_height": 1525639,
            "n": 0,
            "end_height": 1584386
        }
    ],
    "address": "ATsmYxUsJaU1AcZm3RCcTAhrvYUNMPaCvq"
}

http://api.wallet.cityofzion.io/v2/address/claims/ATsmYxUsJaU1AcZm3RCcTAhrvYUNMPaCvq

{
    "address": "ATsmYxUsJaU1AcZm3RCcTAhrvYUNMPaCvq",
    "claims": [
        {
            "claim": 650291400,
            "end": 1584386,
            "index": 0,
            "start": 1485981,
            "sysfee": 992,
            "txid": "9adfbd49621c45bae64e8f11e2cd9a42c5330d9f39220390d6b7b5081bf606f6",
            "value": 825
        },
        {
            "claim": 17542200,
            "end": 1584386,
            "index": 0,
            "start": 1496799,
            "sysfee": 992,
            "txid": "bae94b0741a1982b0a1d1246fcfa62f88e3b746f89856f91efcd3db6b519e790",
            "value": 25
        },
        {
            "claim": 13657811,
            "end": 1584386,
            "index": 0,
            "start": 1525639,
            "sysfee": 983,
            "txid": "8d287bee9482a64e4b5034feddfb12611229bc7e7ebefbea8830dba73ff6f3b7",
            "value": 29
        },
        {
            "claim": 2085240,
            "end": 1584386,
            "index": 0,
            "start": 1575820,
            "sysfee": 980,
            "txid": "d24f3a0d7d62d08165b30be5a0352f1bcf883be6cee182c125bc2138c2a17ceb",
            "value": 30
        }
    ],
    "net": "MainNet",
    "total_claim": 683576651,
    "total_unspent_claim": 36360
}

I would assume neon-wallet-db is giving the correct numbers because I have counter checked it with neo-gui:

image

Fix credo

  • credo should pass with mix credo --strict
  • Add credo to the travis pipeline

Elixir VM

Create a functional Elixir neo VM, as neo-python. A wrapper is fine.

Really slow response time

image

28s for an API call is pretty significant and might be related to your recent updates since it wasnt that slow previously.

But just to put it out there, the previous timing was still lagging quite a bit behind neon-wallet-db speed. (we talking about 2s here)

Show NEP-5 symbol next to balance

It's awesome that neoscan supports NEP-5 tokens now. Nice work! One added touch that would be nice is if you displayed the token symbol next to the balance since people will be used to seeing the symbol (and not necessarily always the token name). I think it's cool having the token name as the header as you have right now, but it might be a nice added touch to show the symbol next to the balance displayed. 👍

How to deploy with docker

Thx for this project.

I'm not very familiar to docker so I follow the guide which works well locally

  • docker-compose up -d

  • docker exec -it neoscan_phoenix_1 sh

  • cd /data

  • mix deps.get

  • mix ecto.create && mix ecto.migrate

Then I got an error The database for Neoscan.Repo couldn't be created: an exception was raised: which seems to require neoscan_* in postgres docker.

Then the question is:

How can I create the db in docker.

Thx again.

Add metas for SEO

If we search for neo-scan on google first link is the github project.
We should add the basics meta title and description.

Monitor worker dies on too many connection_timeouts

When there's too many connection_timeouts the monitor starts killing nodes without testing. Probably related with the GenStage consumer recursively trying to fetch the data from the available nodes. On restarting the server, the monitor refill the nodes list and they seem fine.

Incorrect ordering of outputs

The outputs on neoscan is ordered incorrectly.

Doing a POST to a NEO node for tx 60e2711319c1453d8de0ca8268b6ba9ced1d0c0c581c49d26e6efd4b75dccb24 yields:

{
        "vout": [
            {
                "n": 0,
                "asset": "0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7",
                "value": "0.1",
                "address": "ALq7AWrhAueN6mJNqk6FHJjnsEoPRytLdW"
            },
            {
                "n": 1,
                "asset": "0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7",
                "value": "0.005554",
                "address": "ALq7AWrhAueN6mJNqk6FHJjnsEoPRytLdW"
            }
        ],
...
}

However, on neoscan, it is displayed as:

image

This is not important to a normal end-user as the order would not matter to them. However, on the technical side, the coins are referenced by their txid and their index in this vout list. Thus, it would be good for it to be in the order specified for this to be useful for devs to look at.

Similarly, this could be done for the inputs. (so far I havnt have a use for that but consistency is nice)

TLDR: Please display the outputs as they are ordered in the transaction vout as it is important to the developer.

Where is the Assets in NEOSCAN?

wechatimg58

How to search the assets in NEOSCAN?

I can find the assets(资产)a few days ago, but I cannot find it now!

I want to search the token hash, how can I do this?

Design Better GenStage Pipeline

The current blockchain synchronization process uses a GenStage pipeline as follows:

add_block 1

The problem is that a block don't have a maximum transactions count, neither transactions have a maximum number of inputs or outputs. Blocks with a great amount of transactions or with big transactions therefore flood memory with too many operations. A good pipeline design I believe, should ask for a maximum demand of addresses to update, which would ask for outputs, inputs and claims, which would ask for transactions and them for blocks. However, each stage doesn't know how many transactions/blocks it should ask for to fulfill the demand, so there must be a queue for each.

Tx inputs and outputs hidden when too many

This is a transaction with 2560inputs :)

This is a transaction with 1000 outputs :)

The list of inputs/outputs cuts off at about 15th item on the list without any way to look at the rest. Inspecting the HTML shows that the rest of the list actually exists but is just hidden.

Add Support for TestNet

Consider solutions for testnet support.
-Dual DB;
-Prefix Tables;
-Individual Applications;
-Others?

How can I get historical address amount?

API has told me to get the transactions and balances of the specific address. But I want to get the historical address amount. For example, there are 1000000 addresses or 10000 addresses in 15th, Jan, 2018.

Inferno doesn't render changes

It shouldn't need the setInterval() function on apps/neoscan_web/assets/js/home_app.js

window.onload = function () {
  if (window.location.pathname === '/') {
    let payload = {
      blocks: [],
      transactions: []
    }
    let home = new HomeSocket(payload)

    setInterval(function () {
      Inferno.render((
        <List class='collection' sync={false} data={home.payload.blocks} rowHeight={15} rowRender={blockRow} />
      ), blocksContainer)
      Inferno.render((
        <List class='collection' sync={false} data={home.payload.transactions} rowHeight={15} rowRender={transactionRow} />
      ), transactionsContainer)
    }, 500)
    home.connect()
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.