Local version of the ICON Community Tracker running with a custom ICON chain.
All the commands needed to do the following can be done with make:
- Start the chain,
- Clone sub-repos
- Install goloop
- Create a keystore
- Fund that keystore
Dependencies:
docker / docker-compose
rocksdb
brew install rocksdb
(macOS)sudo apt-get install librocksdb-dev libsnappy-dev libbz2-dev
(Ubuntu)
- go
brew install golang
(macOS)- Google it... (Ubuntu)
One click:
make all
Individual steps:
make # Shows help screen
make clone-dependencies
make up-stack
make enable-debug
make install-goloop
make create-wallet
make fund-wallet
Navigate to http://localhost to view the tracker. Will take about 15 seconds to start up.
Note that you can create / fund a different wallet with the following:
WALLET_NAME=your_wallet_name.json WALLET_PASSWORD=yoursupersecret make create-wallet
WALLET_NAME=your_wallet_name.json WALLET_PASSWORD=yoursupersecret make fund-wallet
Bringing up the stack
git clone https://github.com/sudoblockio/icon-tracker-frontend
docker-compose \
-f docker-compose.yml \
-f docker-compose.icon-chain.yml \
-f docker-compose.nginx.yml \
-f docker-compose.frontend.yml \
up -d
To take it down subsitute up -d
with down
or to remove the volumes down -v
.
Enable debug mode on ICON node
docker-compose -f docker-compose.icon-chain.yml exec icon goloop system config rpcIncludeDebug true
Installing goloop
git clone https://github.com/icon-project/goloop
cd goloop
make goloop
cd ..
Creating wallet
./goloop/bin/goloop ks gen -o your_wallet_name.json -p yoursupersecret
Funding wallet with 1000 ICX (note - jq command just pulls address from wallet).
./goloop/bin/goloop rpc sendtx transfer \
--uri "http://localhost:9080/api/v3" \
--nid "3" \
--step_limit "2000000" \
--to $(jq -r '.address' your_wallet_name.json) \
--value "1000000000000000000000" \
--key_password gochain \
--key_store ./icon-chain/config/keystore.json
This guide assumes you are running this all locally and should get a tracker with chain running one-click (please file and issue with logs if you have issues). If you are running on a server, you will need to build the frontend so that it points directly to your server's IP or backend by updating the args
in docker-compose.frontend.yml to your IP or URL if you are running your own reverse proxy. With react and other frameworks, you can't inject these parameters at runtime and thus they need to be hardcoded. For the actual tracker we do some other stuff to deal with this issue as we have to run the frontend pointing at many different backends and so this is the only way for now.
If you don't want to create your own local chain and instead want to simply run a custom tracker on an existing network, omit the docker-compose.icon-chain.yml
in the makefile commands and modify the .env
file to point to other networks. This will still make the frontend only accessible on localhost. To serve that frontend beyond localhost, see the above.
Apache 2.0