浅谈NFT链游模式项目DAPP系统开发技术理念成熟方案

简介: 浅谈阐述NFT链游系统开发GameFi搭建教程

  不管是现在还是可遇见的未来,完全在一个单体区块链上运行游戏在经济上是不可行的。这就是为什么过去几年发布的大多数区块链游戏都是混合型的,这些游戏只有少数组件在链上部署运行的,而其核心游戏逻辑则在链下专有服务器上运行。我们将这类区块链游戏称为弱上链游戏(weakly on-chain games)。

NFT游戏并不等同于躺在钱包中的加密货币收藏品。NFT游戏的规则、机制和玩家交互都会用到NFT。例如,The game can display the player's unique character or avatar as NFT. Digital items found during the game may also be NFT. You can exchange or trade NFT with other players to profit from it. The relatively new "earn while playing" mode also allows users to make profits through NFT games. We will discuss this topic in detail later.

parameter_types! {

pub const AlarmInterval: BlockNumber = 1;
pub const SubmissionDeposit: Balance = 100 * DOLLARS;
pub const UndecidingTimeout: BlockNumber = 28 * DAYS;

}

pub struct TracksInfo;
impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {

type Id = u16;
type Origin = <Origin as frame_support::traits::OriginTrait>::PalletsOrigin;
fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo<Balance, BlockNumber>)] {
    static DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 1] = [(
        0u16,
        pallet_referenda::TrackInfo {
            name: "root",
            max_deciding: 1,
            decision_deposit: 10,
            prepare_period: 4,
            decision_period: 4,
            confirm_period: 2,
            min_enactment_period: 4,
            min_approval: pallet_referenda::Curve::LinearDecreasing {
                length: Perbill::from_percent(100),
                floor: Perbill::from_percent(50),
                ceil: Perbill::from_percent(100),
            },
            min_support: pallet_referenda::Curve::LinearDecreasing {
                length: Perbill::from_percent(100),
                floor: Perbill::from_percent(0),
                ceil: Perbill::from_percent(100),
            },
        },
    )];
    &DATA[..]
}
fn track_for(id: &Self::Origin) -> Result<Self::Id, ()> {
    if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) {
        match system_origin {
            frame_system::RawOrigin::Root => Ok(0),
            _ => Err(()),
        }
    } else {
        Err(())
    }
}

}

impl pallet_referenda::Config for Runtime {

type WeightInfo = pallet_referenda::weights::SubstrateWeight<Self>;
type Call = Call;
type Event = Event;
type Scheduler = Scheduler;
type Currency = pallet_balances::Pallet<Self>;
type SubmitOrigin = EnsureSigned<AccountId>;
type CancelOrigin = EnsureRoot<AccountId>;
type KillOrigin = EnsureRoot<AccountId>;
type Slash = ();
type Votes = pallet_conviction_voting::VotesOf<Runtime>;
type Tally = pallet_conviction_voting::TallyOf<Runtime>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;

}

impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {

type WeightInfo = pallet_referenda::weights::SubstrateWeight<Self>;
type Call = Call;
type Event = Event;
type Scheduler = Scheduler;
type Currency = pallet_balances::Pallet<Self>;
type SubmitOrigin = EnsureSigned<AccountId>;
type CancelOrigin = EnsureRoot<AccountId>;
type KillOrigin = EnsureRoot<AccountId>;
type Slash = ();
type Votes = pallet_ranked_collective::Votes;
type Tally = pallet_ranked_collective::TallyOf<Runtime>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;

}

impl pallet_ranked_collective::Config for Runtime {

type WeightInfo = pallet_ranked_collective::weights::SubstrateWeight<Self>;
type Event = Event;
type PromoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
type DemoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
type Polls = RankedPolls;
type MinRankOfClass = traits::Identity;
type VoteWeight = pallet_ranked_collective::Geometric;

}

impl pallet_remark::Config for Runtime {

type WeightInfo = pallet_remark::weights::SubstrateWeight<Self>;
type Event = Event;

}

parameter_types! {

pub const LaunchPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const VotingPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const FastTrackVotingPeriod: BlockNumber = 3 * 24 * 60 * MINUTES;
pub const MinimumDeposit: Balance = 100 * DOLLARS;
pub const EnactmentPeriod: BlockNumber = 30 * 24 * 60 * MINUTES;
pub const CooloffPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const MaxProposals: u32 = 100;

}

