-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVOPS-1047: zillion migration to gcp (#283)
* feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp * feat: DEVOPS-1047 zillion migration to gcp
- Loading branch information
Showing
165 changed files
with
63,883 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ lint: | |
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
# - [email protected] - removed for being over-prissy and wanting tab indents - rrw 2023-04-25 | ||
ignore: | ||
- linters: [gitleaks] | ||
|
@@ -36,7 +36,8 @@ lint: | |
- linters: [ALL] | ||
paths: | ||
- needing-organisation/**/* | ||
- products/devex/public/*.js | ||
- products/devex/public/*.js | ||
- products/zillion/** | ||
- .devcontainer/* | ||
- .devcontainer/** | ||
- .trunk/*out/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
build/ | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:14.20.1 as build-stage | ||
|
||
|
||
ENV NODE_OPTIONS=--max-old-space-size=4096 | ||
WORKDIR /app | ||
COPY ./package.json ./ | ||
COPY ./yarn.lock ./ | ||
RUN yarn install -E | ||
COPY . ./ | ||
RUN yarn build | ||
|
||
FROM nginx:stable-alpine as production-stage | ||
COPY --from=build-stage /app/build /usr/share/nginx/html | ||
EXPOSE 80 | ||
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.PHONY: all | ||
all: image/build-and-push | ||
|
||
.ONESHELL: | ||
SHELL := /bin/bash | ||
.SHELLFLAGS = -ec | ||
|
||
ENVIRONMENT ?= dev | ||
VALID_ENVIRONMENTS := dev stg prd | ||
IMAGE_TAG ?= localhost:5001/zillion:latest | ||
|
||
# Check if the ENVIRONMENT variable is in the list of valid environments | ||
ifeq ($(filter $(ENVIRONMENT),$(VALID_ENVIRONMENTS)),) | ||
$(error Invalid value for ENVIRONMENT. Valid values are dev, stg, or prd.) | ||
endif | ||
|
||
## Build and push the Docker image | ||
image/build-and-push: | ||
docker build --build-arg REACT_APP_DEPLOY_ENV=${ENVIRONMENT} -t "${IMAGE_TAG}" . | ||
docker push "${IMAGE_TAG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Zilliqa Staking Wallet App | ||
|
||
## Getting Started | ||
|
||
|
||
|
||
### Development | ||
1. `yarn` | ||
|
||
|
||
2. Tweak the settings in `public/config.js` | ||
``` | ||
networks_config: { | ||
testnet: { | ||
proxy: "<proxy_checksum_address>", | ||
impl: "<implementation_contract_checksum_address>", | ||
blockchain: "https://dev-api.zilliqa.com", | ||
node_status: "https://testnet-viewer.zilliqa.com", | ||
api_list : [ | ||
"https://dev-api.zilliqa.com", | ||
] | ||
}, | ||
mainnet: { | ||
proxy: "<proxy_checksum_address>", | ||
impl: "<implementation_contract_checksum_address>", | ||
blockchain: "https://api.zilliqa.com", | ||
node_status: "https://staking-viewer.zilliqa.com", | ||
api_list : [ | ||
"https://api.zilliqa.com", | ||
] | ||
}, | ||
isolated_server: { | ||
proxy: "<proxy_checksum_address>", | ||
impl: "<implementation_contract_checksum_address>", | ||
blockchain: "https://zilliqa-isolated-server.zilliqa.com", | ||
node_status: "", | ||
api_list : [ | ||
"https://zilliqa-isolated-server.zilliqa.com", | ||
] | ||
} | ||
}, | ||
blockchain_explorer_config: "viewblock", | ||
refresh_rate_config: 3000, | ||
api_max_retry_attempt: 10, | ||
environment_config: "dev" | ||
``` | ||
|
||
3. (Optional) If you are interested in using the isolated server, set `environment_config` to `dev` otherwise, set to `stage` for testnet and `prod` for mainnet respectively. | ||
|
||
This enables the "Isolated Server" option in the network selection menu and disables authentications checks in the dashboard. | ||
|
||
4. Execute `yarn dev` and browse to `https://localhost:3000/`. HTTPS is required due to hardware ledger support. | ||
|
||
5. On the home page, select the network. Next, select _Sign in as Delegators_ or _Sign in as Operators_ | ||
|
||
6. An operator can see "Staking Performance", "Staked Seed Nodes" whereas delegators can only see "Staked Seed Nodes" | ||
|
||
7. Explore and execute any actions | ||
|
||
8. If the contract details doesn't get updated, click on the "Dashboard" wordings on the navigation bar to manually refresh | ||
|
||
|
||
### Production | ||
|
||
1. Follow Steps (1) and (2) as stated in **Development** section. | ||
|
||
2. Set the `environment_config` flag in `config.js` to `prod`. | ||
|
||
3. Assuming the hosted server is running `https`, execute `yarn start`. | ||
|
||
4. Done. | ||
|
||
|
||
### Enable / Disable Stake Operations | ||
Adjust these parameters to disable all stake operations and display a warning banner: | ||
|
||
1. At `src/util/enum.ts`, set the `enum ContractState` to **'true'** with the single quotes. | ||
-- This disables all the stake contract calls buttons and replaces the wordings to **"Not Available"** | ||
|
||
2. To change the banner display for the main page, edit `src/components/warning-banner.tsx`. | ||
|
||
3. To change the banner display for dashboard, edit `src/components/warning-dashboard-banner.tsx`. | ||
|
||
|
||
## Caveats | ||
The wallet app does not store your private keys or passphrases for privacy and security concerns. The wallet session object is disconnected upon refreshing the browser. We advise you to avoid refreshing the browser; all statistics are retrieved at regular intervals as configured by `config.js`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: zillion-config | ||
data: | ||
config.js: | | ||
window['config'] = { | ||
networks_config: { | ||
testnet: { | ||
proxy: "0x351a37e2841a45c7f2de18ee45f968e106416273", | ||
impl: "0xa2e4657de8108dd3730eb51f05a1d486d77be2df", | ||
blockchain: "https://dev-api.zilliqa.com", | ||
node_status: "https://testnet-viewer.zilliqa.com", | ||
api_list: [ | ||
"https://dev-api.zilliqa.com", | ||
] | ||
}, | ||
mainnet: { | ||
proxy: "", | ||
impl: "", | ||
blockchain: "https://api.zilliqa.com", | ||
node_status: "https://staking-viewer.zilliqa.com", | ||
api_list : [ | ||
"https://api.zilliqa.com", | ||
"https://ssn.zillacracy.com/api", | ||
"https://ssn-zilliqa.cex.io/api", | ||
"https://ssn.zillet.io", | ||
"https://zil-staking.ezil.me/api", | ||
"https://staking-zil.kucoin.com/api", | ||
] | ||
}, | ||
isolated_server: { | ||
proxy: "0x0578B8e9D9c2493D4a2E98f364c7ed311F7a0d71", | ||
impl: "", | ||
blockchain: "https://zilliqa-isolated-server.zilliqa.com", | ||
node_status: "", | ||
api_list : [ | ||
"https://zilliqa-isolated-server.zilliqa.com" | ||
] | ||
} | ||
}, | ||
blockchain_explorer_config: "viewblock", | ||
refresh_rate_config: 10000, | ||
api_max_retry_attempt: 10, | ||
environment_config: "stage" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: zillion | ||
namespace: zillion | ||
labels: | ||
"app.kubernetes.io/name": "zillion" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
"app.kubernetes.io/name": "zillion" | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
"app.kubernetes.io/name": "zillion" | ||
spec: | ||
containers: | ||
- image: zillion | ||
name: zillion | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- mountPath: /usr/share/nginx/html/config.js | ||
name: zillion-config | ||
subPath: config.js | ||
volumes: | ||
- name: zillion-config | ||
configMap: | ||
name: zillion-config |
Oops, something went wrong.