權杖分類架構的輸入規格檔案
區塊鏈 App 產生器初始化命令會讀取輸入規格檔案,並使用數個工具產生鷹架式專案,以協助鏈碼開發處理作業。
您可以在相同的規格檔案中,定義以「權杖分類架構」為基礎的標準資產和權杖資產。您無法根據相同規格檔案中的一個以上的標準來定義變數替代字資產。
如需在規格檔案中包含標準資產的資訊,請參閱輸入規格檔案。
Blockchain App Builder 套裝程式提供下列可行權杖資產範例檔案:
FiatMoneyToken.yml
LoyaltyToken-Go.yml
除了標準特性和區段之外,有趣的記號資產還支援規格檔案中的 behavior
和 anatomy
區段。有趣的記號資產也支援 standard
特性。下列範例顯示根據「權杖分類架構」之有趣權杖資產的規格檔案結構:
assets:
- name: OBPTOK # Asset name
type: token # Asset type
anatomy:
type: fungible # Token type
unit: fractional # Token unit
behavior: # Token behaviors
- divisible:
decimal: 2
- mintable:
max_mint_quantity: 1000
- transferable
- burnable
- roles:
minter_role_name: minter
properties:
- name: currency_name # Custom attribute to represent the token in certain currency. This attribute is helpful for exchanging the tokens with fiat currency.
type: string
- name: token_to_currency_ratio # Custom attribute to specify the token to currency ratio. This attribute is helpful for exchanging the tokens with fiat currency.
type: number
表格 7-5 可產生變數替代字規格檔案的參數描述與範例
進入 | 描述 | 範例 |
---|---|---|
type: |
您必須在 |
|
standard: |
standard 特性代表產生鏈碼時要遵循的記號標準。有趣的記號僅支援 ttf+ 值。如果未指定有趣的記號的 standard 特性,則會遵循「記號分類架構 (TTF)」標準。
|
|
anatomy: |
anatomy 區段有兩個有趣的記號必要參數:
|
|
behavior: |
本節說明記號的功能與限制。對於有趣的記號,必須要有 mintable 和 transferable 行為。
|
|
若要建立多個使用不同 max_mint_quantity
參數的可行權杖 ID,請為規格檔案中的每個權杖 ID 建立個別的權杖資產,並在權杖資產與權杖 ID 之間建立 1:1 的關係。
若要建立多個使用相同 max_mint_quantity
參數或無 max_mint_quantity
參數的可行權杖 ID,請在規格檔案中建立單一權杖資產,以用於所有權杖 ID。