// The explorer is forked from source code of Pingpub. Tks them for sharing
git clone https://github.com/kj89/explorer.git
# Remove old yarn and nodejs (if they are so old and incompatible)
sudo apt remove yarn
sudo apt remove cmdtest
# Install nodejs 16
# sudo apt-get purge --auto-remove nodejs
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install new yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
# Install new nginx for webserve
sudo apt update && sudo apt -y upgrade
sudo apt -y install sudo vim zip unzip git
sudo apt -y install nginx-full
sudo systemctl status nginx
# if dont wanna use root account for security, you can create new one with sudo permission
adduser cosmos-explorer
adduser cosmos-explorer sudo
- Open the file
/root/explorer/ping.conf
- Add below content into the file
server {
server_name cosmos_explorer;
listen 443;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
}
}
-
Open
/root/explorer/src/views/Home.vue
and edit Main Daskboard -
Open
root/explorer/themeConfig.js
to edit info
- Open
/root/explorer/src/@core/layouts/components/AppFooter.vue
to edit footer
-
Create your logo filenames
logo.svg
andlogo.svg
, then upload to path/root/explorer/public/
-
Upload your logo to imgur, then create your online image link, example
https://i.imgur.com/pBRmmiE.jpg
-
Open
/root/explorer/src/@core/layouts/components/Logo.vue
to fill your online image link, then Logo of Main Dashboard will be changed -
Edit json file of your chain in
/root/explorer/src/chains
, fill in your own RPC and API if need (Step 2.2)
- Below is example for HAQQ chain
Open new terminal and run below command
yarn && yarn serve
- Open your browser, fill in: http://YOUR_IP:8080
- Check content is OK or not, then adjust directly on your data and refresh your browser to recheck until all is OK
- Open new terminal and run below command
yarn && yarn build
- Copy your web data to path of Root webserver
mkdir /var/www/YOUR_NAME
cp /root/explorer/dist/* /var/www/YOUR_NAME
systemctl restart nginx
systemctl status nginx.service
journalctl -xe
- Login your browser: http://YOUR_IP
- 3.1 go to namecheap https://www.namecheap.com/myaccount/login/ buy domain
- 3.2 link domain from namecheap to Cloudflare https://www.youtube.com/watch?v=i0IY77IUHx4
- 3.3 in https://dash.cloudflare.com/ go to setting DNS and link your ip
- 3.4 edit /etc/nginx/sites-available/default
cd explorer/
vi /etc/nginx/sites-available/default
server {
listen 80 ;
#listen [::]:80 default_server;
listen 443;
server_name haqq-api.blockchain001.xyz;
#index index.html;
#root /var/www/cosmos;
location / {
#add_header Access-Control-Allow-Origin *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
proxy_pass http://138.201.139.207:30317;
}
}
server {
listen 80 ;
#listen [::]:80 default_server;
listen 443;
server_name haqq-rpc.blockchain001.xyz;
#index index.html;
#root /var/www/cosmos;
location / {
#add_header Access-Control-Allow-Origin *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
proxy_pass http://138.201.139.207:30657;
}
}
- 3.5 in folder mkdir /var/www/YOUR_NAME create a subdirectory and copy the dist in there . example
mkdir /var/www/YOUR_NAME/haqq-testnet
cp /root/explorer/dist/* /var/www/Candy/haqq-testnet
#for example
mkdir /var/www/Candy/haqq-testnet
cp -rf dist/* /var/www/Candy/celestia
- 3.6 edit file json as command vi.. add domain to api , rpc example
cd src/chains/mainnet/
vi haqq.json
#or
vi src/chains/mainnet/haqq.json
- 3.7 run
yarn build
systemctl restart nginx
- 3.8 login domain lưu ý : nếu đã chạy wed hoàn chỉnh muốn thêm chain thì chạy chỉnh file .json rồi chạy yarn serve edit wed xon chạy yarn build . sau đó làm tiếp từ 3.4 trở đi