This is a story about collaborating on the Open Food Chain, an open-source blockchain integration that began on the Notary Network of Komodo. The Notary Nodes checkpoint the Komodo blockchain and all Komodo Smart Chains into bitcoin's ledger. After 2 seasons, the Komodo Pioneers v1 had split into season 5 Komodo Pioneers v2 & Mylo. However, there was a lot of friendly collaboration on funding meetups in pre-covid times. Bart from the pioneers would host blockchain enthusiasts in The Netherlands. Mylo would look after successful Komodo Pioneers nodes.

Six months after splitting, Bart asked Mylo if he'd be interested in a "proof of concept 3-month project or something". Mylo was quite excited about working on a non-fintech application of the technology we all built at Komodo stemming from the brilliant work of jl777.

Partners

The New Fork was already in the blockchain game, albeit with Hyperledger consulting - but what they really needed for the food & agriculture industries was a true p2p offering of their own, where supply chain partners could rely on the technology without needing to trust a third party with shared data. Enter a Komodo Smart Chain!

The stakeholders for this project began with the aggregate of multi-billion dollar companies and associations:
* Refresco, with their press release
* Austria Juice
* Eckes Granini
* IDH, The Sustainable Trade Initiative, with their press release
* Dozens of news aggregation sites like fruit-processing

Refresco JuicyChain sustainability quote

Technology

We were working on Apple Juice.

After 6 months of long hours and hard work, and as at writing, we are within a week of the "soft launch" of the project running on Google Cloud Platform Kubernetes infrastructure. We are also within a week of the 2021 Season 5 Notary Node elections finishing!

Our small team beat IBM at implementing a p2p solution for global agriculture. Parts of the solution include:
* Running full nodes
* Running explorers
* Using KV storage for decentralized address book
* Managing offline wallets
* Signing offline transactions with electrumx client library
* No transaction fees

These tech solutions will be expanded upon further using the open food chain source code throughout our collaboration & beyond. On behalf of Bart from the Komodo Pioneers and Mylo from iKomodo.com & KomoDeFi.com, we'd like to thank the Komodo user & development community for enabling us to begin collaboration with meetups. This effort would not have been possible without the innovation of checkpoint blockchain security with the Notary Nodes and with the support of community voting to enable us to work on our Komodo co-creations.

Voting

Mylo (Southern Hemisphere) RARdqVRm3RWvii2kCWZBSteqqZQs7PsVj9

AND

Komodo Pioneers (Bart/Bart/Audo) RLDs9ZTtzAQy8Y7eoMht7oMFuciECiqCEi

This post is about the resources required to handle some network users during a live cryptocurrency decentralized exchange test run with genuine users in the wild. The machine operator goes by the discord name cipi & has contributed some monitoring screenshots on network bandwidth, cpu loads & number of connected clients to the SPV infrastructure. To try out some komodo smart chain technology with electrum server, read the tutorial and fire up your own docker image with the blockchain dev kit.

AtomicDEX Stress Test Weekend Event

The stress test event took place on December 12 & 13, 2020. 53 unique addresses achieved more than 1000 swaps each, with the top 5 addresses combining for 90,000 cross chain atomic swaps. The total number of atomic swaps was >200,000 in one weekend.

Dashboard from the https://stresstest.atomicdex.io/dashboard page

SPV Electrum Server Infrastructure

Cipi has stated in discord that the Electrumx server infrastructure used dedicated servers. The clients connected to 3 separate servers. The servers were hosting Bitcoin, Litecoin, Komodo, and the parity Ethereum & ERC20 stuff.

Server Hardware

AMD EPYC 7502P, 384 GB RAM, 3x NVME SSDs in a RAID 0 configuration.

Number of Client Connections

On one of the servers, the maximum number of clients connected at the same time was 444 on the Komodo blockchain.

electrum server connection count

One of the test coins used for distributing to the public is called RICK. This enabled the marketmakers to create an order to sell KMD for these freely distributed RICK coins, thus rewarding testers! The peak maximum number of simultaneous connections on this same server for RICK coin was 398.

electrum server connection count 2

CPU Load

The hardware of each server has 64 threads and 384GB of RAM. They are beasts. The machines ran with minimum load, despite being able to handle approximately 400 concurrent users, sync 5+ blockchains.

electrum server load cpu idle time
Very idle with this event taking place, plenty of room to grow
electrum server load cpu load average
Ignore the yellow line cipi said, that is for his own record keeping

Bandwidth

Bandwidth consumption is often more of a metric to be aware of when hosting multiple blockchains, especially when the number of new full node clients connecting want to sync. Rackspace comes with generally 5TB of data allowance. For lite clients, which this electrum server infrastructure is used mainly for. Looks like a constant 3Mb/s in requests and 6Mb/s in responses is required for hosting 500+ clients including syncing full node chains not used in the stress test.

electrum server load bandwidth

Conclusion

These are ball park stats and no meaningful analysis can be made except the potential to host magnitude more clients is possible with this single server. To host many magnitudes more, simply making geo-DNS queries available to users software and running more servers will work.

Thank you cipi for providing these graphs.

This howto is for using a blockchain dev kit using Komodo, electrumx & atomicDEX. Using 3 existing containers and small mods, you can have HELLOWORLD trading with your team in less than one hour. Improvements to this to totally automate it are in the works to make a turnkey blockchain dev kit.

Our smart chain created and ready to trade on atomicDEX after using the blockchain dev kit
The HELLOWORLD smart chain ready to trade for some MORTY test coins on the atomicDEX network. Why not for BTC or alts!

End To End Blockchain Development Using The Dev Kit

