사용할 수 없는 토큰 프레임워크 체인코드 패키지

Non-Fungible Token Framework는 Blockchain App Builder에서 지원하는 확장 된 ERC-721 표준을 사용합니다.

NFT 아트 컬렉션 마켓플레이스 샘플은 블록체인 앱 빌더에서 지원하는 확장된 ERC-721 표준을 기반으로 하는 실행 불가능 토큰 일반 프레임워크의 사용을 보여줍니다. 샘플에는 예술 작품과 관련된 NFT(Non-fungible tokens)를 구매하고 판매하기 위한 마켓플레이스를 나타내는 체인코드가 포함되어 있습니다. 이 샘플에서 박물관은 블록 체인 네트워크의 예술 작품에 대한 NFT를 민트 (생성) 할 수 있습니다. 그런 다음 소비자는 박물관에서 NFT를 구입하고 재판매 할 수 있습니다. 체인코드는 토큰 초기화, 계정 작업, 롤 지정, 민팅, 전송 및 레코딩을 포함하여 실행 불가능한 토큰 수명 주기를 관리하는 데 필요한 메소드를 구현합니다. 또한 민팅, 전송 및 연소 작업 승인을 위한 공증 계정을 제공하고 일일 한도 및 감사 절차를 통해 규정 준수를 지원합니다. NFT 아트 컬렉션 마켓플레이스 샘플은 TypeScript에서 체인코드 개발을 위해 설계되었습니다.

사용할 수 없는 토큰 프레임워크 체인코드 패키지는 Oracle Blockchain Platform 콘솔에서 다운로드할 수 있으며 다음 구성요소를 포함합니다.
  • NFTCollectiblesWithERC721.zip - 배치를 위해 패키지화된 체인 코드를 포함하는 아카이브 파일입니다.
  • NFTCollectiblesWithERC721-TypeScript.yaml - Blockchain App Builder에서 NFTCollectiblesWithERC721 체인 코드를 스캐폴딩하는 데 사용할 수 있는 사양 파일입니다.
  • NFTCollectiblesWithERC721_postman_collection.json - 체인 코드에서 API를 테스트할 수 있는 Postman 모음입니다.
  • README.md - 체인 코드 작업을 위한 단계별 안내서입니다.

대체 가능한 토큰 프레임워크를 가져오려면 Oracle Blockchain Platform Digital Assets 콘솔에서 Digital Assets 탭을 누른 다음 Non-Fungible Token Framework를 선택합니다.

Postman 컬렉션 사용에 대한 자세한 내용은 다음 내용을 참조하십시오.

사양 파일

아트 컬렉션 마켓플레이스 체인코드를 생성하는 데 사용되는 사양 파일에는 events 속성이 포함됩니다. 체인코드 이벤트 함수는 실시간 통지를 사용으로 설정하고 워크플로우를 트리거하기 위해 생성된 체인코드의 이벤트 콜백을 지원합니다. 사양 파일 및 사양 파일에 사용된 매개변수에 대한 자세한 내용은 Oracle Blockchain Platform 사용비독점 토큰에 대한 입력 사양 파일을 참조하십시오.

아트 컬렉션 마켓플레이스 체인코드는 다음 사양 파일과 같이 확장된 ERC-721 표준을 기반으로 합니다.
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
#
 
# This specification file is an example how to build any whole non-fungible token application.
# For a whole non-fungible token application, art collection marketplace has been used as an example.
# Art collection marketplace is a digital marketplace that uses NFTs to enable the buying, selling, and showcasing of unique art pieces, providing secure ownership, provenance tracking, and exclusive rights for artists and collectors.
 
assets:
    - name: ArtCollection #Asset name
      type: token #Asset type
      symbol: ART         # Token symbol
      standard: erc721+   # Token standard
      events: true # Supports event code generation for non-GET methods
 
      anatomy:
          type: nonfungible # Token type
          unit: whole  #Token unit
       
      behavior:
        - indivisible
        - singleton                               
        - mintable:                  
            max_mint_quantity: 20000
        - transferable               
        - lockable
        - roles:
            minter_role_name: minter
       
      properties:  # Custom asset attributes for non-fungible token
           
          - name: Price # Custom asset attribute to set the price of a non-fungible token in the marketplace
            type: float
           
          - name: On_Sale_Flag # Custom asset attribute to maintain non-fungible token selling status in the marketplace
            type: boolean
       
      metadata: # To maintain the metadata on-chain, this tag will be used. Users won't be able to update the metadata attribute values after an NFT is minted.
           
          - name: Painting_Name # Custom asset attribute to represent the title given to a piece of artwork.
            type: string
           
          - name: Description # Custom asset attribute to represent a detailed explanation or interpretation of the painting's concept, style, or message.
            type: string
           
          - name: Painter_Name # Custom asset attribute to represent the name of the artist who created the painting.
            type: string
 
customMethods:
    - executeQuery
    - "post(token_id: string, selling_price: number)" # Post the non-fungible token for selling in the marketplace.
    - "buy(from_org_id: string, from_user_id: string, to_org_id: string, to_user_id: string, nonfungible_token_id: string, amount_paid: number)"  # Buy the non-fungible token after paying the amount using any payment gateways.

체인코드 방법의 보증인 세부정보

Oracle Blockchain Platform Digital Assets Edition은 모든 세터 방법에 대한 요청 페이로드에 보증 매개변수를 추가합니다. 매개변수의 값은 endorsers 또는 sameOrgEndorser입니다. sameOrgEndorser 매개변수가 true인 경우 트랜잭션 보증은 요청자와 동일한 조직에 속해야 합니다. endorsers 매개변수는 트랜잭션을 보증해야 하는 피어 목록을 지정합니다. 자세한 내용은 Postman Collections의 보증 지원을 참조하십시오. 다음 표에서는 각 방법에 대한 보증인 유형을 보여 줍니다.

방법 보증인 유형
activateAccount endorsers
addTokenAdmin sameOrgEndorser
addRole endorsers
addTokenSysRole endorsers
balanceOf endorsers
buy endorsers
createAccount endorsers
createArtCollectionToken sameOrgEndorser
deleteAccount endorsers
getAccountByUser endorsers
getAccountHistory endorsers
getAccountsByRole endorsers
getAccountsByTokenSysRole endorsers
getAccountStatus endorsers
getAccountStatusHistory endorsers
getAccountTransactionHistory endorsers
getAccountTransactionHistoryWithFilters endorsers
getAllAccounts endorsers
getAllLockedNFTs endorsers
getAllTokenAdmins endorsers
getAllTokens endorsers
getAllTokensByUser endorsers
getLockedNFTsByOrg endorsers
getTokenById endorsers
getTokenHistory endorsers
getTransactionById endorsers
getUserByAccountId endorsers
getUsersByRole endorsers
getUsersByTokenSysRole endorsers
init endorsers
isInRole endorsers
isInTokenSysRole endorsers
isNFTLocked endorsers
isTokenAdmin endorsers
lockNFT sameOrgEndorser
name endorsers
ownerOf endorsers
post endorsers
removeRole endorsers
removeTokenAdmin sameOrgEndorser
removeTokenSysRole endorsers
safeTransferFrom endorsers
suspendAccount endorsers
symbol endorsers
tokenURI endorsers
totalNetSupply endorsers
totalSupply endorsers
transferFrom endorsers
transferTokenSysRole endorsers
updateArtCollectionToken sameOrgEndorser