Giter Club home page Giter Club logo

empowerchain's Introduction

EmpowerChain

This is where the code for anything related to EmpowerChain is located. Documentation is being built right now.

In the meantime, take a look at our whitepaper, website and @empowerchain_io on twitter.

./chain

In the chain folder is where the actual blockchain-code is located.

./docs

In the docs folder you will find the documentation and doc site for https://docs.empowerchain.io

empowerchain's People

Contributors

alexander-astrand avatar alextothemoon avatar ardapda avatar ba1ciu avatar brendan-whispernode avatar clemensgg avatar dependabot[bot] avatar ericjohncarlson avatar github-actions[bot] avatar gjermundgaraba avatar jschill avatar kalianetwork avatar maheshkrex avatar maxzonder avatar n0okone avatar nodersteam avatar northa avatar omahs avatar piranavanshanmugavadivelu avatar polkachuintern avatar portlandnorway avatar ppnv avatar relyte avatar santosdios avatar sr20dem avatar stakrspace avatar stan-bl avatar tombeynon avatar vbloher avatar zenchainlabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

empowerchain's Issues

Reject project

New tx message to reject a project.

  • Only an admin from the issuer of the credit class referenced in the project is allowed to reject a project (See how this was done for Approve Project)
  • It should not be possible to reject an already approved project
  • It should not be possible to reject an already rejected project
  • It should not be possible to issue credits for a project that has been rejected

Extra: Check and test that you can only approve projects that are in the NEW state (i.e. that you can approve a project that is already approved or rejected)

Tip: look at the code done in #354.

Change binary name to empower

Currently, the binary name is "empowerchaind". To have a nicer and shorter name (similar to regen network that just uses "regen") we will change the binary to "empower".

Add linting

No linting is added. Use whatever is standard for other chains. Do formatting at the same time?

Add to:

  • Makefile
  • CI/CD

Depends on:

Access Control for transactions

We have to implement access control mechanism for transactions. For now similar functionality to Access Control from OpenZeppelin should suffice.

We should use mapping of address => []bool to achieve that.

Business rules limits

We need to go over the different entities we have and look at where we need to set some limits to avoid abuse.

Potential examples include (but are not limited to):

  • credit class abbreviations
  • names for most entities

Some potential limitations to look for are:

  • Specific business rules in terms of min/max-length
  • Other rules

Set up and document E2E testing

Start the migration from our current bash-based E2E tests to programmatic test like in the Cosmos SDK.