If you are on linux simply download and run the following commmands. It will download 1GB of cryptography stuff.

wget https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params.sh
chmod +x fetch-params.sh
./fetch-params.sh

Download the containers for this particular tutorial. You will need zcash params installed on your machine.

  1. docker pull coingateways/blockchain-starter-kit:5000f2a.3
  2. docker pull coingateways/atomicdexorderbook:0.9.2
  3. docker pull lukechilds/electrumx:v1.15.0

Blockchain Dev Kit

I made a video on the blockchain dev kit in 2019. The current simplified version is similar. Watch from the 2:50 mark for what it does.

Video of the blockchain dev kit in action
Video from 2019 of the blockchain dev kit during testing

To start this container, after having the zcash-params installed type:

docker run -i -t -v /home/${USER}/.zcash-params:/root/.zcash-params:ro --name bdk -p 127.0.0.1:8096:8096 coingateways/blockchain-starter-kit:5000f2a.3

It will drop you into a bash, and you will want to change to the /komodo-in-a-box directory to execute setup/start.sh

cd /komodo-in-a-box ; setup/start.sh

cat ~/.komodo/HELLOWORLD/HELLOWORLD.conf  
rpcuser=user4130001545
rpcpassword=pass26cc5f967a6c9e7c7dd35675429b5f6257f5b7f1a87a7f762bd4fba3553401075e
rpcport=8096
server=1
txindex=1
rpcworkqueue=256
rpcallowip=127.0.0.1
rpcallowip=172.17.0.1
rpcallowip=172.17.0.2
rpcallowip=172.17.0.3
rpcallowip=172.17.0.4
rpcallowip=172.17.0.5
rpcallowip=172.17.0.6

You will need the rpcuser & rpcpassword for the electrumx container!

Start the bdk console again with the command above cd /komodo-in-a-box ; setup/start.sh. And follow the prompts to create a mining node, but don't start mining yet. Let's get the rest of it setup.

Lite Wallet Coin Infrastructure With ElectrumX

This docker container comes from Luke Childs who used to be an Komodo notary node operator and the hyperDEX lead dev. We want to connect electrumx to the seed node. We need to know the IP address of the BDK (blockchain dev kit) container. From your workstation, issue docker inspect bdk | grep -i ipaddress

docker inspect bdk | grep -i ipaddress
           "SecondaryIPAddresses": null,
           "IPAddress": "172.17.0.4",
                   "IPAddress": "172.17.0.4",

I have other containers, running so my BDK for this writing is at 172.17.0.4. I'm using this address to start electrumx with this command. I'm also using the rpcuser & rpcpassword and rpcport from my HELLOWORLD.conf file above.

docker run -e DAEMON_URL=http://user4130001545:pass26cc5f967a6c9e7c7dd35675429b5f6257f5b7f1a87a7f762bd4fba3553401075e@172.17.0.4:8096 -e COIN=Komodo -p 50002:50002 -p 50001:50001 -p 8008:8000 --name electrumx lukechilds/electrumx
Generating a RSA private key
.......................................................+++++
.............+++++
writing new private key to '/data/electrumx.key'
-----
INFO:electrumx:ElectrumX server starting
INFO:electrumx:logging level: INFO
INFO:Controller:Python version: 3.7.7 (default, May 20 2020, 21:33:25)  [GCC 9.2.0]
INFO:Controller:software version: ElectrumX 1.15.0
INFO:Controller:aiorpcX version: 0.18.4
INFO:Controller:supported protocol versions: 1.4-1.4.2
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 800 blocks
INFO:Daemon:daemon #1 at 172.17.0.4:8096/ (current)
INFO:DB:switching current directory to /data
INFO:DB:using leveldb for DB backend
INFO:DB:created new database
INFO:DB:creating metadata directory
INFO:DB:UTXO DB version: 8
INFO:DB:coin: Komodo
INFO:DB:network: mainnet

Great! Electrum is up.

AtomicDEX Lite Wallet & P2P Orderbook Trading

The orderbook app for atomicDEX already has a tutorial, but we need to add our HELLOWORLD coin, this requires one command in reality, but for this tutorial let's kill everything the container starts. First we need to know some info.

  1. The IP address of our lite wallet infrastructure so the atomicDEX wallet can connect needs to be known
  2. Tell marketmaker to use HELLOWORLD infrastructure

Again turning to our workstation, we need to issue the same docker inspect command but for the electrumx container.

docker inspect electrumx | grep -i ipaddress
           "SecondaryIPAddresses": null,
           "IPAddress": "172.17.0.5",
                   "IPAddress": "172.17.0.5",

The orderbook container needs starting and it will automatically start everything, we just need to enable HELLOWORLD with curl.

docker run -i -t -p 127.0.0.1:7780:7780 -p 127.0.0.1:8001:8001 -e MMBOT_URL="http://localhost:7780" -e ME_PUBLIC="false" -e ME_PRIVATE="true" --name orderbook coingateways/atomicdexorderbook:0.9.2

Let's enable HELLOWORLD!

source /usr/local/bin/userpass.txt ; curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"HELLOWORLD\",\"servers\":[{\"url\":\"172.17.0.5:50001\"}], \"mm2\": 1}"

Send coins from mining node to browser wallet

Jump back into the container running the blockchain dev kit at the start. You will need to go to the mining node and start mining. Follow the menus for HELLOWORLD mining node. Spin one up, start mining. Go into the wallet menu and import the dev wallet. You will have 1000 coins to send to your lite wallet in the orderbook app.

Experience Crypto
© 2021 komodefi.com. Powered by Komodefi