Tether (usdt) is a currency issued using Omni layer protocol. Omni layer protocol is a protocol based on bitcoin blockchain network, which is equivalent to adding some attributes to bitcoin transactions to expand currency categories. We can use Omni layer protocol to issue tokens based on bitcoin blockchain network, It is thought that usdt is based on bitcoin block network, so the basic process of docking wallet is roughly the same as that of bitcoin.
The overall docking process of Omni wallet is as follows:① Download and install Omni cores Wallet
② Configure wallet development environment
③ Get BTC on test network
④ Obtain Omni coins in the test network
1. Download and install Omni core Wallet
This demonstration is for Windows version. Except for different installation, the other docking processes of liunx version are the same:
Omni cores wallet download address: http://www.omnilayer.org/download.html
1-2 installation
(1) After downloading, click the EXE file to install. The installation options can be selected by default (pay attention to ensure that the hard disk capacity is more than 200g);
(2) After installation, click Run wallet (after opening the wallet, the wallet starts to synchronize the block)
2. Configure Omni wallet development environment
The wallet just installed is a linked official bitcoin network. We need to configure it into a test network and develop RPC debugging function;
2-1. Modify Omni wallet configuration file
(1) Find bitcoin The conf configuration file is under the folder of the installation directory data
Add the following parameters to the configuration file:
Regtest = 1 (stand-alone network) or testnet = 1 (connect test network)
server=1
rpcuser=duanpan
rpcpassword=duanpan916
rpcallowip=
43.249.137.***
rpcport=8332
txindex=1
datacarriersize=80
logtimestamps=1
omnidebug=tally
omnidebug=packets
omnidebug=pending
Parameter description (same as the parameters of special currency wallet year on year):
Testnet = 1 connect the bitcoin test network and regtest parameters. You can only open one of them at the same time.
Regtest: start the stand-alone test environment. 1 is on and 0 is off
Listen: enable listening mode. It is enabled by default
Server: 1 indicates that RPC instruction is accepted, and 0 does not
Rpcuser: the RPC user name used to access the wallet
Rpcpassword: the RPC password used to access the wallet
Rpcallowip: specifies which IPS can access the wallet through RPC
Rpcport: RPC access port
2-2. Save the configuration file and restart the wallet
Because Omni coins cannot be obtained for testing under the stand-alone network, only bitcoin testnet network can be connected to obtain test bitcoins and then Omni coins through bitcoins.
Configuration (specify user name, password and IP):
testnet=1
regtest=0
server=1
rpcuser=*********
rpcpassword=*********
rpcallowip=*********
rpcport=8332
txindex=1
datacarriersize=80
logtimestamps=1
omnidebug=tally
omnidebug=packets
omnidebug=pending
2-3. Test common instructions with command window
(1) Open the command window: click "help = > debugging window = > console" in the wallet interface
Common instruction API:
https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md
3. Get bitcoin of test network
You can get the website of testing network bitcoin:
http://bitcoinfaucet.uo1.net/send.php
Query and test the website of bitcoin transaction and block generation on the network:
https://testnet.blockexplorer.com
Other websites for bitcoin related knowledge:
https://bitcoin.org/en/bitcoin-for-developers
https://en.bitcoin.it/wiki/Main_Page
4. Obtain Omni coin of test network
The process is as follows:
1. Generate bitcoin address getnewaddress
2. Obtain bitcoin from the test network to the address generated in the first step
3. Send bitcoin to the moneyqman7uh8fqdca2bv5yz8qvrc9iklp address through sendfrom. For each BTC sent, 100 Omni and 100 tomni will be obtained.
4. Then wait for block confirmation, and the generated address passes Omni_ Getbalance gets the received testomni amount.
Pit encountered in docking
1. Unable to query usdt token with propertyid 31
Solution: officially synchronize the block data for a certain time, and the test network can only jointly debug the API interface through Omni coin
2. Regtest network failed to get Omni coins
Solution: it can only be obtained through testnet. See the third and fourth columns of the article for how to obtain Omni coins.
3. When sending a transaction, the BTC balance of the sending address is insufficient to pay the handling fee
Error with selected inputs for the send transaction, code = - 206)
Solution: transfer BTC to the address where Omni coins are sent.
4、omni_ Listtransaction failed to query historical transaction
It's the default end block number. The default value is 999999, but the actual block has already exceeded this number, so the transaction information can't be queried.
Solution: query with parameters, such as:
omni_ listtransactions muPuXyRqLBRf8Xyj28d2As8ya4iaw8XWGe 10 0 0 99999999