Setting the Solan ID from Scratch: Step-by-Step Guide
As a developer of the Sorana-Blockchain Building, you are likely to have come across the popularity of the Sorana-based cuffs. One such sign is Spl (Plasma), which is used for various applications, such as decentralized financial platforms and decentralized administrative systems. In this article, we walk through the Spl labeling process from scratch with the help of the Solan SDK.
Prerequisites
Make Sure Before You Start the Following:
At 1 o’clock. Solan Clli Installed On Your Machine
- Sorana node that uses the mainnet testnet application (we recommend “with the Sorana -Cl’I tool to interact with the node)
- Basic Information on Stability and Sana-Specific Concepts
Step 1: Clone Spl id storage
Create a New Archive for your Spl id By cloning the official Spl Mark Storage:
`Bash
git clony
`
This creates a new directory structure with the files and folders needed.
Step 2: Set the Development Environment
Create a new Sorana wallet with the “Sorana-Keygen” command. This produces your wallet with a json key pair.
`Bash
Solana-Keygen-Key-Size = 4096-Out Keypair.json-Wallet
`
This creates a wallet.json
file containing private and public keys.
Step 3: Set Sana Node
Update the Solana Node Configuration to use the “Sorana -ClTool to interact with the Local Block Chain. Create a New
Config.TomlFile ~/.solana/Cl/Config.Toml
Directory:
`Toml
[Cl]
Starypair = “path/wallet.key”
`
Replace the " path/ -/ wallet.key "on the actual path to the wallet -json file.
Step 4: Start and Turn Your ID
Create a new folder for your ID and start it with the following commands:
Bash
Mkdir -p characters/Spl -token
CD-tokens/Spl-token
Npm install the Solan Cla– Save-Dev
Npx solan-clli init spl-token
`
This creates a new “Spl -token” directory with a basic line -up.
Step 5: Create and Install Your ID
Create a New File Called Spl-Token.Sol
in the ‘Spl-Token’ Directory. This is the intelligent agreement of your Spl brand.
`Solidity
// Tokens/Spl-token/Spl-token.Sol
Pragman Solidity ^0.8.0;
Agreement for Spltoken {
mapping (address => uint256) public balances;
Function Deposit
Balance [_owner] += Amount;
}
Lifting Function
Require (balances [_owner]> = amount, “inadequate balance”);
Balance [_owner] -= Amount;
}
}
Function Vainower () Internal View Demanded Bywhip {
Require (msg.sender == address (_owner), “only the owner can call this Function”);
}
`
This agreement provides basic functions for historing and cancellation of spl centries.
Step 6: Turn and Install Your ID
Turn the Spl -token.Sol
File using the following command:
`Bash
Solc– in spl-token.sol -ilow-abi -r soana
`
This creates a new split -token.json
file containing a compiled contract byte code.
Take your ID to the Sorana Mainnet Testnet Application using the following commands:
`Bash
Npx for solan-clli use
-Chain-ID
-Contract-name Spl-token \
-Storage
-Ccounts Account1, Account2, Account3 \
-Gas 2000000 \
-Casa-Price 10 ether
`
Replace
Mainnet wrong with the actual public key.