Giter Club home page Giter Club logo

fabric-es's Introduction

Hi there

LEAD | COACH | FULLSTACK | ARCHITECT

  • πŸ”₯ I’m currently working on AI and Blockchain projects
  • 🀟 I love games and anime, hackathon
  • πŸ† I'm a DLT patent owner
  • πŸ’° I’m looking to collaborate on AI, DeFi and hacking projects
  • πŸ’¬ I'm working with open-source projects

✨✨✨ I have good knowledge and hands-on in:

  • AI: xGPT, Langchain, PyTorch
  • zkp: Circom, arkworks, RiscZero
  • Blockchain - Hyperledger Fabric, Besu, Corda, Web3 stack (e.g. etherjs, hardhat)
  • Coding - Typescript, GoLang, Python, Java, Solidity, Rust, R
  • UI - NextJs, ReactJs, Material-ui, Tailwindcss, Micro-Frontend
  • API: gRpc, Graphql, REST
  • Mobile - React Native, Flutter
  • DevOps practice and implementation: GitHub Actions, CircleCI, ArgoCD gitOps, Ansible etc
  • Observability: Jaeger, Prometheus, Grafana, OpenTelemetry instrumentation
  • Cloud Deployment: K8S (AKS, GKE, EKS), Helm-charts, operators
  • Networking: Istio service mesh

others:

  • Microservice with Domain Driven Development
  • Reactive functional programming
  • OAuth / OpenID Connect / Certificate Authority
  • W3C Decentralized Identity
  • Central Bank Digital Currency
  • Asset Tokenization
  • Kali Linux

πŸ“« How to reach me: [email protected]

fabric-es's People

Contributors

dependabot[bot] avatar fabric-es avatar github-hkicl-cof avatar hkicl-ming avatar hohowin avatar pangduckwai avatar rtang03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fabric-es's Issues

Deploy relay to AWS

The scope of this task includes:

  • 2 VMs in AWS. One represents ETC, another one represents PBOC

  • Each VM consists of:

    • a relay, which forwards requests to the endpoint
    • a mock server, which pretends the etc or pboc endpoint and listen to the requests
  • The relay includes following functions:

    • forward requests to the endpoint
    • capture the requests and response information
    • publish information to redis

This task needs 1 week.

findBy function cannot replace getProjection

@pangduckwai reports a bug in here.

},
Loan: {
documents: catchErrors(
async ({ loanId }, _, { dataSources: { document } }: Context) =>
document.repo.find({ byId: loanId }).then(({ data }) => data),
{ fcnName: 'Loan/docuemnts', logger, useAuth: false }
),
},

Resolution:
Need to fix it similar getProjection (i.e. field search function).

paginated api and pagination retrieval (cursor based)

paginated api, e.g. getByEntityName resolvers

paginated info retrieval from Redis

Consider that Redisearch's command FT.SEARCH provide "LIMIT" and "SORTBY" flag. This is natively numbered-paged pagination. We shall adopt numbered-paged pagination, instead of cursor-based pagination, for the sake of simple simple implementation.

However, will concurrently explore the need and way to go for cursor-based pagination, or infinite scrolling.

finishing the current sprint by creating 0.6.2 release

currently, the unit test of auth package requires to running compose.1org.px-db-red.yaml.

This is 1org compose.

The curent "Create_Release" workflow is 2org.

In order to add the unit test of "auth" package, it needs some refactoring.

registerAndEnroll misbehaviour in gw-node

Paul discover the bug:

Paul Lai 9:52 AM
and please note that before registerAndEnrollUser was working only because of the bug (the missing return)

