Edit source/environments.ts and source/environments.prod.ts
export const environment = {
production: false,
backend: 'http://10.0.0.13:8008',
documentionApi: 'https://docs.evolution-project.org',
decimalPlaces: 2
};
backend
FQDN of your backend with thefrontEnd_api
documentationApi
Address used to build documentation explanationsdecimalPlaces
how many decimal places to use when displaying currency
npx ng serve -o
Edit config.json
{
"api":"http://10.0.0.13:12111",
"frontEnd_api": "http://localhost:4200",
"server_port": "8008",
"auditable_wallet": {
"api": "http://10.0.0.13:12233"
},
"database": {
"user": "evox",
"host": "10.0.0.13",
"port": 5432,
"database": "postgres",
"password": "123456"
}
"api"
The address of your evox node."frontEnd_api"
The address of the angular uses for CORS. seems to not like 127.0.0.1"server_port"
Port of backend API used by angular to obtain data."auditable_wallet"
FDQN of your auditable wallet running as a service."database"
credentials and location of a postgresql database
node server-pg.js
sudo apt install ng-common
Following command will produce a dist
folder that you can copy to your a web server
npm run 'build prod'
git clone https://github.com/evolution-project/block_explorer.git
cd block_explorer
npm install
sudo apt update && sudo apt install postgresql curl postgresql-contrib
sudo systemctl start postgresql
- Connect as postgres user and enter psql prompt - NO NEED
sudo -u postgres psql
- Create a new role with pass in teminal
sudo -u postgres createuser --interactive --pwprompt
Output
Enter name of role to add: evox
Enter Password
Confirm Pass
Shall the new role be a superuser? (y/n) y
- Edit postgresql.conf
sudo nano /etc/postgresql/13/main/postgresql.conf
change and uncomit line `list_address = 'localhost' to `listen_address = '*'
- Edit pg_hba.conf and add a new line NOTE: For Security reasons you should never use 0.0.0.0/0, limit to an IP address or to a Subnet.
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5
- Open firewall port - no need for this step if ufw is inactive
sudo ufw allow 5432/tcp
- Restart Postgresql Service
sudo systemctl restart postgresql
sudo apt-get install curl gnupg2 -y
sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4-desktop
- create a connection to your server, provide a master password
- connect to your server with the role created previously
username: evox
password: 123456
- Right click
Database
and select create Database - From the toolbar select
query tool
- In the query editor open file and select
database.sql
- Run the query to create the
db
schema and tables necessary to run block_explorer
sudo apt install nginx certbot python3-certbot-nginx
- Start Nginx if is not started
Check nginx status
sudo systemctl status nginx
sudo systemctl nginx start
sudo nano /etc/nginx/sites-available/chain.evolution-network.org
server {
server_name chain.evolution-network.org;
gzip on;
gzip_types *;
gzip_min_length 500;
# Set files location
root /var/www/block-explorer/dist/;
index index.html;
location ~ ^/(.*) {
proxy_pass http://127.0.0.1:8008/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#wss requires nginx 1.4
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/chain.evolution-network.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chain.evolution-network.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = chain.evolution-network.org) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name chain.evolution-network.org;
return 404; # managed by Certbot
}