impl pallet_democracy::Config for Runtime {

type Proposal = Call;
type Event = Event;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type VoteLockingPeriod = EnactmentPeriod; // Same as EnactmentPeriod
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
/// A super-majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
type InstantOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>;
type InstantAllowed = frame_support::traits::ConstBool<true>;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin =
    pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree.
type CancelProposalOrigin = EitherOfDiverse<
    EnsureRoot<AccountId>,
    pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
>;
type BlacklistOrigin = EnsureRoot<AccountId>;
// Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cool-off period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type OperationalPreimageOrigin = pallet_collective::EnsureMember<AccountId, CouncilCollective>;
type Slash = Treasury;
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = ConstU32<100>;
type WeightInfo = pallet_democracy::weights::SubstrateWeight<Runtime>;
type MaxProposals = MaxProposals;

}

相关文章
DAPP合约系统开发逻辑技术丨DAPP成熟系统开发技术方案
动态调用允许调用者在运行时指定被调用合约及方法,无需预先知道接口。中断配置通常包括:启用外设中断、设置中断优先级分组和使能中断请求。NVIC_InitTypeDef结构体用于中断配置,包含中断源、抢占优先级、响应优先级和使能状态。中断源定义在IRQn_Type枚举中,如WWDG_IRQn、PVD_IRQn等。抢占优先级值依赖于优先级分组设定。
|
5月前
|
存储 区块链 数据库
元宇宙NFT链游系统开发DAPP技术方案分析
元宇宙NFT链游系统开发DAPP(去中心化应用)的技术方案涉及多个关键技术和步骤。以下是对该技术方案的综合分析: 1. 区块链技术基础 区块链技术是NFT(非同质化代币)和元宇宙系统的核心基础。它提供了去中心化、透明、不可篡改的数据存储和交易机制。在NFT链游系统中,区块链用于记录NFT的唯一性、所有权和交易历史。
|
5月前
|
存储 JSON JavaScript
链游模式系统开发搭建功能丨链游系统开发项目方案(技术成熟)
首先,NFT链游系统的开发能够实现真正的去中心化。区块链技术使得NFT链游戏能够实现真正的去中心化,这意味着所有对象都是直接交互的平等个体。这样一来,所有人都能够公平地参与到NFT链游戏中来。
|
区块链 测试技术
DAPP链游开发稳定版丨链游dapp/nft游戏系统开发成熟技术方案及源码详情
随着区块链技术的不断发展,智能合约农场在链游行业中扮演着越来越重要的角色。智能合约农场是一种基于区块链技术的应用程序,它可以帮助链游开发商快速、安全地上线定制游戏软件。本文将介绍智能合约农场在链游行业中的作用以及如何通过智能合约农场快速上线定制游戏软件。
|
存储 人工智能 物联网
NFT链游系统开发(案例详解)丨元宇宙链游开发方案
NFT链游系统开发(案例详解)丨元宇宙链游开发方案
|
区块链
DAPP流动性质押模式系统开发(成熟案例)技术方案
要理解智能合约的概念和作用,首先需要了解区块链的基本架构
|
存储 安全 算法
DAPP合约系统开发|DAPP去中心化模式系统开发(成熟技术)
透明度和灵活性:任何区块链用户都可以评估合约逻辑和底层机制
|
存储 算法 区块链
链游项目系统开发(方案设计)丨DAPP链游系统开发(案例分析)/成熟技术/区块链游戏开发/源码说明
  在区块链中,每个块包含了一定数量的交易信息和该块的唯一标识符,同时还包含了前一个块的哈希值。这样的设计保证了区块之间的顺序和完整性,一旦一个块被添加到区块链中,它就不可更改。This makes blockchain a secure and trustworthy distributed ledger that can be used to record and verify various types of transactions.
|
Kubernetes 前端开发 API
NFT OpenSea平台系统开发技术方案丨技术成熟(源码部署)
NFT OpenSea平台系统开发技术方案丨技术成熟(源码部署)
160 0
|
Shell
OpenSea项目系统开发技术NFT元宇宙平台系统开发流程
OpenSea项目系统开发技术NFT元宇宙平台系统开发流程
148 0
下一篇
DataWorks