Giter Site home page Giter Site logo

playzero / zero-network Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 4.0 151.9 MB

zero network is multiverse infrastructure bridging video games into the web3 era

Home Page: https://zero.io

License: Apache License 2.0

Shell 1.49% Dockerfile 0.48% EJS 0.10% Handlebars 0.52% Rust 97.14% Python 0.06% Nix 0.06% Makefile 0.15%
videogames web3 blockchain polkadot rust substrate dotsama kusama

zero-network's Introduction


ZERO network — for video games in the web3 era

GitHub license GitLab Status PRs Welcome GitHub Workflow Status GitHub tag (latest by date)
Discord Twitter URL Medium

Overview

1. Introduction

ZERO is a multichain network, Multiverse + DAO for next generation videogames. It provides native asset-, finance-, governance protocols, Smart Contracts, a Hypergraph and Computation at its core. To provide cross economic interoperability between totally different ecosystems. Futhermore it will enable generative creation of games and game economies through algorithms, generators and provision of autonomous agents to drive transition of old economy videogames and creators into a tokenized and decentralized future.

  • Network currency: $ZERO
  • Join our growing game community on Discord
  • Parachain launch information and tokenomics on Blog

2. Economics

ZERO Token ($ZERO) features the following utilities, and the value of $ZERO token will accrue with the increased usage of the network and revenue from stability fees and liquidation penalties

- Network utility and stability fees
	-- Asset, Finance and Governance protocols
	-- Payment
	-- Identity
	-- Computation
	-- Oracles
- Governance: vote for/against risk parameters and network change proposals
- Economic Capital: in case of liquidation/defaulting of contracts without sufficient collaterals

To enable cross-chain functionality, ZERO will connect to the Polkadot Ecosystem ( starting with Kusama ) in one of three ways:

- parathread —— pay-as-you-go connection to Polkadot
- parachain —— permanent connection for a given period
- bridge —— independent chain bridged to Polkadot

Becoming a parachain would be an ideal option to bootstrap ZERO Network, to maximize its benefits and to reach to other chains and applications on the Polkadot network.

To secure a parachain slot, ZERO Network will require supportive DOT/KSM holders to lock their DOT/KSM to bid for a slot collectively — a process known as the Initial Parachain Offering (IPO). $ZERO tokens will be offered as a reward for those who participated in the IPO, as compensation for their opportunity cost of staking DOT/KSM.

3. Project Status

Zero Network is the common description for all contributing protocols and chains, subzero is the network core preparing for parachain operation.

  • subzero code base has been migrated from early 3.0.0 to current to prepare for parachain operation
  • subzero testnet alphaville is live since 08/2020
  • chain governance, staking, nomination, validator operation through native FRAME pallets
  • project governance through GameDAO Protocol
  • further information in our Discord

4. Build

Rust.

	curl https://sh.rustup.rs -sSf | sh

Recursion for submodules in git

	git config --global submodule.recurse true

Build for your current machine architecture

	make build

5. Run

Run your local dev chain

	make run

Purge the cache

	make purge

Update submodules

	make update

0. Notes

This is still work in progress, we will update more information as we progress. Refer to the token economy working paper for more details. This project and text was inspired by the excellent work of many growing projects in the Polkadot ecosystem. Thank you!.

zero-network's People

Contributors

andresilva avatar arkpar avatar ascjones avatar athei avatar bkchr avatar cecton avatar cheme avatar dependabot[bot] avatar expenses avatar gabreal avatar gavofyork avatar gilescope avatar gnunicorn avatar gui1117 avatar joshorndorff avatar kianenigma avatar marcio-diaz avatar mxinden avatar nikvolf avatar pepyakin avatar rphmeier avatar shawntabrizi avatar sorpaas avatar stanislav-tkach avatar svyatonik avatar tomaka avatar tomusdrw avatar tripleight avatar vayesy avatar xlc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zero-network's Issues

Test with parathread

  • #132
  • Sunc-up with Polkadot chain
  • Assign keys to collator nodes
  • Test Polkadot parathread setup
    • Check if all collators are working
    • Test RPC node with the load balancer (ex. chain metadata)

Monitoring setup for the chain

  • Update existing dashboard with STAGE env metrics
  • Test metrics exist on the STAGE Prometheus server
  • Update the main Prometheus with STAGE Prometheus server
  • Test metrics exist on the main Prometheus server

Alerts:

  • alert if avg. (5 min) block time > 25
  • alert if no updates for metrics after 15 minutes