Definition of done:

  • Set up, and document, a new E2E programmatic testing approach (similar to the one in the Cosmos SDK)
  • Create tasks to move over existing E2E tests (in other words, don't do them all in this task)

EPIC: Plastic Credit V1

Epic to keep track of all the tasks related to the first version of the Plastic Credit module

Tasks

  1. C:x/plasticcredit
    ba1ciu
  2. C:x/plasticcredit
    gjermundgaraba
  3. C:x/plasticcredit
    gjermundgaraba
  4. C:x/plasticcredit
    gjermundgaraba
  5. C:x/plasticcredit
    gjermundgaraba
  6. C:x/plasticcredit
    gjermundgaraba
  7. C:x/plasticcredit
    maheshKRex
  8. C:x/plasticcredit
    ba1ciu
  9. C:x/plasticcredit
  10. C:x/plasticcredit
    gjermundgaraba
  11. C:x/plasticcredit
    maheshKRex
  12. C:x/plasticcredit
    maheshKRex
  13. C:x/plasticcredit
    maheshKRex
  14. C:x/plasticcredit
    ba1ciu
  15. C:x/plasticcredit
    ba1ciu
  16. C:x/plasticcredit
    ba1ciu
  17. C:x/plasticcredit
    ba1ciu
  18. C:x/plasticcredit
    maheshKRex
  19. C:x/plasticcredit
    maheshKRex
  20. C:x/plasticcredit
    maheshKRex
  21. C:x/plasticcredit
    maheshKRex
  22. C:x/plasticcredit
    maheshKRex
  23. C:x/plasticcredit
    aljo242
  24. C:x/plasticcredit
    aljo242
  25. C:x/plasticcredit T:tests
    ba1ciu
  26. C:x/plasticcredit
    maheshKRex
  27. C:x/plasticcredit
    maheshKRex
  28. C:x/plasticcredit
    ba1ciu

Set up CI/CD

We need:

  • Run all tests for every PR and push
  • Simulation
  • Linting
  • Gen?

Set up CI/CD with scripts and earthly/dagger (TBD)

state sync not working

State sync doesn't seem to work now, can you please review and fix if possible.

empowerd version # 0.0.1

RPC node configuration
snapshot-interval = 2000
snapshot-keep-recent = 2

pruning = "custom"
pruning-keep-recent = "100"
pruning-keep-every = "2000"
pruning-interval = "10"

RPC link
SNAP_RPC="https://empower-testnet.nodejumper.io:443"

Error
3:12PM ERR snapshot manager not configured
3:12PM ERR State sync failed err="state sync aborted" module=statesync

Screen Shot 2022-10-04 at 19 12 18

Document test strategy

In chain/CODING_GUIDELINES.md we need to document our test strategy. To what extent we use different types of tests (unit, integration, e2e, smoketests, simulation), how we write them and where they are located.

Combine genesis test with invariant check for plastic credits

Currently we have pretty comprehensive tests on genesis, but fully lack invariant check, which is needed for catch issues after upgrades for instance.

The goal for this task is to find a way to extract the logic done in the genesis validation and reuse it for invariant checking. The main difference will be how to get/fetch the different entities (JSON/Struct vs Keeper).

For reference on invariants: https://docs.cosmos.network/main/building-modules/invariants

Plastic credit issuer

A plastic credit issuer is an entity that is allowed to create credit classes and issue credits to projects.

Creating a new issuer should be governance controlled, but needs to be possible for governance to hand over control to a sub-dao/group for easier management.

Access control for creating an issuer should therefore be limited to a single address, which is set by a governance parameter. The default genesis value should be set to the governance module.

  • Document the Issuer state in x/plasticcredit/spec
  • Implement an "IssuerCreator" param that can be changed with a gov proposal
  • Implement create issuer msg
  • Implement queries for "issuer", "issuers"
  • Create a smoke test that does this as well from the CLI (see scripts/tests)

Unit and integration tests everywhere!

Simulation testing will be implemented after Cosmos SDK 0.47 is out and upgraded.

image

Update credit class

New tx message to update a credit class.

Rules:

  • Only the admin from the Issuer that owns the Credit Class is allowed to perform this update
  • Can only change the name

Pull out ignite

For now, we, unfortunately, need to pull out ignite because it hinders our ability to make design choices (design choices that would break scaffolding, for instance).

We will, however, need to replicate some of the functionality (scaffolding won't be one of them).

Things to do:

  • Pull out everything ignite related
  • Remove scaffolding comments
  • Create Makefile with build and install
  • Add protoc make commands?
  • Add doc build command (Done in #7 instead)
  • Update the readme file with instructions to build, generate, etc

Set up documentation generation

Currently, all generated docs are pulled out of the repo.

We need to generate new swagger documentation at the very least, but probably would make sense to make a more holistic approach to documentation on empowerchain for both design, tech, APIs and users.

Approve projects

  • Add status field to projects
  • Issuer-only tx to approve a project
  • Update issuing of credit to check if a project is approved first.

Simulation testing plasticcredit module

Set up simulation testing for what we have + add it to CI

Reminders:

  • Update CODING_GUIDELINES
  • Add non-determinism and perhaps a short sim test to the regular test pipeline
  • Modules for import/export test

Set up a proper monorepo

This repo will house all the empowerchain-related code, and a proper monorepo with good separation between different projects will make a lot of things easier and nice to work with (also: things that change together, go together).

Rename create project flow to register project

The flow for creating a new project is currently called "Create Project", but a more accurate description of what is happening is that an applicant is registering a project.

So we need to rename and rephrase a few places to make this more accurate.

Unify error naming

Change all errors to the following format:
Err[Object][Reason]

Example: ErrProjectNotFound (instead of ErrNotFoundProject)

Update Project

New tx message to allow updating a project

Rules:

  • Can only be done by the admin from the Applicant that owns the Project
  • Can only change the name of the project

Create applicant

An applicant is a collection organization or other type of plastic credit applicants.

Creating an applicant can be permissionless as they can't perform any harmful actions until they've been approved for a project. Therefore we need to keep track of when they were created so we can later add cleanup logic if it becomes necessary.

  • Document applicant state
  • Implement create applicant tx message
  • Implement get applicant query (not sure we need a query for all of them, so let's wait for that)

Credit Issuance

We have to implement Credit Issuance logic. Boilerplate is already generated. There's a msg_server_issue_credits.go were we should put most of the logic.

CreditBatchIssuance is the MsgIssueCredits body and it contains:

  • project_id - we can identify both Collector and Credit Class with it
  • total_amount which is the overall credit amount to be minted for this operation. We might already make possible to issue both active and retired credits (Regen does that, TBD, @bjaanes)

batch_denom should be created from credit_class_denom and some kind of a suffix. The assumption for now is that the suffix should be generated automatically in some way, but we may want to change that so it can be provided by the user. Then we'll have to extend CreditBatchIssuance with the suffix, TBD, @bjaanes.

We should leave TODO for the access control implementation as it will be addressed by a different issue.

Issuing credits should update CreditBatch store, CreditDenom list and BatchDenomToCreditBalance store. Make sure that the suffix used for the store is the address of the credits' owner.

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.