dappforce / subsocial-js Goto Github PK
View Code? Open in Web Editor NEWJavaScript SDK for Subsocial blockchain.
Home Page: https://docs.subsocial.network/docs/develop
License: GNU General Public License v3.0
JavaScript SDK for Subsocial blockchain.
Home Page: https://docs.subsocial.network/docs/develop
License: GNU General Public License v3.0
Currently, Polkadot API spends over 5 seconds to connect to Substrate + retrieve initially required info about with several API requests from a chain and parse metadata. We need to speed up this setup process.
Jaco:
There is a lot of things it needs to do to get ready with the metadata.
it needs:
You only know if things have not changed by retrieving what is on-chain. So you can skip metadata retrieval, for instance, you can pass the metadata.
(based on genesis hash and spec version)
you can pass the metadata if you want to use it that way. (Indexed by hash and version)
Code responsible for parsing / setting metadata:
https://github.com/polkadot-js/api/blob/master/packages/api/src/base/Init.ts#L171-L175
See suggestion on the commit: #37 (comment)
Don't check for CID length.
Just try to create a new CID( /* string | buffer */ )
in a try/catch and if it doesn't fail, then this string or buffer/array represents a valid CID.
rel: @substrate/api-sidecar#771
The warning was found when running substrate-api-sidecar with @polkadot/[email protected]
.
2021-11-23 12:07:47 error: (node:20453) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/aggron/dev/parity/substrate-api-sidecar/node_modules/@subsocial/utils/package.json' of 'build/index.js'. Please either fix that or report it to the module author
Sidecar: v11.3.1
Node: v17 and up.
Being that Node v16 is the Active LTS
right now, and 17 is Current
I don't think it's a major problem, but I thought it was worth documenting.
Generate JSON schema from TS:
https://github.com/YousefED/typescript-json-schema
Validate against JSON schema:
https://github.com/epoberezkin/ajv
schema
?)See formatting setting here:
https://github.com/open-web3-stack/open-web3.js/blob/master/packages/indexer/src/log.ts
We need to mock classes in this package:
https://github.com/dappforce/dappforce-subsocial-js/tree/master/packages/api/src
As a bonus: React context with reducers can be used to be able to update the state. But this could be not trivial, such as we need to mock the logic of the corresponding methods of Subsocial blockchain: createBlog()
, createPost()
, createComment()
, etc.
Use polkadot api, I am triing to receive blocks from subsocial-parachain for subquery, but receive such error.
Unable to retrieve the specified block details. -32603: Unknown error occurred: Client, Application, UnknownBlock, State already discarded for BlockId::Hash, 0x4a12be580bb959937a1c7a61d5cf24428ed67fa571974b4007645d1886e7c89f
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpara.subsocial.network#/explorer/query/1
I can receive only blocks from last two hours. Can I receive older blocks?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.