create account

Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction by drsensor

View this thread on: hive.blogpeakd.comecency.com
· @drsensor · (edited)
$0.60
Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction
#### Repository
https://github.com/byteball

> After doing some quick assesment, seems I can't build this project. I will pass the ideas, direction, and architecture to the community and see if this project get move on or being stalled (probably I can only create some PoC and examples)

#### Direction
- Dogfooding after beta release.
- Using other platforms (e.g Utopian) to submit the Task Request before beta release.
- Always setup some tools to enforce many things (e.g code style, commit message, PR template, etc) early on before submiting Task Request.
- Utilize frameworks if applicable. Having an agreement for convention and approach can improve maintainability.
- Consensus base development?

#### Technology Stack
There are 3 component for creating this project: wallet, bot, and oracle. 

##### Oracle
This is the first time I design an Oracle service. When I think about an Oracle (not mistaken with database) I though it's a nice to have service if you already had a product but seems I mistaken. The Oracle in this project are some sort of service (Github call it App) which pass some event in Github/Gitlab to Byteball DAG. I think make it as plain as possible but well architected should be viable.

| Framework and Technology | Reason |
| --- | --- |
| [Nest][]/[TsED][] | This is closest server-side framework I can think of which adopt many design pattern |
| GraphQL | In case the Oracle need to interact with the repository. Although this Oracle will use Webhook a lot |

To make it as plain as possible, I have been thinking to treat this Oracle as a switch or multiplexer. I hope this way we can avoid storing any data in the Oracle. Seems I need to detail this more in another post while demistify the flow of the data on each event. Also, having a public dashboard could be *a nice thing to have*? Maybe?

##### Bot
The bot (or I should say the bot that used by the organization) is quite unique because of the plugins mechanism have an ability to install a plugin remotely. Hopefully, it can also be integrated into the wallet ⎝ ͡⎚ ͜つ ͡⎚⎠.

| Main Dependencies | Reason |
| --- | --- |
| Apollo (GraphQL) | To interact with (and potentially combine) Github & Gitlab API using <a href="https://www.apollographql.com/docs/graphql-tools/schema-delegation.html">schema delegation</a> |
| Express | Have many great middleware built by the ecosystem |
| Typescript | Well, this is little bit opiniated but I always though that having an ability to specify some constraints (via strong typing) can improve the maintainablity in the long term |

The reasons I don't suggest to use [Nest][]/[TsED][] is the plugins mechanism that this bot has, *which mean* you need some degree of flexibility to implement your own convention. Having a rigid framework to decide the way you build this bot will limit what the plugins can do. I suggest the plugins implementation adopt how [Vue CLI 3][] and [Cerebro][] approach it by utilizing dynamic `require` and NPM registry. Ah yes, actually, the `npm` cli can be used programmatically and there is a Javascript wrapper for that, so...( ͡° ͜ʖ ͡°)

[Nest]: https://nestjs.com/
[TsED]: http://tsed.io/

##### Wallet
The wallet itself is just a pretext to store and hold the token and interact with the bot to create/submit bounties. The main goal for this wallet is to be swiss-army-knife tools for managing a project, especially Open Source one (but not limited to Enterprise project). The technology stack that I'm going to propose:

