Titan Network(EN)
🌟【中文】🌟Official Website
Titan Network(EN)
Titan Network(EN)
  • 👋Titan Network Overview
  • 🏆Our advantages
  • 📢Latest Announcement
  • 📘Light Paper
  • 🆕galileo testnet
    • 💫About Galileo Testnet
    • 🔥Titan Testnet Optimization Announcement: Establishing a Solid Foundation for Mainnet
    • 💹TNT4 Node Reward Rules v0.2
      • ❌TNT4 Node Reward Rules v0.1
    • 🔍Participation Guide
      • 🇨🇳Mainland China
      • 🇧🇷Brazil
      • 🇯🇵Japan
      • 🇹🇭Thailand
      • 🇻🇳Vietnam (60 Gbps)
      • 🏳️‍⚧️15 New Regions(20GB)
    • 🔥Limited Time "Double Earnings" Now Live Exclusively for Brazil & Japan Regions!
    • 🛠️Titan Agent Installation Guide
      • 🐧Linux
        • 🖥️Install Titan Agent on Linux (x86)
        • 💪Intall Titan Agent on Linux (ARM)
        • 🧩Enable cgroups v1 Compatibility Mode
      • ⚡Cloud VPS
      • 💻Windows
        • 🏢Intall Titan Agent on Windows Pro
        • 🏠Intall Titan Agent on Windows Home
        • ❓FAQ for Windows
      • 🍎macOS
        • 🍎Install Titan Agent on macOS
      • 📱Android
        • 📺Install Titan Agent on Android Box
        • 📱Install Titan Agent on Android Phone
    • 🤖Daily Reward Distribution Mechanism
      • 💱How to transfer TNT4 to Solana network
      • ⚖️How to Test TNT4 Token Trading?
      • ⏰Changes to Payout Rules for Nodes
    • 🔑How to get the Key?
    • 🛜Network Configuration Optimization
    • 🥇Detailed Rules for TNT4 Promotion Reward Activities
  • 💵Tutorial for Staking TNT4 Tokens
  • 💱How to Transfer TNT4 from Solana to Titan Chain​
  • 🪛​A&Q for Testnet 4th Windows Client​
  • Contribution rewards
    • ❣️Contribution Points
    • 💳Contribution Points Thank-You Card
  • Blockchain Test
    • 🪙$TNT Token
    • ⛓️Block chain
      • Blockchain Layer
      • Coordination Layer
      • Resource Layer
      • TITAN’S DEPIN INFASTRUCTURE PLATFORM
      • BLOCKCHAIN DEVELOPMENT FRAMEWORK
    • 💸Titan Wallet & Test Token
      • 🎰Create Titan Wallet Address
      • 🪙Obtain Test Token $TTNT
        • 🎟️Redeem TTNT with Points
        • 🚰Get Free TTNT from Faucet
      • ⚖️How to Transfer
    • ⛓️Validator Node
      • 📖Operation Tutorial
      • 🆕Validator Node Major Update Notice
      • 🍄Node Unjail
      • 🧙Set the Avatar for Your Validator
    • 🔮Titan Blockchain Browser
    • 🛡️Stake on Titan Chain
    • 🕹️Deploy WASM Smart Contract
    • ⁉️Bug Reports / Feedbacks
  • 🔥Cassini Testnet
    • 🛰️About Cassini Testnet
    • ⚙️Cassini Testnet Participation Guide
    • 🧐Frequently Asked Questions
  • Resource Network Test
    • ⛏️Operate Nodes
      • 📡L1 - Guardian Node
        • 🗣️Software Updates
          • ⚠️​​Titan Network L1 Node Resource Quality Inspection Notice​​
          • 🆕Release v0.1.21 - Cassini Testnet
          • 🚫Release v0.1.20 - Cassini Testnet
          • 🚫Release v0.1.19-b - Cassini Testnet
        • 👩‍🏫L1 Node Operation Tutorial
        • 🔥Apply to operate L1 Node for higher rewards
        • 💰Reward Rules
        • ☹️Penalty Rules
        • 🤖L1 Early Exit Tutorial
      • 🛰️L2 - Edge Node
        • 💰Installation & Earnings
          • 🖥️Visualized Operation on Windows
          • 🖥️Operation on Windows (CLI)
          • 💻Visualized Operation on MacOS
          • 💻Operation on MacOS (CLI)
          • 📱Operation on Android phone
          • Operation on Linux
          • ⌨️Operation on Docker
          • 🤖</>CLI Management Commands
          • Clear up Old Node Data
            • Data Cleaning on Linux
            • Data Cleaning on MacOS
            • Data Cleaning on Windows
            • Data Cleaning on Windows (CLI)
            • Data Cleaning on MacOS (CLI)
            • Data Cleaning on Android
        • ⚖️Reward Rules
          • 🪙Basic Rewards
          • 🚇POA-Tunneling Network Rewards
          • 📡POA-Hot Storage / CDN Rewards
            • 💾Storage Rewards
            • 🛰️Bandwidth Rewards - Hosting Download Service
            • 🛜NAT Score
          • 📶Number of Nodes Operating Under the Same IP
          • 📈Online Loyalty Coefficient
          • ⏰Yesterday Online Hours Leaderboard Reward Program
          • 🟢Online Coefficient
          • 🌎Regional Bonus Coefficient
        • 📱【Mobile Phone】 Problem Self-Troubleshooting
    • 🤝Client - Try & Purchase Titan Network Resource
    • 🙌Invite Your Friends
    • 🆔Bind the identity code
  • Community Interaction
    • 🥳Community Airdrop Rewards
    • Volunteer Program
  • Branding Package
    • Titan Logo
  • ✅Herschel Testnet
    • ✅Herschel Testnet
      • 💾Apply to become an L1 Node for higher earnings
        • L1 Node Operation Tutorial
      • 💰Installation & Earnings
        • 🖥️How to run Titan on a Windows desktop
        • 🖥️How to run Titan on a MacOS desktop
        • 📱How to run Titan on Android
        • ⌨️Command-line installation
        • 💻Docker installation
        • 🤖CLI commands
      • 🥳KOL Promotion Plan
      • 🤝Invite
      • 🙌Community interaction
      • 🗣️FAQ
        • 🆔Bind the identity code
        • 📈Check the earnings
        • ⚖️Rules for obtaining node credits
          • 🪙The Basic Rewards
          • 👮POA Resource Rewards
            • 🔗Bandwidth Rewards
            • 🛜NAT Rating
            • 📶Number of Nodes Operating Under the Same IP
            • 💾Storage Rewards
          • 🟢Online Coefficient
          • 📈Introducing the Pioneer Multipliers Incentive Plan
          • 👩‍🏫Regional Reward Multipliers
        • 🔗Invite friends to Discord
  • ✅Huygens Testnet
    • ✅About Huygens Testnet
      • 💰Installation & Earnings
        • 🖥️Visualized program(recommended)
        • ⌨️</> Command-line installation
        • 🤖</>CLI commands
        • 🆔Bind the identity code
        • 📈Check the earnings
        • ⚖️Rules for obtaining node credits
          • 👨‍🏫Formula Definition
          • 🪙The Basic Rewards
          • 👮Resource rewards of POA
            • 🔗Upstream Bandwidth Rewards
            • 🛜NAT Rating
            • 💾Storage Rewards
          • 🟢Online Coefficient
          • 📈The Growth Factor of Network Stability
      • 🤝Invite
      • 🙌Community interaction
      • 🎫Airdrops exclusive to the Filecoin ecosystem
      • 🗣️FAQ
      • 🏅Claiming Rewards
