___ ___ _ _ ___ ___ ___ ___
/ __| __| \| | __/ __|_ _/ __|
| (_ | _|| .` | _|\__ \| |\__ \
\___|___|_|\_|___|___/___|___/
Dependencies
Included dependent binaries
Download solidity v0.6.x to the $PATH/bin folder, set execute bit
Note:
Project use on some libraries which does not work on go v1.15
docker run -d -p 5438:5432 \
--name genesis-db \
-e POSTGRES_USER=genesis \
-e POSTGRES_PASSWORD=dev \
-e POSTGRES_DB=genesis \
postgres:11-alpinedocker exec -it genesis-db psql -U genesisCREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
\qDue to requiring hosting large db to work, as lite mote barely get any host.
Due to too much magic. Replace by nginx.
cd server
go generate -tags tools ./tools/...cd web
npm install
npm startMake sure these environment variables are set:
GENESIS_BLOCKCHAIN_PRIVATEKEYBYTES
GENESIS_EMAIL_APIKEY
GENESIS_SENTRY_DSN
FONTAWESOME_TOKEN(Find in Bitwarden, Mailgun and Sentry)
cd server
../scripts/db-prepare.sh
go generate ./...
go run cmd/platform/main.go db -db_drop
go run cmd/platform/main.go db -db_migrate
go run cmd/platform/main.go db -db_seed
go run cmd/platform/main.go serve- follow instruction on https://flutter.dev/docs/get-started/install/windows a. unpack windows flutter, try c:\src\flutter
- create a virtual phone using Android Studio AVD
- run build below using git-bash, this will take awhile a. if stuck on gradle, try cancel and run again b. may take a while
- for android phone dev
a. in settings
i. tap System, tapping About phone ii. keep tapping build number to enable developer mode iii. unplug and plug in usb cable iv. on phone, allow permission for pc to debug b. in developer options, enable USB debugging c. unplug and plug in usb cable
cd fieldapp
android/build.shapk located at build/app/outputs/apk/release
./scripts/build-docker.shAdd this in CapRover nginx setting to hardcode WeChat url auth response.
server {
location /api/steak/ZwLGFBAL10.txt {
return 200 '8b8a8b3ba30eb7b687a83bc55e446db4';
}# as root
# install nginx (previously caddy)
apt install nginx
# prod dir
mkdir /usr/share/latitude28/genesis
# after pushed genesis build to server
cd /etc/systemd/system
ln -s /usr/share/latitude28/genesis/init/genesis.service
systemctl enable genesis
systemctl start genesis
# reload systemd service
systemctl daemon-reload
# edit config
cd /usr/share/latitude28/genesis/init
cp genesis-prod.env.sample genesis-prod.env
nano genesis-prod.env
# as postgres user
su postgres -
psql
# change password
> \password
# create db
> create database genesis;
# select db
> \c genesis
# create sql extension as above
> ...export PROD_HOST="1.2.3.456"
make all
make deploy-prod-fullhttps://passwordsgenerator.net/sha256-hash-generator/ https://www.fileformat.info/tool/hash.htm https://www.pelock.com/products/hash-calculator
codes in server/cmd/lab are used for tests and examples https://godoc.org/github.com/ethereum/go-ethereum/ethclient https://goethereumbook.org/smart-contract-compile/
production server has two folders
- /usr/share/latitude28/genesis-online (actual running and alias to genesis dir without -online)
- /usr/share/latitude28/genesis-upload (make deploy)
Create combined certificate, using nginx
apt install certbot
certbot certonly -d admin.gn.latitude28.cn -d consumer.gn.latitude28.cn -d admin.gn.l28produce.com.au -d consumer.gn.l28produce.com.au