https://dashboard.zero.io/

Infrastructure and docker setup

  • Update docker-compose.yml -> split RPC and collator nodes
  • Test:
    • Block production
    • Check if all collators are working
    • Test RPC node

Infrastructure plan:

  • Relaychain x 2
  • Collator x 2
  • RPC + Archiver x 1
  • Load Balancer (proxy) x 1
  • Prometheus server x 1

DevOps guide:
https://drive.google.com/file/d/1a2r05SyLDUCRQJXtUJdKhOR77PHQ0GTq/view
Substrate Launch Checklist_1.0:
https://docs.google.com/document/d/1z4bNFWr-I52EkBeQKsXbyY4gtVePT9lDc57fA9D_cB0/edit#heading=h.iz9y0bgoa19y
Notion envs: https://www.notion.so/zeroio/1-Release-Planning-7d56cbc1f77e4974879b3bc68c729510
Repo: https://gitlab.com/zero.io/devops/big

spec / node / runtime variants

A chainspec

  • parachain-dev
  • parachain-testing
  • parachain-staging
  • parachain-rococo
  • parachain-production

B nodes

  • 1. parachain empty
  • 2. parachain with a. orml / xtoken
  • 3. parachain with b. orml / xtoken / zero
  • 4. parachain with c. orml / xtoken / zero / gamedao
  • 5. goal: parachain empty --feature flags

C runtimes

  • a. empty chain substrate + orml
  • b. with-zero adds zero pallets
  • c. with-gamedao adds gamedao pallets

Add ORML pallets to the parachain runtime

ORML crates to be added:

  • Traits
  • Tokens
  • Currencies

Acceptance criteria:

Parachain contains Tokens & Currencies extrinsics to be called.

How to test

Open polkadot.js app and connect to parachain (address to be specified).
Navigate to Extrinsics view.
Tokens & Currencies should be listed in available pallets and extrinsics for them should be present in extrinsics list.

Token distribution plan

User Story

As ZERO NETWORK we want to have a proper token distribution plan so that we ensure every stakeholder gets the right amount of tokens in the right time.

Acceptance Criteria

  1. After genesis and assignment of token to the different treasuries a cliff and vesting should be applied to the different stakeholders
  2. wallets have different cliffs and vesting periods
    2.1 each wallet gets cliff and vesting assigned containing balances and tokens
    2.2 a demo list of wallets should be applied for test environment
  3. crowdloan contributors get into the list for token distribution
  4. other stakeholder groups get into the list for the token distribution

Additional Information

  • design genesis state, accounts, balances

  • relates to EPIC #203

How to test

  1. run chain and see how wallets get vested tokens locked and periodically unlocked each x blocks

Blocker for #139

sbp milestone I review

wwe need to inform our friends at parity about our chain prior to the SBP Milestone review:

1. Documentation until June 14th @vovacha

2. Code Links until June 14th @2075

  • Pallet Core:
    GameDAO Protocol

  • all pallets are in one location:

    • control — DAO core to create organizations with their segregated treasury and maintain members
    • signal — governance core to provide voting functionality with different outcomes and quora
    • flow — fundraising core to collect funds and move them to a DAO treasury upon success
    • sense — achievements and account based metrics
    • traits — overarching traits for the protocol pallets
  • Build it with the zero runtime to get a working environment which you can test through polkadot.js.org/apps:
    ZERO Network

  • you can also run a local dev node via docker:
    docker run playzero/subzero:latest /usr/local/bin/subzero --dev --tmp --name hello-joy

3. How to test @vovacha

4. Architecture Documents @2075

5. send out email @5-mark

  • send out email with information until June 15th

Infrastructure and docker setup

  • Nginx vs. AWS load-balancer research
  • Load balancer config (simple round-robbin?)
  • Decide on EC2 instances and their sizes
  • Prepare docker-compose.yml (per instance role?)

Infrastructure plan (draft, need a separate discussion):

  • Relaychain x 2
  • Collator x 4
  • RPC x 2
  • Archiver x 1
  • Load Balancer x 1
  • Prometheus server x 1

DevOps guide:
https://drive.google.com/file/d/1a2r05SyLDUCRQJXtUJdKhOR77PHQ0GTq/view
Substrate Launch Checklist_1.0:
https://docs.google.com/document/d/1z4bNFWr-I52EkBeQKsXbyY4gtVePT9lDc57fA9D_cB0/edit#heading=h.iz9y0bgoa19y
Notion envs: https://www.notion.so/zeroio/1-Release-Planning-7d56cbc1f77e4974879b3bc68c729510
Repo: https://gitlab.com/zero.io/devops/big