Ross` Tang 9:54 AM

registerAndEnrollUser requires admin credential, to operate. gw-node use Org Admin ID, to get authentenicted from auth-server. After successful authentication, it get β€˜is_admin’ true, and passing on to apollo context.

And, the password is not checked locally, and it is sent to /oauth/authenicate api

Paul Lai 9:56 AM

no it is not checked at all, the password is wrong...

9:57

actually 'requires admin credential' is not true also. because now my user's is_admin is false. if using your original code (check is_admin, create the ForbiddenError object, and let it garbage collect immediately), it works

upgrade to Fabric v2.1

  • upgrade to Fabric v2.1
  • upgrade sdk version
  • explore major dependency, like Apollo server

This may take 3 days.

This task should start as pre-requisite of v0.6.2.

create release 0.6.1

The previous create release workflow is based Fabric V1.4.x. While now running Fabric V2.0.1, it shall upgrade create release workflow accordingly.

Digital wallet

The current implementation does not have UI for end-user to create digital wallet. It requires to using Apollo playground, to send mutation request "RegisterAndEnrol" towards "admin" micro-service, via federated gateway.

This task shall

  • based on "ui-account" implementation, to extend ui for Digital wallet implementation
  • integrate with gw-org1, to send mutation request "RegisterAndEnroll".

Be noted that, they are referring to the SAME procedure.

  • in business sense, this is to Create Digital Wallet
  • in technical sense, this is a 2 steps procedure: (1) Register Fabric CA Identity in CA server; and (2) Enroll the above identity onto the server-side wallet, of gw-org1 VM.

The technical implementation will be made with simple REST call.

Dashboard and reporting

After query-handler is done, it needs a simple dashboard application to visualise the off-chain public data from Redis.

Consolidate dev-net

Currently, there are multiple deployments, for different needs:

  • lib-dev-net -> for library develop
  • gw-dev-net -> for image building
  • gw-test-net -> for k8s deployment

They are based on slightly different configtx.yaml and docker-compose.

And also, the "~/deployments/boilerplate" has a few issues

  • it makes use of both local MacOS command, and insider container command. It leads to require sudo to execute commands.
  • it places the generated genesis.block and config.tx in the middle non-generated fixture code. It is hard to clean-up, and does gitignore
  • the service name is using dot separator; that make k8s incompatible.
  • the scripts are nested hierarchy. It makes k8s definition too complex. If needs to reuse configuration for both docker-compose and k8s, need to flatter the hierarchy.
  • the script is not catered for running unit & integration in CI. Need to re-organize them

The Goal to make a single consolidate dev-net for multiple purposes.

add Rxjs timeInterval when createCommit

Currently, all fabric write operation is not having invocation control.

For better reactivity, will add Rxjs timeInterval operator, to avoid burst of invocation.

Tentative, add 100ms interval.

Be noted that some test may fail.

additional api and meta data for createQueryDatabase

Currently, the reconcile commit and computed entity in Redis is insufficient to provide data for use by dashboard.

Here needs information two categories of meta data.
(a) meta data added, BEFORE commit is written into Fabric.

  • _creator: enrollmentId
  • _created: created at timestamp in second
  • _ts: last modified timestamp in second

(b) meta data added, AFTER commit is reconcile into Redis

  • __event: event sequence, to compute the currentState
  • __commit: commit sequence, to compute the currentState

These additions of meta-data will facilitate the addition of new api for use by Dashboard and Reporting.

full text search enhancement

There are many full text search attributes, which are not implemented.

This is time-consuming, or unnecessary way of search.

When later implementing the UI/dashboard function, #52 , it should further evaluate which additional feature of full text search are required.

Need to improve

  • the index schema. e.g. what to include in the tag; and what to include in the eIdx and cIdx

As a reminder, by https://oss.redislabs.com/redisearch/Tags/

"...searching for a tag without any modifiers will not retrieve documents containing it... "

Current PR is tentatively accepted. There encounters below problem with grpc + ubuntu

Current PR is tentatively accepted. There encounters below problem with grpc + ubuntu

https://stackoverflow.com/questions/49758008/nodejs-error-failed-to-load-grpc-binary-module-because-it-was-not-installed-fo

grpc/grpc#15431

As a workaround, now bypasses the unit-test of fabric-cqrs; those tests are runnable and passed in local MacOS.

Let check later will face with similar problem with "Create Image" workflow.

This issue may disappear if later upgrade to Fabric v2.0

Originally posted by @rtang03 in #11 (comment)

TypeOrm Dependency Error

Today, the auth server cannot start, and report below error.

TypeError: Cannot set property EntityManager of #<Object> which has only a getter at Object.<anonymous> (/home/app/src/index.ts:141:9) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at Module.Hook._require.Module.require (/usr/local/share/.config/yarn/global/node_modules/require-in-the-middle/index.js:80:39) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/home/app/src/entity/ApiKey.ts:1:1)

This is related to below break of TypeOrm
typeorm/typeorm#6054

Need to add below to the package.json of "auth" package.

"resolutions": { "tslib": "1.11.2" }

upload micro-service

the "upload" micro-service shall

  • accept file incoming streaming to mimic machine-to-machine upload. Should be something like S3 api.
  • accept multi-form upload for ui form upload
  • the micro-service should allow flexible configuration to using different storage operation; both OBS, and EBS.

Readme of library code

Currently, both root level Readme, and those of library code are out-of-dated. Need to fix it so that the published library gives correct instructions.

Improve create image workflow

Currently, the create image workflow is lacking of fully covered unit and integration test. After finishing previous task about the "consolidated dev-net" (PR #5 ), will improve the "create-image" workflow, to make use of it; so that every release increment will have unit- and integration gates, before an official images are created.

This task will start after the publish registry #6 is done. And, be completed before end of sprint 2.

migrate the integration tests to running during CI

Currently, the CI with integration test is running, with hello-world tests. The workflow is there; without real tests. This task will migrate the existing integration tests for library code, into the "packages/tester", so that they are running as well.

Also, the pre-existing integration tests are broken, because we refactor to "consolidated" dev-net. Both docker compose service name, and url addressing in connection profile are in-correct. This task will fix them altogether.

Finally, integration tests can run locally, and during CI

Publish library code to package registry

In order to facilitate extended team to using our library code, and create more boilerplates projects. We need to publish library code into package registry.

A repo rename and namespace rename are required, before continuing. Need to wait other team member to check in all codes, to avoid unexpected trouble, when git origin is changed.

Planned this weekend; take 1 -2 days

add reverse proxy in micro-service style

Before further proceed to #19 , I find that this is good to introduce reverse proxy, for each org, to improve the intercommunication, and add ssl layer more easily.

Currently, will attempt to use 'http-proxy-middleware' npm library; instead of ngnix.

I don't have solid comparison between using ngnix, and http-proxy-middleware.

@pangduckwai @hohowin @github-hkicl-cof , if you have comparison, let me know.

Refactor fabric-cqrs and Gatewaylib, to using newly added Redis and Query-Handler

For the sake of ease development, follow below step.

  1. complete issue-20, which includes the all implementation of Redis-based querydb, and projection db, and their event-notification. And, Redisearch as well.
  2. after (1) is done, the "query-handler" will be able to reconcile, subscribeHub, and notify events. This step 2, will further refactor, the "query-handler", to relocate duplicated implementation, BACK to "fabric-cqrs" and "gateway-lib".
  3. the query-handler will be trimmed down, and made to "query-handler" docker image.

Inconsistent result type from Query-side Redis result

This is partly historical coding practice, what Fabric's returning result are in form of Record<string, Commit>.

When migrating from in-query database to Redis. In order to minimise the change impact, some returning result from Redis are in TEntity[] and others in Record<string, TEntity>.

This discrepancy make ugly and unnecessary conversion.

Consider that Redis is natively using only array, and also Apollo resolver is friendly with array.

This task will revisit and attempt to change the Query-side operation to using array, for sake of cleaner code. The command side will remain unchanged.

A special attention is required to maintain the immutability requirement for Redux.

Query-Handler implementation

Currently, we are using in memory queryDB and projectDB. It makes the docker container runtime bigger and bigger, and being stateful container.

This task shall detach in memory queryDB, into Redis, so that the gw-org will be stateless again. This task is medium complexity, will take 2- 4 weeks to complete.

Upgrade from dev-net from 2org to 3org

@pangduckwai created a dev-net2 (3org), and new naming convention. Need to revisit it, and refactor the library package, so that the underlying tests can run on this 3org network.

Also, it need to refactor CI and create_image workflow to change from 2org to 3org.

After enhancement, the starting network will be 3org; and is also the base topology for reference implementation.

Add Checking in Auth Docker Image

It is critical for the postgres DB named "auth_db" to be created prior to start the auth service. Currently, the auth docker image does not have any checking of that.

It is suggested to add checking in auth docker image by meanings of an entrypoint.sh script.

collective revamping task for authentication package

Based on new technical design, this auth package will revamp.

In current release, the callback URL website is incomplete.

And, note that previous unit test was done successfully, with oauth calls. But it is well integrated, nor tested against the latest gw-org* implementation.

Lastly, in current unit-test in CI workflow, the unit-test is temporarily removed. It needs to add it back.

This task is considered done, after successful release is made, and gw-org* can make use of it.

ui-account: token expiry and /home

(1) ui-account does not handle properly, when access_token in auth-server expires. And, the ui-account will get 401 status code.

(2) after logon, and then click /home, the /home does not know this is authenticated user. This is because withAuthSync HOC has bug, and is removed.

Boilerplate-d continuous delivery

Current deployment is made upon plain VM. A preliminary assessment shows a more robust production grade deployment should be based k8s. Previously experiments was successfully made to using local machine single node k8s cluster.

This task shall extend "dev-net" to be deployable to both docker-compose, and k8s.

This task is considered successful, when reference implementation is made on k8s on GCP. This is mid-term goal; medium priority.

valid token check for ui-control

Currently, the once token is obtained and set in cookie, it is removed unless explicit logout.

We need, for every page reload/refresh, it should validate the token, to ensure its validity. And, if invalidated, need to remove this token, even not clicking logout.

And, evaluate if we should use refresh token.

Upgrade dev-net (3org) to Fabric v2

It will take multiple steps fabric v2.

There are a number of new features, deserved for this upgrade.

  • enhanced private data. Currently, I don't exactly understand the new feature, especially how it impacts us. We need to figure out.
  • external chaincode launcher. This may save us from cc deployment workflow, when the consortium grows.
  • update nodejs dependency. Hopefully, it will also fix grpc issue with ubuntu.

Additional considerations:

  • the new chaincode lifecycle is not useful, is likely to stick to the old.
  • the fabric-sample is missing the network operator example.
  • This is questionable, if the node-sdk is good quality. Previous attempt on V2 beta indicates the sdk is having lots of issues.

We need to determine if all packages upgrade should fall into sprint 3. Timing-wise, this is good timing. Priority-wise, not a must-do priority.

Therefore, we may attempt to split the upgrade into (a) deployment (current task), and (b) packages. If (a) is smooth, then go to (b).

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.