-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anchor, On-chain Linked List pallet and Name Service #1528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the application. I have one initial comment/question: The milestone tables currently don't contain the pallet itself or anchor.js as a delivery. Why is this? I would recommend integrating these into the milestone.
Hello @Noc2 , |
You can access the [freeSaying ( Only applicable to mobile )](https://freesaying.net) demo to know well. Anchor network is the very important basic storage system. Anchor.js is a isolate JS library to access Anchor network, can read and write data easily. | ||
Anchor pallet is a part of EasyPolka, the relationship as follow : | ||
|
||
![easypolka.png](http://android.im/anchor/easypolka.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are cSaying
and cHome
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are
cSaying
andcHome
here?
Hello @semuelle , sorry for the slow response. "cSaying" and "cHome" is cApp ( Chain Application ) which are the pure JS code stored on-chain by Anchor.
For example, such JS code can be launched by "saying" that the plinth for cApp.
/* cApp basic structure.
* @param RPC object //RPC object from plinth
* @param container string //html DOM id for the cApp as container
* @param error object //Error object from plinth
*/
;(function(RPC,container,error){
// normal console log.
console.log("Hello world, this is from cApp.");
console.log(`Dom container id : ${container}`);
console.log(`Error from pedestal : ${JSON.stringify(error)}`);
// call RPC from plinth to access Anchor network
var ss58="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
RPC.common.balance(ss58,function(res){
console.log(res);
});
})(RPC,domID,error);
So the data sent to setAnchor will be like this :
{
"key":"any_name",
"raw":"JS string above",
"protocol": JSON.stringify({"type":"app","format":"JS","ver":"0.0.1"}),
"pre":0
}
QR to access to freesaying.net. | ||
![easypolka.png](http://android.im/anchor/qr.png) | ||
|
||
- With Anchor, you can use run a substate network just need a bit upgrade. Through the highly customizable data structure and the ability of cApp, the threshold of application development on the chain is greatly reduced. It means that new developers who even does not know blockchain well can build cApp just by Javascript and publish it nearly free. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what development with Anchor instead of, say, Substrate or ink looks like and how it is easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what development with Anchor instead of, say, Substrate or ink looks like and how it is easier?
The reason is that developer who just has the skill of pure Javascript can join the blockchain development.
The follow is the structure of EasyPolka, after the green part developed well, only the two red parts left to care about.
- cApp part, it is pure JS coding. I think after some basic work, current JS applications can be converted to it.
- vService part, it is based on Node.js right now. Some of the services such as the cache for the on-chain data can be shared. Only some new function need to develop.
About ink or smart contract, I am not working on them actually, so just my view.
They are used for Financial Application very well. But for the normal applications, coins is not always the main thing to think about. That's Anchor pallet benefit, care about trusted data instead of coins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missing some details.
I have tried to work on smart contract , but failed. I can read the code , but can not make it work.
Will try again, I think I know substrate much better than the point I tried it, :-)
origin: OriginFor<T>, //default | ||
key: Vec<u8>, //Anchor name | ||
raw: Vec<u8>, //raw data to storage | ||
protocol: Vec<u8>, //data protocol, used to decide how to decode raw data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is protocol
here and what does it do? Can you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
protocol
here and what does it do? Can you give an example?
There are two samples that I used for the cApp freeSaying.net.
- cApp protocol.
{
"key":"any_name",
"raw":"JS string above",
"protocol": JSON.stringify({"type":"app","format":"JS","ver":"0.0.1"}),
"pre":0
}
- data protocol
{
"key":"any_name",
"raw":JSON.stringify({"any":"object"}),
"protocol": JSON.stringify({"type":"data","format":"JSON"}),
"pre":0
}
cApp can subscribe the latest block and decode the data , if the protocol is supported by the cApp, it can be used by the cApp.
In short, the protocol is highly customized for the developer.
applications/Anchor.md
Outdated
|
||
- **Total Estimated Duration:** 1 month | ||
- **Full-Time Equivalent (FTE):** 1 | ||
- **Total Costs:** 6,000USD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Total Costs:** 6,000USD | |
- **Total Costs:** 6,000 USD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @keeganquigley , sorry for the slow response.
I will modify it and update.
Thanks for the application @ff13dfly, in addition to the comments above, our payment options have also changed recently. Can you either switch to USDC/DAI or provide a Polkadot address if you prefer using Statemint? Also are you able to expand upon your future plans a bit? How do you plan to maintain it? Do you plan to apply for a follow-up grant, or other means of funding? Thanks! |
Thank you for reminding, will modify and update.
Yes, I want to apply for a follow-up grant if it is helpful for Polkadot ecosystem. About funding, that's great if there is a chance, :-) |
Thanks for the updates, @ff13dfly, but I'm still not quite sure I understand where/how this is going to be used.
|
Hello @semuelle , will try to explain in details.
Right now, for the demo cApp , it is a React application which groups the RPC calls and manage the account ( create or load from encry JSON file ).
For me, Yes, hope to run a parachain. For others, they can use Anchor pallet as Name Services such as ENS.
This is the interesting part of On-chain Linked List, Anchor data are all stored on chain. As your sample, you can call the historical data. For business, it is more interesting. It means that your Ancho is valuable not only rely on the characters but also the data or application you store on it. That is much like the real world.
Yes, you are right. I recommend to create new Anchor, just as the demo do, all data of the demo's data are Anchors, even the fav/tread history. At this use case, you can treat Anchor as Key-value Storage. About Simplifying development, it is about the block chain access. Anchor is a way to store data on chain, and this way can be used to develop complex application without continually update the API. For example, when substrate up to v4.0.0 or higher, Anchor pallet may need some update. But to the applications rely on Anchor, there is no update. So the developer can focus on the business itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have trouble imagining it working out the way you describe it, as JS libraries usually need regular updates as well. I am also skeptical that there is a market for anchors. However, you have shown that you are capable of implementing it and that you are committed to this project, so I'm approving it. I would need to see serious interest in the project before signing a follow-up grant, though.
Thank you, will try to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also happy to support it.
Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section of our README for more ways to find answers to your questions. |
Thank you, will try to finish it in time, :-) |
Project Abstract
Anchor is a on-chain linked list system base on substrate 3.0.0. It is used to support cApp ( Chain Application ) development. On another hand, Anchor can alse be treated as Name Service or on-chain key-value storage system.
Grant level
Application Checklist
project_name.md
).@_______:matrix.org
(change the homeserver if you use a different one)