| Framework & Main Dependencies | Reason |
| --- | --- |
| Vue | To support incremental adoption of new technology via @vue/cli 3 |
| Quasar | Rich UI component and community (somehow it's popular in blockchain community) |
| Electron | The most known way to build and deploy desktop application. It even support native dependencies compilation which make it easy to install `sqlite3` and `secp256k1` |

This wallet also has the plugins mechanism with some constraint. I suggest the plugins mechanism in this wallet borrow some extensibility principles and patterns in VSCode while the implementation adopted from [Cerebro][] which use dynamic `require` and NPM registry (I doubting about VSCode approach because it's too complex and the usage are quite different). Some constraint which borrow [VSCode extensibility patterns][] that I can think of:
- The plugins API represents asynchronous operations with promises. From the plugin module, any type of promise can be returned.
- Events in the plugins API are exposed as functions which the plugin creator can call with a listener-function to subscribe.
- The plugins API will not expose the DOM to the plugin creator. Plugin creator can only interact on some specific UI in predefined manner.

#### Architecture
It's always a good thing to have a feedback when you write something. And yes, I got some feedback in my last post to use Oracle. It's quite challenging because I don't know how the Oracle usually work and after some study, here is the high level architecture that I got:

<center><img height="500" src="https://ipfs.busy.org/ipfs/QmTrJuSAd7ZpJDWHB2YtKX56QVmffaN54fiC8oaopCwY1e"/></center>

- **Desktop Wallet** - A Byteball wallet and also swiss-army-knife tools for managing a project. Can be extended via plugins.
- **Bot** - From the digram above, seems the bot only act as a gateway. However, it's more than that. While it act as a gateway, it still a bot. Another role this bot has is to notify the Oracle of some user action like creating a bounty (which also deploy the smart contract). Also, thanks to the plugins mechanism you can integrate it with others services. The bot itself can also be installed inside the wallet to support developer that not belong to any organization.
- **Oracle** - The Oracle service will act as a plain service (Github App). After the user authorize to use the App (Oracle), the user can controll which repository can be interacted/controlled by the Oracle. The Oracle can only do:
	- pass commit status update to Byteball DAG
	- pass Pull Request status update and metadata to the Byteball DAG
	- comment on an Issue or Pull Request (I take an inspiration from GitCoin)
	- read/set/update Milestone

<blockquote>
Probably you (JS dev) not notice this, GraphQL query/mutation/subscription schema has similiar characteristic with Javascript Object especially when you use destructuring assignment. Both of them can pick the data you only need and also call a function inside an object (bracket). Here is the question: Is this coincidence? Do TC39 know this? Is Facebook has hidden intention? Can we convert the GraphQL query/mutation/subscription schema into Javascript expression so we can use it as a Javascript API without spin-up a HTTP server?

PS: All the question is just a joke. Only the last one is the real question ᖗ👁️෴👁️ᖘ
</blockquote>

> FYI: Gitlab GraphQL API is still alpha

#### Extensibility via Plugins

For the plugins system, I take inspiration from [Vue CLI 3][] and [Cerebro][] which ~~abuse~~ use NPM registry as a marketplace. And if possible, we can also adopting some of [VSCode extensibility patterns][] to make the Plugins API more flexible yet doesn't break the host (wallet & bot).

<center><img src="https://ipfs.busy.org/ipfs/Qma8KxDPYcHvxKEsh9QftaPUtMcuE8op5mJHG1cJfR1z2K"/></center>

The API we want to expose can came later while developing the desktop wallet and the bot. I usually use some sort of IDL when creating 2 application/platform that share common functionality. For this project, defining the exposed API in separate repository then place it as a git submodule in wallet-repo and bot-repo could enforce both application share common API.

Lastly, some potential plugins I can think of to manage OSS project:
- Stackoverflow plugins
- Utopian plugins
- Discord plugins?

[Vue CLI 3]: https://cli.vuejs.org/dev-guide/ui-api.html#ui-files
[Cerebro]: https://github.com/KELiON/cerebro/blob/master/app/plugins/externalPlugins.js
[VSCode extensibility patterns]: https://code.visualstudio.com/docs/extensionAPI/patterns-and-principles#_extensibility-patterns

---
<sup>
There is repositories I create in prompt of the Use-a-thon event.
	- https://github.com/git-ball
	- https://gitlab.com/GitBall
</sup>
---

#### GitHub Account
https://github.com/DrSensor
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 73 others
properties (23)
authordrsensor
permlinkbyteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293
categorybyteball
json_metadata{"app":"steeditor/0.1.2","format":"markdown","image":[],"tags":["byteball","useathon","utopian-io","ideas"],"users":[],"links":[]}
created2018-09-15 01:29:09
last_update2018-09-16 12:50:57
depth0
children6
last_payout2018-09-22 01:29:09
cashout_time1969-12-31 23:59:59
total_payout_value0.499 HBD
curator_payout_value0.096 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,294
author_reputation17,679,210,755,117
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout100,000.000 HBD
percent_hbd10,000
post_id71,321,654
net_rshares549,747,601,031
author_curate_reward""
vote details (137)
@favcau ·
$6.87
Hi @drsensor, thank you for your contribution.

You made a great post! Unfortunately *Suggestions relating to product or organizational processes will not be considered for reward*.
However, I will share your post with the ByteBall team so you can get feedback from them.

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , , ,
properties (23)
authorfavcau
permlinkre-drsensor-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180919t212132738z
categorybyteball
json_metadata{"tags":["byteball"],"users":["drsensor"],"links":["https://join.utopian.io/guidelines","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-09-19 21:21:33
last_update2018-09-19 21:21:33
depth1
children1
last_payout2018-09-26 21:21:33
cashout_time1969-12-31 23:59:59
total_payout_value5.158 HBD
curator_payout_value1.715 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length563
author_reputation75,981,011,753,578
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,708,058
net_rshares5,159,603,077,308
author_curate_reward""
vote details (5)
@utopian-io ·
Thank you for your review, @favcau!

So far this week you've reviewed 1 contributions. Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-drsensor-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180919t212132738z-20180924t104541z
categorybyteball
json_metadata"{"app": "beem/0.19.42"}"
created2018-09-24 10:45:42
last_update2018-09-24 10:45:42
depth2
children0
last_payout2018-10-01 10:45:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation152,955,367,999,756
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id72,114,213
net_rshares0
@genievot ·
I don't want to discourage you but i suggest that you should mention while using pic from any post . for e.g. Byteball dag pics. I don't mind if you use them but just a suggestion.
properties (22)
authorgenievot
permlinkre-drsensor-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180916t110838457z
categorybyteball
json_metadata{"tags":["byteball"],"app":"steemit/0.1"}
created2018-09-16 11:08:39
last_update2018-09-16 11:08:39
depth1
children2
last_payout2018-09-23 11:08:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length180
author_reputation5,993,018,919,157
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,438,702
net_rshares0
@drsensor · (edited)
Thanks for mentioning @genievot . Can I ask where do you get that line break image 🙂?
For the rest of the logo, I think it shouldn't be a problem because it has this kind of term stated that you can use the logo to advertise that your product has built-in integration and also permission to use it in blogs post or news article that related about it. (I have used it many times in my tutorials)

[EDIT]: I have replaced the Byteball dag pics, sorry 🙇if it disturbs you 🙇🙇🙇:dogeza:
👍  
properties (23)
authordrsensor
permlinkre-genievot-re-drsensor-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180916t112250525z
categorybyteball
json_metadata{"community":"busy","app":"steemit/0.1","format":"markdown","tags":["byteball"],"users":["genievot"]}
created2018-09-16 11:22:51
last_update2018-09-16 12:57:57
depth2
children1
last_payout2018-09-23 11:22:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length480
author_reputation17,679,210,755,117
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,439,636
net_rshares1,759,531,677
author_curate_reward""
vote details (1)
@genievot · (edited)
I made those line breaks 🙂
👍  
properties (23)
authorgenievot
permlinkre-drsensor-re-genievot-re-drsensor-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180916t162126720z
categorybyteball
json_metadata{"tags":["byteball"],"app":"steemit/0.1"}
created2018-09-17 03:45:24
last_update2018-09-17 03:45:39
depth3
children0
last_payout2018-09-24 03:45:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length26
author_reputation5,993,018,919,157
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,502,171
net_rshares5,572,956,542
author_curate_reward""
vote details (1)
@steem-ua ·
#### Hi @drsensor!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your **UA** account score is currently 1.498 which ranks you at **#35960** across all Steem accounts.
Your rank has dropped 162 places in the last three days (old rank 35798).

In our last Algorithmic Curation Round, consisting of 429 contributions, your post is ranked at **#394**.
##### Evaluation of your UA score:

* Only a few people are following you, try to convince more people with good work.
* The readers like your work!
* Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!


**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-byteball-use-a-thon-a-way-to-contract-reward-contributor-efficiently-high-level-detail-and-the-direction-1536974947293-20180916t081401z
categorybyteball
json_metadata"{"app": "beem/0.19.54"}"
created2018-09-16 08:14:03
last_update2018-09-16 08:14:03
depth1
children0
last_payout2018-09-23 08:14:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length754
author_reputation23,214,230,978,060
root_title"Byteball Use-a-Thon: A way to contract/reward Contributor efficiently - High level detail and the direction"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,428,864
net_rshares0