-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat): background sync | sense 🧬 (#1083)
Co-authored-by: dasein <[email protected]> Co-authored-by: dimakorzhovnik <[email protected]>
- Loading branch information
1 parent
5b1e2f0
commit d91d373
Showing
299 changed files
with
13,536 additions
and
2,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
import { Coin } from '@cosmjs/launchpad'; | ||
|
||
export const title = 'Moon Citizenship'; | ||
|
||
export const text50 = | ||
'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Atque consectetur sint deleniti recusandae eveniet necessitatibus perferendis voluptate iusto molestias. Iure est suscipit amet laudantium illo expedita dolores possimus tempora, repellat modi deleniti sequi optio consequatur aperiam? Sit perspiciatis odit eos iure quo magnam, quia ea cumque, iste odio officiis ex!'; | ||
|
||
export const text100 = | ||
'Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship'; | ||
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo minus, culpa vitae, nostrum impedit nemo architecto dignissimos eius modi at iste ratione! Illum ad temporibus tempore est! Asperiores dolorem earum commodi delectus, nisi distinctio sit alias, omnis numquam dicta velit rerum quas facere pariatur autem aperiam eius laborum quo expedita voluptates totam sequi quibusdam voluptate? Perspiciatis corrupti molestias provident hic, nostrum nulla saepe repellendus veritatis tempora assumenda nobis in inventore quidem quas facilis impedit fugiat, cum asperiores dolorum non? Animi repellat laudantium ut vero unde enim quasi? Nostrum excepturi veniam eaque dignissimos beatae dicta, reiciendis, voluptatum animi sequi necessitatibus eos.'; | ||
|
||
export const text500 = | ||
'Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship'; | ||
'Welcome to the portal. Take a quick look on what Bostrom are, and ≈what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship, check the ongoing gift status and more. Welcome to the portal. Take a quick look on what Bostrom are, and what you can do here. Get or manage your Moon Citizenship'; | ||
|
||
export const img = 'https://cyb.ai/images/preview.png'; | ||
|
||
export const address = 'bostrom1f5warat4vc0q98k7ygys4saka8u04rfxpmthvl'; | ||
export const transactionHash = | ||
'BAA06424541F011A759CE61DDA9D8A5471D87FFA93BAF7E82FA0FC02014D86E5'; | ||
|
||
export const particle = 'QmZ4b5kbCV9K9Jd2ZXpfUAKiPSkzPfD558wBbebYFpztKY'; | ||
|
||
export const amounts = [ | ||
{ | ||
denom: 'boot', | ||
amount: '100000000', | ||
}, | ||
{ | ||
denom: 'hydrogen', | ||
amount: '100000000000', | ||
}, | ||
{ | ||
denom: 'eth', | ||
amount: '1.5', | ||
}, | ||
] as Coin[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
## General | ||
|
||
- every process is RxJs async loop with N-second interval | ||
- all CID from's from any links in any process goes to separate _particle resolver queue(non-blocking)_ | ||
|
||
## My transactions process | ||
|
||
Sync all current neuron transactions: extract tweets, and chat(any interractions with other neurons). | ||
|
||
_transactions can be heavy, for ex. there can be MultiSend/broadcast transactions of 150-200Kb_ | ||
|
||
- save all transactions to DB | ||
- create sense chats for all unique neurons from MsgSend/MsgMultisend | ||
- extract 'tweet' links and add it to sync items(SyncParticlesLoop) | ||
- | ||
> **request count** = 1 aggregate req. + [user_transactions_count/batch]. | ||
> example - 1000 trans., batch is 200, requests = 1 + 1000/200 = 6 | ||
> every 60 sec. | ||
|
||
|
||
```mermaid | ||
flowchart TD | ||
A[SyncTransactionLoop] --> P1 | ||
P1[get last timestamp] --> B | ||
B(get trans. count > timestamp) <-..->|messages_by_address_aggregate| I[(Indexer)] | ||
B --> C{has new?} | ||
C -->|yes| D(fetch batch transactions) | ||
D <-..->|messages_by_address 'batch=200'| I | ||
D -->|iter by batch| IP{batch processor} | ||
IP --> D | ||
IP -->|has items| E{transaction type} | ||
IP -->|complete| U(update last timestamp) | ||
E -->|MsgSend/MsgMultiSend| T1(add neuron to sense chat) | ||
E -->|Cyberlink 'tweet'| T2(add tweet to 'sync') | ||
``` | ||
|
||
## My particles(tweets) process | ||
Sync current user particle updates(new links) | ||
|
||
> **request count** = user_links_from='tweet' \* [links_count/batch] | ||
> example - 100 tweets. requests = \* [???/10] = [100...???] | ||
> every 60 sec. | ||
```mermaid | ||
flowchart TD | ||
A[SyncParticlesLoop] -->|interval| P1 | ||
P1[get user tweets with last timestamp] --> L | ||
L[tweet processor] -->|iter by every tweet| F | ||
F[fetch links > timestamp] --> L | ||
F <-..->|Cyberlinks| I[(Indexer)] | ||
``` | ||
|
||
## My friends process | ||
Sync current user updates from friends(tweets&follows) | ||
|
||
> **request count** = following*users * (1(indexer) + [2(lcd)]) | ||
> example - following is 10, requests = 10 \* (1 + [2]) = [10...30] | ||
> every 60 sec. | ||
```mermaid | ||
flowchart TD | ||
A[SyncMyFriends] -->|interval| L | ||
L[my friends processor]<-->|iter by every friend| F | ||
F(fetch count)<--> L | ||
F <-..->|cyberlinks_aggregate 'tweets', 'follow'| I[(Indexer)] | ||
F --> C{has new follows/tweets?} | ||
C -->|yes| D(fetch links) | ||
D <-..->|fetch 'tweets' > timestamp| LCD[(LCD)] | ||
D <-..->|fetch 'follow' > timestamp| LCD[(LCD)] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useGetBalanceBostrom } from 'src/containers/sigma/hooks'; | ||
import IconsNumber from '../IconsNumber/IconsNumber'; | ||
|
||
function HydrogenBalance({ address }) { | ||
const { totalAmountInLiquid } = useGetBalanceBostrom(address); | ||
|
||
return ( | ||
<div> | ||
<IconsNumber value={totalAmountInLiquid.currentCap} type="hydrogen" /> | ||
</div> | ||
); | ||
} | ||
|
||
export default HydrogenBalance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.