Skip to content

Lbird/tonscan

 
 

Repository files navigation

TON Blockchain Explorer

An open source address, block and transaction explorer for TON Blockchain.

See it in action

Installation

git clone https://github.com/catchain/tonscan.git
cd tonscan
npm install

Configuring

Before building you must fill the environment variables in .env (or .env.testnet) file.

Note that all variables must be present, even if you're not going to change them. If you'd like to use the default value, leave it empty (e.g. ADDRBOOK_LOCATION=).

cp .env.example .env

For testnet:

cp .env.example .env.testnet

Available variables

Key Value
ADDRBOOK_LOCATION URL of important addresses metadata in json format. Example.
GETGEMS_GRAPHQL_ENDPOINT Self-explanatory, default: https://api.getgems.io/graphql
DEV_EXPLORER_ADDRESS Explorer with extended transaction info. Default: explorer.toncoin.org
TONCENTER_API_ENDPOINT Self-explanatory, default: https://toncenter.com/api/v2
TONCENTER_API_KEY Required. See the official website for more details.
TONCENTER_INDEX_API_ENDPOINT Toncenter indexer API endpoint.
TONCENTER_INDEX_API_KEY Self-explanatory.
TONAPI_ENDPOINT Self-explanatory.
TONAPI_KEY Self-explanatory.
EXTENDER_CONTRACTS_API_ENDPOINT Contract extender API, default: https://api.ton.cat/v2/contracts
TYPESENSE_API_ENDPOINT Typesense real-time search engine endpoint.
TYPESENSE_API_KEY Self-explanatory.
SENTRY_DSN sentry.io DSN key, used for error monitoring
CLOUDFLARE_INSIGHTS_TOKEN Cloudflare Analytics token

Developing

npm run serve

To change host and port of the local server, change the APP_DEV_SERVER_HOST and APP_DEV_SERVER_PORT environment variables either in .env file or in command line. For example:

APP_DEV_SERVER_HOST=0.0.0.0 APP_DEV_SERVER_PORT=8080 npm run serve

Building

npm run prod

For testnet:

npm run prod_testnet

Using

The result of the build is static files in dist folder. To start using tonscan, you may:

  • Upload the dist folder to your web server (see example config below)
  • Upload build.zip to Cloudflare Pages
  • Use any static file hosting, e. g. Firebase

Example nginx config:

server {
    server_name tonscan.test;
    root /path/to/tonscan/dist;
    index index.html;

    location / {
        try_files $uri $uri/ @rewrites;
    }

    location @rewrites {
        rewrite ^(.+)$ /index.html last;
    }
}

About

The Open Network explorer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 73.0%
  • JavaScript 20.2%
  • SCSS 6.4%
  • EJS 0.4%