Skip to content

Latest commit

 

History

History
177 lines (154 loc) · 6.26 KB

guide.md

File metadata and controls

177 lines (154 loc) · 6.26 KB

explorer-setup

// The explorer is forked from source code of Pingpub. Tks them for sharing

1. Setup and install neccessary packages

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

2. Run webseve in develop mode and edit web content

2.1 Edit web content

  • 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;
    }
}

image

  • Open /root/explorer/src/views/Home.vue and edit Main Daskboard

  • Open root/explorer/themeConfig.js to edit info

image

  • Open /root/explorer/src/@core/layouts/components/AppFooter.vue to edit footer

image

  • Create your logo filenames logo.svg and logo.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 image image

  • Edit json file of your chain in /root/explorer/src/chains, fill in your own RPC and API if need (Step 2.2)

2.2 Edit config data of your chain

  • Below is example for HAQQ chain
  • Open /root/.haqqd/config/config.toml, expose your RPC, enable CORS. image

  • Open /root/.haqqd/config/app.toml, enable API and CORS image

  • Restart HAQQ

2.3 Run webserver in dev mode

Open new terminal and run below command

yarn && yarn serve

2.4 Login web server in dev mode

  • 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

2.5 Build webserver

  • 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
  • Check and edit the file /etc/nginx/sites-available/default image

  • Restart your webserver

systemctl restart nginx

check

systemctl status nginx.service
journalctl -xe
  • Login your browser: http://YOUR_IP

3.link Domain

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

image image

  • 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