Comments (5)
High-level definition of Social DB workload
Initialization of SocialDB is quite straight forward:
- Deploy WASM (Available on github: https://github.com/NearSocial/social-db/tree/aa7fafaac92a7dd267993d6c210246420a561370/res)
- Call
new()
- Call
set_status(status = "Live")
Then to register a user, we don't have to do anything. But for every call we do later, we must ensure there is enough storage. To facilitate, user initialization can be as easy as:
- Call
storage_deposit(account_id = "user.near")
For actual workload, I am thinking of three different interactions to starts:
- Follow someone else
- Post a message
- Like a post from someone else
All of these interactions are just calls to set
. The only non-trivial part is constructing the argument just right.
This can also be easily extended to all kinds of interactions that change social DB, such as widget updates, profile changes, etc. It's all just set
calls.
The argument construction requires nested JSON serialization as shown below. Luckily, it can be done in just a few lines of Python code.
// Example JSON for "jakmeier.near" following "pugachag.near"
{
"data": {
"jakmeier.near": {
"graph": {
"follow": {
"pugachag.near": ""
}
},
"index": {
"graph": "{\"key\":\"follow\",\"value\":{\"type\":\"follow\",\"accountId\":\"pugachag.near\"}}",
"notify": "{\"key\":\"pugachag.near\",\"value\":{\"type\":\"follow\"}}"
}
}
}
}
See the full call in the explorer: https://explorer.near.org/transactions/J2erddvLFo8L4Qn9Rb4HV8tHA3iJtNcgW6iSDBRwCcBh
from nearcore.
So far I code the initialization and the follow transactions. It's available in this commit: dbef2f0
from nearcore.
We merged #9133 with initialization, "Follow someone else" and "Post a message".
from nearcore.
One inconvenience so far is that the smart contract validation might not be enough for us to be sure that meaningful work is being done. A set
call may be successful without actually having the desired effect.
Ideally we would attach a frontend to benchmarking and look at users and posts from there, even if just to confirm that it does what it should. But I will keep this as a nice-to-have addition for now.
from nearcore.
I'm going to close this as there is currently no plan to add likes or a frontend. The current socialDB load is good enough for, as it can be used to test how many users we can support in a given setup.
from nearcore.
Related Issues (20)
- Header sync incorrectly disregards peers at startup
- [Epoch Sync] EpochInfoAggregator treatment is awkward at the epoch sync boundary
- [Epoch Sync] Implement EpochSyncProof validation
- [Epoch Sync] Network message size optimization
- [Epoch Sync] Implement deriving EpochSyncProof from an older EpochSyncProof
- [Epoch Sync] Error in gc: DB Not Found Error: BLOCK HEADER: 11111111111111111111111111111111
- [Epoch Sync] Implement network rate limiting and caching for EpochSyncRequest
- [Epoch Sync] Minor: Header sync progress is misleading after epoch sync
- Spoofed compute costs metrics
- Chunk endorsement by shard metrics must use shards chunks-endorsed, instead of shard chunks-produced
- Tracking issue for fixing minimal required stake HOT 2
- [Epoch Sync] Blocks received during state sync marked as invalid
- mainnet: synced node has regular Downloading blocks logs HOT 3
- [ReshardingV3] Receipts Reassignment HOT 1
- [EpochSync] Defend against malicious peers sending invalid epoch sync
- Difficulties Managing Gas Allocation for Chained Cross-Contract Calls HOT 2
- publishing: add a CI task to test packaging/building of all published crates individually HOT 1
- High cardinality metric HOT 4
- Downloading blocks stuck at 0.00% HOT 3
- Removing the validator key and then sending SIGHUP to the neard process does not appear to stop it validating
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nearcore.