Powered by GitBook
On this page
  • How to deploy WASM binary file on Titan Chain
  • Step 1: Prepare the WASM contract file
  • Step 2: Upload the WASM file to Titan Chain
  • Step 3: Instantiate the WASM contract
  • Step 4: Query the contract state
  • Step 5: Execute the contract
  1. Blockchain Test

Deploy WASM Smart Contract

How to deploy WASM binary file on Titan Chain

Note: This process require some advanced knowledge. This tutorial focuses on smart contract deployment using command line tool. You can explore other methods by yourself.

Step 1: Prepare the WASM contract file

  • Compile your WASM contract, and generate the binary with name <project_name>.wasm

Step 2: Upload the WASM file to Titan Chain

  • Execute the upload command:

titand tx wasm store <project_name>.wasm --from <account> --gas 10000000 --gas-prices 0.0025uttnt

<account> is your account name. Please replace it with your actual account name.

  • Check if the transaction is on chain and get the code id:

titand query tx <tx_hash>

<tx_hash> is the transaction hash generated from your upload, used for query the transaction status.

  • Or get the code id using the following command:

titand query wasm list-code

Using list-code command, you can view all uploaded contracts and their code id.

Step 3: Instantiate the WASM contract

  • Instantiate the contract:

titand tx wasm instantiate <code_id> <json_encoded_init_args> --admin="$(titand keys show <account> -a)" --from <account> --gas 10000000 --gas-prices 0.0025uttnt --label <label>

<code_id> is the code id you get in Step 2

<json_encoded_init_args>is the parameter required for contract initiation, which should be coded in JSON format.

<label> is the contract label

  • Check if the transaction is on chain and get the contract address:

titand query tx <tx_hash>

If successful, you can get the contract address for further operations.

Step 4: Query the contract state

  • Using the command to query cantract state:

titand query wasm contract-state smart <contract_address> <query_args>

<contract_address> is the contract address you get in Step 3.

<query_args> is the required parameter for the query, which should be coded in JSON format.

  • View contract state using Titan blockchain browser:

    • Key in the contract address in the browser and you can see the details and state of your contract.

Step 5: Execute the contract

  • Execute the contract call:

titand tx wasm execute <contract_address> <exec_args> --fees 500uttnt --from <account>

<exec_args> is the required parameter for contract execution, which should be coded in JSON format.

Hints:

  • <...> in every step should be replaced by your actual value

  • Check the parameters in the command carefully before execute each step to ensure correct deployment and operation of the contract.

PreviousStake on Titan ChainNextBug Reports / Feedbacks

Last updated 9 months ago

You can also use Titan blockchain browser to view your contract status:

🕹️
Titan Blockchain Browser