- Moniker: ghash-cheqd-test-node
- Node ID: e9e5ce55ab734e96f9f1523757f7349c97bb2beb
- IP address / DNS name: 213.134.163.234
- Using screenshots (5 max.)
- I would like to understand architecture better. What are the parts of
cheqd-node
code, how do they relate to each other, third-parties and what are their responsibilities. May be even visualize dependecy tree for that matter. - Can we create output stream of data that provides meaningful information about what is going on in node. In combination with existing
jsonrpc
data it could be used to create UI app with live updates and abilities to manage node or even pool of nodes.Even developers love fancy UIs;)
- Even though Windows isn't commonly used as an OS for this type of software it might be useful in a scenario when developer just wants to quickly check cheqd-node.
But, unfortunately, WSL doesn't start with
systemd
by default which causes some problems with using it. Docker also uses WSL by default on Windows. So it might be useful to make some adjustments into code and/or documentation. - Installation guide for docker distribution doesn't include any information about commands and args. It probably should point to step from deb package installation guide as it is done in Binary installation manual.
- You might consider adding command/script for having one-liner for setting up and running node in testnet. It might be useful for newcomers that just want to try cheqd-node before deeper dive.
Developers are lazy too;)
- It also might be useful to have an ability to see is node idle or it tries to check existing blocks (and how many).
Checking
latest_block_time
andlatest_block_height
isn't so convenient cheqd-noded
often stops/crashes silently. It'll be better to have meaningful feedback, especially for cases likeNo disk space available
.
1. Describe an overview of how you would architect and build a web/mobile app that satisfies the criteria.
For this task I'm assuming web application to simplify answers, but mobile app won't differ much: mostly in front-end technology stack, while basic principles will stay the same.
- Frist of all, we need actual blockchain network. We can assume that end-user will install local
cheqd-node
or be able to connect to existing node that isn't provided by us, but it seems to dramatically narrow user-base. So we should deploy "central"cheqd-node
at least. It'll be better to have some cloud-based pool of such nodes for better scalability and reliability. Actual architecture of such infrastructure with load-balancers, VMs, storages, etc. is another big topic. For simplicity let's assume that we have publicly availablecentral node
. - We need something to deliver our web app (which consist of some static files). It could be as simple as GH pages, S3 bucket or Azure Storage. At the end we have
static file web server
. - Since we already use some cloud-like (it can use our own servers if needed) infrastructure, it might have sense to have
application server
there too in order to perform some more complex work or provide additional features that don't use blockchain directly. Proxies, DBs, cache, buses, etc. should be added according to needs. Client application
parts:-
Domain models: Blockchain State, Transaction (+ Collection of), Account (+ Collection of), Delegator (+ Collection of), Validator (+ Collection of), Block (+ Collection of), etc.
-
Layer for reactive synchronization of models with actual blockchain state (could be FRP or OORP)
-
App composer: could be as simple as component that includes needed parts, or as complex as
IoC-container
. Anyway its only responsibilite to compose full app from parts. -
Reactive router: selects proper
self-contained component
based on browser location -
Actual self-contained components:
- Dashboard (depends on
Blockchain State
) - Transaction Search Page/Bar (depends on
List of Transactions
) - Transaction Page (depends on
Transaction
) - Account Page (depends on
Account
) - Delegator Page (depends on
Delegator
) - Validator Page (depends on
Validator
) - Block Page (depends on
Block
)
and others
- Dashboard (depends on
-
Building blocks without dependecies on domain models (or UI-kit):
- Generic Chart component
- Link
- Button
- Input
and others
-
Some other parts if needed for other features
-
It depends on a lot of factors, including familiarity with tech stack of existing developers and amount of developers that could be hired with such knowledge, including their cost, availability and length of onboarding process. Since I'm not aware of existing constraints I'll follow with widely spread, up-to-date and preferably OpenSource solutions.
Kubernetes
- to avoid vendor-lock on cloud provider.AWS
/Azure
/Others - doesn't matter in terms of technical solutions, so should be selected by price.- If needed
Rust
/Go
forApp Server
, since it's already used in othercheqd
products ornode.js
+TypeScript
, since developers familiar with technology anyway will lend into company sooner or later for developing web applications. Each technology has their own pros/cons in this field, that should be taken into consideration before making final decision. - If needed
Swagger (OpenAPI)
orGraphQL
forApp Server
to provide better documentation and use code-generation tools. TypeScript
- typechecking reduces amount of bugs with tiny overhead and allows to create better API for other developers.babel
- for compiling JS, faster thenTypeScript
default compiler and has better interoperability with other tools, likewebpack
/parcel
/etc.React
- one of the most popular frameworks nowdays. Has its own downsides, but there are no objectively better solution with comparable community. (Angular
orVue
aren't worse but also they aren't better).MobX
- good and popular tool for designing Domain Models.Could be replaced with thin wrapper around
RxJS
if FRP is preferable.
Could be replaced with home-grown tool likemetaf-react
. It may allow easier and more efficient implementation of reactive synchronization layer, but will require a little bit more maintenance.- Code generation tools like
swagger-codegen
to avoid mistakes/typos/bugs when interacting with node from browser.Could be easily replaced with fine-tuned homegrown script. In this case it also could be used for autogenerating mocked node with mocked responses - very useful for testing purposes.
LESS
/SASS
+React scoped CSS
- for encapsulated and reusable styling.Could be replaced with something more popular like
styled-components
/CSS modules
.Jest
for testing. Existing popular test-runners doesn't differ much, probably exceptJest
support for snapshot testing which proved to be very useful in certain scenarios.I would love to suggest my own testing library:) But it doesn't have community, so not an option at the moment.
- (Optionally) some UI library like
material-ui
- (Optionally) libraries for charts like
react-charts
ord3.js
- (Optionally) libraries for grids like
ag-grid
- Run local
cheqd-noded
andCRA
dev-environment that points to is as back-end. - Create actual UI app.
- Deploy one node to cloud and configure public address to it.
- Deploy static built UI app that point to node from previous step to cloud or even GH pages.
- Proceed with configuring infra by Kubernetes.
- Proceed with App development.
2.1 What questions or considerations would you investigate to test the viability of your approach (even if you didn’t have all the answers/context at this stage)?
- Existing team-members' knowledge of selected tech-stack
- End-users constraints
- End-users existing preference for such software
- Possible caveats of node depolyment to cloud or some Kubernetes constaints
- Actual need for App Server and/or some Proxy
- Ability to generate client code for interacting with a node
I tried to point my assumptions in answers themselves.
- It requires more details for infrastructure architecture.
- UI app architecture could also be deepened by making more precise and granular description of components needed, which also coud be visualized as wireframe.