Git Product home page Git Product logo

vocexplorer's Introduction

Vochain Block Explorer

Deployed at https://explorer.vocdoni.net/ and https://explorer.dev.vocdoni.net/

Deps

Golang 1.14+

Running

Docker

Navigate to vocexplorer/docker/vocexplorer

docker-compose build
docker-compose up

That's it!

Manual

1. Frontend

On the commandline navigate into the directory ./frontend and run

env GOARCH=wasm GOOS=js go build -ldflags "-s -w" -trimpath -o ../static/main.wasm

to compile the frontend code into wasm.

2. Static files

Make a copy of the wasm_exec.js file from $GOROOT/misc/wasm/ directory and put it in the ./static directory. This must be from the same golang version that you used to build main.wasm.

Get back to the root path and run yarn to install and compile the required style assets.

If you want to renew the styles, run yarn gulp, or in case you wanna watch for changes, yarn gulp sass:watch.

There's also a gulp task for watching .go files changes in ./frontend files and regenerating the main.wasm file: yarn gulp go:watch.

You can watch both .go and .scss file changes by just using

yarn gulp watch

4. Backend

After steps 1, and 2, navigate back into vocexplorer and run

go run main.go

Then in your favorite web browser navigate to localhost at the specified port.

Options for main.go:

  • --dataDir (string) directory where data is stored (default "/Users/natewilliams/.vocexplorer")
  • --refreshTime (int) number of seconds between each content refresh (default 10)
  • --gatewayUrl (string) vocdoni node URL to query for data
  • --disableGzip use to disable gzip compression on web server
  • --hostURL (string) url to host block explorer (default "http://localhost:8081")
  • --logLevel (string) log level <debug, info, warn, error> (default "error")

vocexplorer's People

Contributors

natewilliams2 avatar elboletaire avatar p4u avatar vdo avatar mvdan avatar jordipainan avatar

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.