Add * to monitoring

As devops I want to monitor liveness and load of all running infrastructure.

  • Scrape metrics, provided by nodes and store them on central monitoring (https://dashboard.zero.io/).
  • Add/update chain dashboard to display those metrics.

chain:

  • dev - DONE
  • test
  • stage - #136
  • prod - #141
  • rococo

graph:

  • dev - #114
  • test
  • stage - #146
  • live
  • rococo

web:

  • dev
  • test
  • stage
  • prod - #147
  • rococo

Integrate aUSD on Rococo

Step 1: ORML xtokens

Step 2: HRMP Testing

  • Schedule testing date with Greg in Telegram
  • Designate a technical lead to conduct HRMP channel testing with Joey from Karura
  • Conduct testing on scheduled date
  • Joey to confirm once HRMP testing has been successfully completed

Step 3: On-chain execution

Motion to open the HRMP channels and register Karura tokens

Test token transfers

  • Conduct token transfers with registered tokens

Marketing

  • Share an announcement on your social channels that HRMP channels have been opened between networks. [Here](https://twitter.com/KaruraNetwork/status/1499859297232211968) is an example of one we shared with our community.
    Karura social will retweet your announcement. Please indicate in Telegram when this has been posted.

CI/CD pipeline for graph

  • Run CI/CD pipeline in GitLab for external repositories (GitHub haiku)
  • Create a GitLab's docker cloud runner (node base image)
  • Create dev, stage branches at haiku repo
  • Create pipeline (.gitlab-ci.yml)

Pipeline for all envs:

  • commit to the dev/stage/main branch triggers pipeline for dev/stage/prod envs
  • commit to path /pkg/squid/ triggers squid build
  • commit to path /pkg/service/ triggers graph-gamedao build
  • stage: test - create tests?
  • stage: build image - build, push the image to ECR (docker hub?) tags: env_name for dev stage, latest for prod, version for prod

Pipeline for dev/stage:

  • deploy: flush existing chain/graph, pull images, run everything from scratch

Pipeline for prod:

  • stage: build runtime - store an artifact so Sudo user can use it to manually upgrade a runtime

Notion Envs: https://www.notion.so/zeroio/1-Release-Planning-7d56cbc1f77e4974879b3bc68c729510

Integration tests

Questions:

  • Do we want to apply the integration test from UI side or check every component: graph, UI, chain

Test groups:

  • UI tests
  • Chain tests
  • Graph tests

Selenium, Puppeteer, etc. scenarios:

  • create org from UI (or js scaffolder)
  • check if org was created on the org page
    ...

Add GameDAO pallets to the parachain runtime

GameDAO crates to be added:

  • Traits
  • Control
  • Flow
  • Sense
  • Signal

Acceptance criteria:

Parachain contains extrinsics for all listed pallets to be called.

How to test

Open polkadot.js app and connect to parachain (address to be specified).
Navigate to Extrinsics view.
Extrinsics for listed pallets should be present and be callable.

parachain integration with other networks / XCMP

Overview

A. Chain

  • #46
  • #56
  • run parachain test setup
  • create chain-spec for rococo parachain
  • #33

B. Integrations

1.

2.

  • runtime upgrade to feature

Infrastructure + Docker Setup

1. Create infrastructure manually as IaC doesn't bring benefits at the moment, so could be done later.

Steps:

  • Define Instances type (check metrics of existent instances, ex. relay parachain)
  • Define who'll have SSH access for the instances
  • Define tags for resources on AWS
  • Create infra
  • Now: all services on 1 EC2 instance per environment dev test
  • Later: potentially split services between instances stage prod
  • Infra
    • EC2
    • Subnets
    • Internet Gateway?
    • Route tables
    • Security Group (describe all ports and usage)
    • Route53 DNS (ex. node.dev.sub.zero.io)

2. Environments to set up

  • DEV

    • Relaychain x 2
    • Node (Collator, RPC, Archiver) x 1
  • STAGE

    • Relaychain x 2
    • Bootnodes x 2
    • Collator x 4
    • RPC x 2
    • Archiver x 1
    • Load Balancer x 1
  • TEST

    • Relaychain x 2
    • Node (Collator, RPC, Archiver) x 1
  • [ ]

    • Bootnodes x 4
    • Collator x 8
    • RPC x 8
    • Archiver x 2
    • Load Balancer x 1

reference information

DevOps guide:
https://drive.google.com/file/d/1a2r05SyLDUCRQJXtUJdKhOR77PHQ0GTq/view
Substrate Launch Checklist_1.0:
https://docs.google.com/document/d/1z4bNFWr-I52EkBeQKsXbyY4gtVePT9lDc57fA9D_cB0/edit#heading=h.iz9y0bgoa19y
Notion envs: https://www.notion.so/zeroio/1-Release-Planning-7d56cbc1f77e4974879b3bc68c729510
Repo: https://gitlab.com/zero.io/devops/big

Create scaffolder / genesis setup for local dev / staging / production network setup

ac

  • It should work for both standalone and parachain.
  • Genesis config is probably not possible to use here for all objects, like proposals and campaigns, due to cross-dependencies between objects

Implementation details

Use some script to continuously generate random data

  • members
  • identities
  • balances
  • daos
  • campaigns
  • proposals (finalized and in progress)

Implement Prometheus metrics for graph services

Squid:

  • Expose squid metrics, collected by the service
  • Update prometheus services (dev, stage) to collect those metrics with corresponding label for service name - squid.

GraphQL:

  • Add plugin to Apollo Server, which will collect metrics and expose them on certain endpoint
  • Update prometheus services (dev, stage) to collect metrics with corresponding label for service name - graph.

Monitoring setup for the chain

  • Update existing dashboard with PROD env metrics
  • Test metrics exist on the PROD Prometheus server
  • Update the main Prometheus with PROD Prometheus server
  • Test metrics exist on the main Prometheus server

Alerts:

  • alert if avg. (5 min) block time > X
  • alert if avg. (60 min) block time > Y
  • alert if no updates for metrics after N sec

https://dashboard.zero.io/

Define and setup new environments for development, testing, staging, production

Define and setup new environments for development, testing, staging, production
We want to maintain different environments with different qualities of service:

  • draw and discuss in figma during architecture session

assumptions:

development — can break, could work

  • dev and below

testing — can break, should work

  • test, mock test

approval — should work

  • staging

live — must work

  • alphaville standalone releay/parachain with stable environment
  • rococo parachain
  • production parachthread connected to polkadot

Prepare chain_spec

  • #121
  • #129
  • Prepare final chain_spec version: genesis, collators list, sudo key, etc.
  • Generate WASM binary, genesis hash

Run parachain env

  • #143
  • Generate chain_spec
  • Deploy
  • Test:
    • Block production
    • Check if all collators are working
    • Test RPC node with the load balancer

dockerize parachain test setup

Create docker-compose to run relay chain and parachain setup, which consists of:

  • 2 relay chain validators;
  • 1-2 parachain collators.

Expose 1 validator and 1 collator to be able to connect to them via polkadot app UI.

Upgrade to substrate v0.9.28

Update substrate version, which is used for zero chain from 0.9.25 to 0.9.28, latest supported from the Rmrk side.
All versions of the chain should be updated: full parachain, clean parachain, standalone.

Items to upgrade:

  • GameDAO pallets
  • Zero pallets
  • Zero runtime
  • Subzero runtime
  • Subzero standalone runtime

LB/HA rpc node docker setup

GameDAO needs RPC nodes

  • we need secondary nodes for network access to alphaville and beeblebrox.
  • ideally the nodes will feature some HA setup and is docker based.

task

  • create rpc node for alphaville network operated by gamedao available at alphaville.gamedao.co
  • create rpc node for beeblebrox network operated by gamedao available at beeblebrox.gamedao.co

ac

  • node accessible on alphaville.gamedao.co
    • load balancer / HA setup
    • TLS vie LetsEncrypt
  • node accessible in beeblebrox.gamedao.co
    • load balancer / HA setup
    • TLS vie LetsEncrypt

appendix

  • you can clone storage of alphaville.zero.io (aws)
  • please complete the above list with whatever needed

zero global currency setup

we need a unified currency setup to understand what currencies are available and to use and refer to them with confidence:

UID <u8> Name Vec<u8> Symbol Vec<u8> Decimals <u8>
0 Zero ZERO 18
1 Game GAME 10
2 Play PLAY 10
...
10 Polkadot DOT 10
11 Kusama KSM 12
12 Acala ACA 12
13 Acala Dollar AUSD 12
...
100 3rd party

1. graph ->hadi @5-mark

2. rust / chain (depends on 1.) @vovacha

  • add enums to extend primitives based on best practice

3. graph (depends on 2.) -> hadi @vasylenko-yevhen

  • create relevant logic to update based on produced blocks
  • expose values based on a query using address as arg returning currencies selected

4. frontend (depends on 1.) -> hadi @DarkNebula0

  • consume primitive currencies
  • make them visible based on feature / config
  • make them usable based on feature / config

Generate keys for Sudo and collators

  • stage —— custom setup with team shared credentials

Store private keys for those account in some secure place (1password) and provide list of public keys to this task.

Integrate ORML `xtokens` into parachain runtime

As a participant of substrate ecosystem, I would like to transfer fungible assets between zero and other parachains, which are connected to the same relay chain.

How to implement

Following steps from the Acala docs page, provide CurrencyIdConvert type with possibility to convert between zero currencies and other parachains currencies.
Extend this type to be able to convert CurrencyId to MultiLocation and vice versa.
Add xtokens pallet to parachain runtime, providing above types as pallet parameters.

How to test

  1. Setup Zero and Acala parachains connected to the same relay.
  2. Open HRMP channel between two parachains.
  3. Initiate aUSD token transfer from Zero to Acala. Make sure tokens transferred and received on Acala side.
  4. Repeat previous step the other way around.

CI/CD pipeline for chain

  • Run CI/CD pipeline in GitLab for external repositories (GitHub zero-network)
  • Create a GitLab's docker cloud runner (rust base image)
  • Create pipeline (.gitlab-ci.yml)

Pipeline for all envs:

  • commit to the dev/stage/main branch triggers pipeline for dev/stage/prod envs
  • stage: test (make test, anything else?)
  • stage: build image - build, push the image to ECR (docker hub?) tags: env_name for dev stage, latest for prod, version for prod

Pipeline for dev/stage:

  • deploy: flush exisiting chain/graph, pull images, run everything from scratch

Pipeline for prod:

  • stage: build runtime - store an artifact so Sudo user can use it to manually upgrade a runtime

Notion Envs: https://www.notion.so/zeroio/1-Release-Planning-7d56cbc1f77e4974879b3bc68c729510

Fix self-healing for graph-gamedao service

Fix self-healing with graph-gamedao, and check if squid can work properly when there is no connection to the chain.

graph-graph-gamedao-1  | apiProviderResolver error Error: Chain client is not initialized
graph-graph-gamedao-1  |     at Object.apiProviderResolver [as apiProvider] (file:///app/src/resolvers/query/apiProviders/apiProviderResolver.ts:9:10)
graph-graph-gamedao-1  |     at field.resolve (/app/node_modules/apollo-server-core/src/utils/schemaInstrumentation.ts:106:18)
graph-graph-gamedao-1  |     at executeField (/app/node_modules/graphql/execution/execute.js:481:20)
graph-graph-gamedao-1  |     at executeFields (/app/node_modules/graphql/execution/execute.js:413:20)
graph-graph-gamedao-1  |     at executeOperation (/app/node_modules/graphql/execution/execute.js:344:14)
graph-graph-gamedao-1  |     at execute (/app/node_modules/graphql/execution/execute.js:136:20)
graph-graph-gamedao-1  |     at execute (/app/node_modules/apollo-server-core/src/requestPipeline.ts:500:34)
graph-graph-gamedao-1  |     at processGraphQLRequest (/app/node_modules/apollo-server-core/src/requestPipeline.ts:406:28)
graph-graph-gamedao-1  |     at runMicrotasks (<anonymous>)

Monitoring setup for the graph

  • Update existing dashboard with PROD env metrics
  • Test metrics exist on the PROD Prometheus server
  • Update the main Prometheus with PROD Prometheus server
  • Test metrics exist on the main Prometheus server

Alerts (draft):

  • alert if service not healthy
  • alert if no updates for metrics after N sec

https://dashboard.zero.io/

Test parachain env: local rococo

  • Generate Collator list with keys, generate Sudo key
  • Generate test chain_spec
  • Test with local rococo relaychain setup:
    • Block production
    • Check if all collators are working
    • Test RPC node with the load balancer

rococo onboarding

Required steps to get Rococo slot:

  • Acquire ParaId in Rococo network.
  • Add parachain details to polkadot ui app.
  • Create issue requesting Rococo slot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.