简体   繁体   English

区块链底层pallet_membership用例?

[英]Blockchain substrate pallet_membership use cases?

Let me know if I am on the right train of thought.让我知道我的思路是否正确。 I'm currently building a dapp that will be based on my own parachain, and I was wondering if by adding this pallet https://paritytech.github.io/substrate/master/pallet_membership/index.html , it would be a way to allow users in my dapp to pay for membership. I'm currently building a dapp that will be based on my own parachain, and I was wondering if by adding this pallet https://paritytech.github.io/substrate/master/pallet_membership/index.html , it would be a way允许我的 dapp 中的用户为会员付费。 obviously I would have to have some extrinsic functions that are exposed through my dapp so that when they click and pay for membership, in the runtime, the membership pallet will add that user as a member.显然,我必须有一些通过我的 dapp 公开的外部功能,以便当他们点击并支付会员费用时,在运行时,会员托盘会将该用户添加为会员。 Can anyone confirm my thoughts on this?谁能证实我对此的看法?

This leads up to another question.这就引出了另一个问题。 Should I just create a smart contract to handle membership logic and deploy it on edgeware or some other parachain that already exists.我是否应该创建一个智能合约来处理成员逻辑并将其部署在边缘软件或其他已经存在的平行链上。

obviously I would have to have some extrinsic functions that are exposed through my dapp so that when they click and pay for membership, in the runtime, the membership pallet will add that user as a member.显然,我必须有一些通过我的 dapp 公开的外部功能,以便当他们点击并支付会员费用时,在运行时,会员托盘会将该用户添加为会员。 Can anyone confirm my thoughts on this?谁能证实我对此的看法?

You can easily do this.你可以很容易地做到这一点。 pallet_membership is just a container for members. pallet_membership只是成员的容器。 As you will find in the pallet_membership::Config , there are special origins that can be defined as those who have the authority to add or remove a member.正如您将在pallet_membership::Config中发现的那样,可以将特殊来源定义为有权添加或删除成员的人。

You need a new pallet that will handle the payment to join new members.您需要一个新托盘来处理加入新会员的付款。 Let's call this pallet_membership_payment .让我们称之为pallet_membership_payment Once pallet_membership_payment has received the correct payment, it can call into pallet_membership::add_member with whatever origin is required to satisfy it.一旦pallet_membership_payment收到正确的付款,它就可以调用pallet_membership::add_member来满足它所需的任何来源。 Not that even if the origin requirement of add_member is EnsureRoot , pallet_membership_payment can still practically get over it, if it is coded as such.并不是说即使EnsureRoot add_member如果按照这样编码, pallet_membership_payment实际上仍然可以克服它。


Should I just create a smart contract to handle membership logic and deploy it on edgeware or some other parachain that already exists.我是否应该创建一个智能合约来处理成员逻辑并将其部署在边缘软件或其他已经存在的平行链上。

The answer to this really depends on how much further logic does your application have next to handling this membership via fees.这个问题的答案实际上取决于您的应用程序在通过费用处理此成员资格之后还有多少进一步的逻辑。 Also, it depends on the smart contract payment model (end user pays the fees) works for you If this is it , then it is pretty simple.此外,这取决于智能合约支付 model(最终用户支付费用)为您工作如果是这样,那么它很简单。 You might have an easier time in a smart contract model.您可能在智能合约 model 中过得更轻松。 But, if you need certain optimisations, less fees, more performance etc. you will probably have to consider being your own (para)chain.但是,如果你需要某些优化、更少的费用、更高的性能等,你可能不得不考虑成为你自己的(平行)链。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该使用 Pallet_membership 来处理 dapp 用户成员资格吗? (智能合约和区块链运行时的区别) - Should I use the pallet_membership to handle dapp user membership? (Differences between smart contracts and blockchain runtime) 基板框架V2如何使用pallet_timestamp - Substrate frame V2 how to use pallet_timestamp 基板 frotier rpc 托盘中所需的类型注释 - type annotations needed in substrate frotier rpc pallet 为自定义托盘 Substrate 添加自定义 RPC 时出错 - Error adding Custom RPCs for custom pallet Substrate 如何包含<T as Trait> :: 基板框架托盘内结构中的块编号 - How to include <T as Trait>::Blocknumber in a struct within a Substrate FRAME pallet Substrate Blockchain - 创建第一个区块链前端不打开 - Substrate Blockchain - Create First Blockchain FrontEnd doesn´t open 如何修改 Nicks Pallet(在 Substrate 中)以通过将货币转移到另一个帐户而不是使用储备货币来设置昵称? - How to modify the Nicks Pallet (in Substrate) to set the nickname via a transfer of currency to another account, instead of using reserve currency? 如何在Parity Substrate自定义运行时中使用通用结构? - How to use generic structs in the Parity Substrate custom runtime? 如何导入substrate_primitives 以使用sr25519? - How to import substrate_primitives in order to use sr25519? 在 Rust 中开发基板运行时是否需要使用宏? - Is it necessary to use macros while developing substrate runtime in rust?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM