Skip to main content

Setup Guide for ETH (ERC20) Token



Installation steps : 

Please follow all the steps by their order of appearance in this guide. If you get any error for any step and skip to the next, things will not work for you.

Install required dependencies

Install all the following dependencies. Without installing these, your marketmaker binary may crash and not work.


a) Linux

Install gcc-7.2 & g++-7.2 and symlink them as gcc & g++
The following are steps to install them in Ubuntu. If you are using Debian use echo "deb http://ftp.us.debian.org/debian testing main contrib non-free" | sudo tee /etc/apt/sources.list.d/forgcc.list to add the repository and continue from the sudo apt-get update command.

sudo add-apt-repository ppa:jonathonf/gcc-7.2
sudo apt-get update
sudo apt-get install gcc-7 g++-7
sudo rm /usr/bin/gcc && sudo rm /usr/bin/g++
sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc
sudo ln -s /usr/bin/g++-7 /usr/bin/g++


Install cmake 3.10.2

wget https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.sh
chmod +x cmake-3.10.2-Linux-x86_64.sh
sudo ./cmake-3.10.2-Linux-x86_64.sh --prefix=/usr

# OR on Ubuntu 16.04 you can use repository:
sudo add-apt-repository ppa:nschloe/cmake-nightly
sudo apt-get update
sudo apt install cmake

accept license when it ask "Do you want to include the subdirectory cmake-3.10.2-Linux-x86_64" choose NO


Install LevelDB

cd ~
git clone https://github.com/google/leveldb.git
cd leveldb
make  
sudo scp -r out-static/lib* out-shared/lib* /usr/local/lib/
cd include
sudo scp -r leveldb /usr/local/include/
sudo ldconfig



Delete local nanomsg from home directory

cd ~
rm -rf nanomsg





b) MacOS

To install latest cmake 3.10.2, gcc 7.3.0 and Leveldb 1.20.2

brew install cmake
brew install gcc
brew install leveldb

To upgrade to latest cmake 3.10.2, gcc 7.3.0 and Leveldb 1.20.2

brew upgrade cmake
brew upgrade gcc
brew ugprade leveldb

To check which version of cmake, gcc and leveldb

brew info cmake
brew info gcc
brew info leveldb

Copy the source repo and compile
Clone SuperNET repo and compile marketmaker for ETH swaps

cd ~
git clone https://github.com/jl777/SuperNET
cd ~/SuperNET
git checkout dev
git submodule update --init --recursive
mkdir build
cd build
cmake ..
cmake --build . --target marketmaker-mainnet
cmake --build . --target marketmaker-testnet
cd ~/SuperNET/build/iguana/exchanges/
strip marketmaker-mainnet
strip marketmaker-testnet


Copy marketmaker binary to iguana dir
The compiled marketmaker binary file can be found in ~/SuperNET/build/iguana/exchanges. Copy marketmaker into ~/SuperNET/iguana/ dir.




cp ~/SuperNET/build/iguana/exchanges/marketmaker-mainnet ~/SuperNET/iguana/marketmaker


Install barterDEX & preparation
Install, copy passphrase file from exchanges dir to dexscripts dir
The following command will install barterDEX and copy all the required API scripts in ~/SuperNET/iguana/dexscripts dir. You need to issue all the required API scripts (e.g.: client, run, orderbook, buy, sell, balance, stop,) from ~/SuperNET/iguana/dexscripts dir while running as normal after installation.

cd ~/SuperNET/iguana/exchanges
./install
cp passphrase ../dexscripts/passphrase
cd ~/SuperNET/iguana/dexscripts
nano passphrase

Enter a strong 24 words seed passphrase or WIF key or SHA256 of userpass or ETH private key in between "", save the file and close nano editor using CTRL+X then Y then ENTER.

Edit the client script
You need to edit the client or run script to disable git pull & ./m_mm commands. Otherwise, the commands will compile the marketmaker for non ETH/ERC20 token swap. After the changes, the file should look like similar to the following:

#!/bin/bash
source passphrase
source coins
./stop
#git pull;
cd ..; 
#./m_mm;
pkill -15 marketmaker; 
./marketmaker "{\"gui\":\"nogui\",\"client\":1, \"userhome\":\"/${HOME#"/"}\", \"passphrase\":\"$passphrase\", \"coins\":$coins}" &


Run marketmaker using client script for the first time to get the userpass value


./client &
./setpassphrase


This should display the userpass value and your smartaddresses in console. Make a note of the userpass. Stop maketmaker using the following command before proceeding to the next step.

pkill -15 marketmaker

The above command should always be used to stop marketmaker binary.



Copy the userpass file from exchanges dir to dexscripts dir and enter userpass value


cd ~/SuperNET/iguana/exhanges
cp userpass ../dexscripts/userpass
cd ~/SuperNET/iguana/dexscripts
nano userpass

Enter the passphrase we got earlier in between "", save the file and close nano editor using CTRL+X then Y then ENTER. All these scripts found in ~/SuperNET/iguana/dexscripts are expecting a userpass file, which contains the definition of the $userpass variable (found inside scripts) to authenticate API access. This avoids evil webpages that try to issue port 7783 calls to steal your money.


Edit coins file to add DEC8 & JST token
Edit the coins file in dexscripts dir and add the following lines for adding DEC8 & JST ERC20 test tokens. Without these, you will not be able to add these coins and use them.



{\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"JST\",\"name\":\"JST\",\"etomic\":\"0x996a8ae0304680f6a69b8a9d7c6e37d65ab5ab56\",\"rpcport\":80}, {\"coin\":\"DEC8\",\"name\":\"DEC8\",\"etomic\":\"0x3ab100442484dc2414aa75b2952a0a6f03f8abfd\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80},



Run ETOMIC

You need to have ETOMIC running in native mode or electrum mode and KMD or other coins either running native or electrum (native is faster). If running native mode, make sure you have blockchain synced and seed passphrase / WIF key / private key imported into the chain.

For ETOMIC you need to have utxos. You can get free BEER from this faucet and swap it for ETOMIC in normal BarterDEX. You also need to have ETH testnet coins as long as we are testing testnet. Use main-net ETH when testing main-net. If you are unsure which net to use, ask in Slack.

cd ~/SuperNET/iguana/dexscripts
./client &
./setpassphrase

Then, we need to enable ETH and other coins/tokens to start trading. Check the following example script:

Example enable script:


#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"BEER\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETOMIC\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"DEC8\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"JST\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\"}"






Comments

Popular posts from this blog

How to setup eth server for PEATIO EXCHANGE

What do you need? An instance with 4G of ram at least 100 G of hard disk Ubuntu 16.04   Install geth sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum Run geth copy the geth service file to /etc/systemd/system/geth.service sudo systemctl start geth sudo systemctl enable geth Install Nginx + fcgi sudo apt install nginx -y fcgiwrap copy default file to /etc/nginx/sites-enabled/default sudo systemctl restart nginx cgi files copy the cgi files to /var/www/html/cgi-bin and update total.cgi with your username sudo chown www-data:www-data -R /var/www/html/cgi-bin sudo chmod +x /var/www/html/cgi-bin/* Install filter service copy total.js to /var/www sudo chown www-data:www-data /var/www/total.js don't forget to edit service.rb with your url sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libr...

Tether(USDT) Installation | Command-line Tutorial

What is USDT Tether’s Omni layer constructed by bitcoin block network. On this overlay network, all parties can issue token, tether company. Token, codenamed USDT, was issued on Omni layer, anchoring in US$1:1. Tether’s idea is very simple. You give me the dollar and give me one dollar. I issue 1 USDT. The dollar is deposited in the designated asset account. Everyone can inquire about it. The total amount of USDT issued can also be inquired on the block. When converting, give me 1 USDT and I return 1 dollar. Omni(USDT) Wallet installation 1.Download Omni Layer Wallet    wget https://bintray.com/artifact/download/omni/OmniBinaries/omnicore-0.3.0-x86_64-linux-gnu.tar.gz ux-gn 2.Decompress & Run    tar - xzvf omnicore - 0.3 . 0 - x86_64 - linux - gnu . tar . gz Now, copy Dependent library to Local sudo CP omnicore-0.3.0/lib/*/lib Open the wallet directory cd omnicore-0.3.0/bin ./omnicored Initial star...

Market Research, Financial Insights, Technology Trends, and Consumer Analytics

This list covers market research, financial insights, technology trends, and consumer analytics . 🔹 General Market Research & Industry Reports   1. Market Research Future - https://www.marketresearchfuture.com/   2. Allied Market Research - https://www.alliedmarketresearch.com/   3. Mordor Intelligence - https://www.mordorintelligence.com/   4. Grand Vie w Research - https://www.grandviewresearch.com/   5. Research and Markets - https://www.researchandmarkets.com/   6. IBISWorld - https://www.ibisworld.com/   7. Statista - https://www.statista.com/   8. Fact.MR - https://www.factmr.com/   9. Transparency Market Research -https://www.transparencymarketresearch.com/   10. Global Market Insights - https://www.gminsights.com/   🔹 Technology & Innovation Research    11. Technavio - https://www.technavio.com/   12. Forrester Research - https://www.forrest...