<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by TechupBusiness on Medium]]></title>
        <description><![CDATA[Stories by TechupBusiness on Medium]]></description>
        <link>https://medium.com/@mindup?source=rss-3b6a3357d126------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CA-lcAHmUEr9Ec2B5srZ8w.png</url>
            <title>Stories by TechupBusiness on Medium</title>
            <link>https://medium.com/@mindup?source=rss-3b6a3357d126------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:59:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mindup/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enable GIT rerere for easy merging]]></title>
            <link>https://mindup.medium.com/enable-git-rerere-for-easy-merging-303c6f2dacd3?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/303c6f2dacd3</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Fri, 15 Feb 2019 15:48:21 GMT</pubDate>
            <atom:updated>2019-04-05T10:11:20.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>Avoid to solve multiple times the same conflict on rebase with GIT</h3><p><em>This unknown configuration allows to record and reuse previous conflict solutions. It’s a time saver when working with rebase and merge conflicts in GIT.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0j3tg8YAqewFtQLH" /><figcaption>Photo by <a href="https://unsplash.com/@vision?utm_source=medium&amp;utm_medium=referral">vision webagency</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a> (Partner of <a href="http://ost.com/">ost.com</a>)</figcaption></figure><p><strong>tl;dr:</strong> Execute git config --global rerere.enabled 1 to avoid repetitive manual merging.</p><p>So what is doing <strong>git rerere</strong> exactly? It stands for <strong>re</strong>use <strong>re</strong>corded <strong>re</strong>solution and is a configuration parameter that enables git to record your merge/rebase resolution of all conflicts and to automatically apply these records if the same conflict appears again.</p><p>But how can the same conflict happens more than once? When you just use <strong>merge</strong> commits this may occur just sporadically, when you create a merge commit and then revert it for some reasons.</p><p>But if you use <strong>rebase</strong> (highly recommended!) to get rid of all conflicts before merging your branches into master, you will sometimes run into the problem, that you need to solve the same conflict again and again. But why?</p><p>This is becausegit rebase merges<em> commit after commit </em>of your source branch on top of the target branch. Whilegit merge is doing <em>internally two “commits”</em>, one with the entire set of changes of all commits as one single operation (no squashing), the other is the merge commit to solve the difference of the first operation set to the target branch.</p><p>You could also manually execute git rerere every time after resolving a conflict and before doing the commit. But the easier way is to run and forget:</p><pre>&gt; git config --global rerere.enabled 1</pre><p>Happy rebasing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=303c6f2dacd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running GUI apps securely in docker (sandbox)]]></title>
            <link>https://mindup.medium.com/running-gui-apps-securely-in-docker-sandbox-5d945288929b?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d945288929b</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[sandbox]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[gui]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 18:52:28 GMT</pubDate>
            <atom:updated>2019-02-14T22:14:42.772Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Docker is a fantastic tool when it comes to testing and running of command-line applications or whole new technologies. But when you need to run a GUI within the container, you’re stuck. Fortunately there are multiple solutions to address this issue. This article covers a quick tutorial to run GUI based Linux applications in docker, turning docker into a proper (but not 100% safe) sandbox.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NhqgMOtzVZ2npkbX" /><figcaption>Photo by <a href="https://unsplash.com/@flik185?utm_source=medium&amp;utm_medium=referral">Simone Viani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a> (Partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><h3>The right approach</h3><p>There are two options to transport the GUI data within docker to a client of your choice:</p><ol><li>Using <a href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC</a>, a platform independent graphical desktop-sharing system. This option is useful for docker hosts without graphical user-interface (most Linux servers, like VPS or dedicated servers) OR if you use docker on operating systems without X server implementation. It is the most flexible and encapsulated option.</li><li>Using <a href="https://en.wikipedia.org/wiki/X_Window_System">X server</a>, a windowing system for bitmap displays (common on Unix-based operating systems). This can be a very lean and elegant solution, as it is sharing the hosts GUI with the container’s OS.</li></ol><p>Please be always aware that docker is not a perfect sandbox environment! If a program is designed to break out of a docker image and harm your host, there is an existing risk that this can be successful. But fortunately most (suspicious) applications are not designed (yet) to do this. Anyway, I would not recommend to watch trojans and viruses in docker containers. Just in case….</p><h3>Prerequisite</h3><p>First you need a host, <a href="https://docs.docker.com/install/">having docker installed</a>. Then, for option 1, make sure that you have <a href="https://docs.docker.com/compose/install/">docker-compose installed</a>, which simplifies your docker life drastically.</p><h3>Option 1: VNC — Flexible and secure on any host</h3><p><em>This chapter explains the sandbox-setup using the first option “VNC”. Technically we are running a linux with desktop in docker and a VNC server, to connect with a VNC client to the server. This will work on ANY host operating system and offers a “strong” sandbox, which is theoretically more secure than a shared Xserver.</em></p><p>First create a new file calleddocker-compose.yml . Then paste the following content (and replace all &lt;I-AM-A-PASSWORD&gt; placeholder with your password) in it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f83a81294178796360dd108832e07426/href">https://medium.com/media/f83a81294178796360dd108832e07426/href</a></iframe><p>You can find more environment parameters on the projects’ <a href="https://github.com/fcwu/docker-ubuntu-vnc-desktop">github repository</a>. We will use the <a href="https://lxqt.org/">Lightweight Qt Desktop Environment</a> for our sandbox even though it is visually way less attractive than the standard gnome desktop. If you don’t care that much about hardware resources, simply remove -lxqt at the end of image version in dorowu/ubuntu-desktop-lxde-vnc:bionic-lxqt to enjoy the default Ubuntu gnome desktop.</p><p>Next step is to start the container. Type in your shell (you should be in the folder where the docker-compose.yml resides)</p><pre>&gt; docker-compose up -d</pre><p>After the creation of the container, when it is up and running, you can start your VNC client to connect to your new instance (remember, you previously configured the password in docker-compose.yml as VNC_PASSWORD ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*z6XhIEWZgp-f90IpoJ72gA.png" /><figcaption>Remmina: a VNC client on ubuntu to connect to our docker sandbox</figcaption></figure><p>Now you should see your running sandbox desktop:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*yLtojqQhgBsGp-gbH41SyQ.png" /><figcaption>Sandbox for ubuntu using <a href="https://lxqt.org/">Lightweight Qt Desktop Environment</a></figcaption></figure><p>For some reasons chromium (a browser) does not work. Instead you need to use the pre-installed Firefox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*qHJ7V90b2xCwoMnL02hTGw.png" /></figure><h4><strong>IMPORTANT</strong></h4><p>Each time you delete your sandbox’s docker-container or when you change docker-compose.yml which triggers a recreation of the container, all your changes (apps, downloads, …) in your sandbox are lost! To keep important data, you must save it in /home/sandbox/shared, which is the only folder that is synced to your host and therefore persistent. For your host’s safety make sure not to save a harmful script in this folder.</p><h3>Option 2: X server — Lean and integrated on hosts with GUI</h3><p><em>This chapter explains the sandbox-setup using the second option “X server”. Here we are sharing the x server between our host and its containers to save hardware resources. As an extra security layer, to prevent malicious applications from accessing our host system and input, we will run an x server additional to our main GUI server.</em></p><p>The open-source project <a href="https://github.com/mviereck/x11docker">x11docker</a> is in the end just a complex bash-script, which makes it easy to safely apply this special concept on docker. It would also support a VNC server approach. The main disadvantage of x11docker is, that it requires an additional workflow in comparison to a “standard-docker-architecture”. This prevents the use of docker-compose and is therefore harder to version control. It works for Linux (ideal) and Windows as well (with some limitations). As MacOS is not supported, please check the previous chapter of VNC as the way to go.</p><p>The fastest option to “<a href="https://github.com/mviereck/x11docker#installation">install</a>” it for the first time, is to execute in the shell:</p><pre>&gt; curl -fsSL https://raw.githubusercontent.com/mviereck/x11docker/master/x11docker | sudo bash -s -- --update </pre><p>Afterwards it is self-update-able by typing:</p><pre>&gt; sudo x11docker --update</pre><p>To run the first sandbox (supporting also some windows applications using wine) we <strong>could</strong> run:</p><pre>&gt; x11docker --desktop x11docker/lxde-wine</pre><p><strong>IMPORTANT</strong>: To share some files between host and sandbox, x11docker can mount the home directory in the sandbox to the hosts home directory in ~/.local/share/x11docker/&lt;IMAGENAME&gt; by adding the parameter --home. All other changes in the sandbox will be lost when the docker-container is getting deleted.</p><pre>&gt; x11docker --desktop --home x11docker/lxde-wine</pre><p>There are plenty of other options when running an image. The documentation page with all optional features, parameters and examples for an advanced usage can be found <a href="https://github.com/mviereck/x11docker">here</a>.</p><h4><strong>Prepared sandbox</strong></h4><p>If you want to install some applications right away from the start, you can create your own docker image. Open a new file Dockerfile and add your command after a RUN prefix, like in the following example:</p><pre><strong>FROM x11docker/lxde-wine</strong><br>RUN apt-get update<br>RUN apt-get install -y vlc</pre><p>To use this new docker image with x11docker, you need to build and tag it, to easily run it by its name. Execute in the same folder where you placed the previous Dockerfile (replace &lt;MY-NAME&gt; with your desired image-name):</p><pre>&gt; docker build -t &lt;MY-NAME&gt; .</pre><p>Now simply run your modified sandbox-image by executing:</p><pre>&gt; x11docker --desktop --home &lt;MY-NAME&gt;</pre><p>That’s it. Now you can enjoy a better integrated docker-based sandbox. If you want to have a more native feeling and don’t care that much about security (e.g. when you trust the sandbox’ed applications) you can check out <a href="https://github.com/mviereck/x11docker#desktop-or-seamless-mode">this chapter in x11docker documentation</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d945288929b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free Crypto Portfolio Tracker based on Google Sheets]]></title>
            <link>https://mindup.medium.com/free-crypto-portfolio-tracker-based-on-google-sheets-ef76070ec325?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef76070ec325</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Mon, 07 Jan 2019 21:49:09 GMT</pubDate>
            <atom:updated>2022-05-12T09:49:20.842Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bToyW2cfQOFOeJ-6vQM-uA.png" /><figcaption>Trades overview</figcaption></figure><p><strong>tl;dr…</strong> It retrieves fiat values (USD, EUR, …) automatically and generates reports, while giving you all flexibility of sheets that you need. For free. Check out a great fork which is <a href="https://docs.google.com/spreadsheets/d/1XtHY5pR4iVSAcTWN5QWn8-WTHEoQ2ALDIKXaPSvhQS8">maintained here</a>! Or Download my old discontinued version <a href="https://docs.google.com/spreadsheets/d/1bdyUft3gziDUUA1mScCsXx9Ih47rcRTDJN-bcp47fzw">here</a>. Please share this article if you like the tracker.</p><blockquote><strong>DEVELOPMENT DISCONTINUED! Version 2 is cancelled.<br>See </strong><a href="https://docs.google.com/spreadsheets/d/1XtHY5pR4iVSAcTWN5QWn8-WTHEoQ2ALDIKXaPSvhQS8"><strong>this fork instead</strong></a><strong>.</strong></blockquote><blockquote><strong>Current version: 1.0.2 (released 12.03.2020)<br>Follow on </strong><a href="https://twitter.com/MindupLife"><strong>Twitter</strong></a><strong> for updates, tips and appreciation.</strong></blockquote><h3>Intro</h3><p>There are endless (crypto) portfolio tracker to manage trades and portfolio. Some of them are only available as mobile app, others as Web application. Some require to enter trades manually, others can import them ,often requiring an API key and paying a good amount of money.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2HzYUnip4_awebnrfor2w.png" /><figcaption>Dashboard (since v1.0.2)</figcaption></figure><p>When you start using the automatic import functionality of these portfolio tracker, you can track your trades easily as long as they aren’t complex trades. However if you participate in ICOs, have your own wallets or use smart contracts, the automatic import doesn’t work any longer. So far, existing portfolio trackers can’t import or calculate these transactions automatically, a lot of the imported transactions need to be corrected or otherwise lead to false data.</p><p>I personally prefer the flexibility that data analysis provides. The manual data check, which happens during the import/export procedure, is especially useful in spotting false data. In order to avoid adding a lot of trades manually or giving my API keys to random services, I decided to create my own crypto tracker based on Google Sheets. This allows to modify and analyse the data with pivots, graphs, formulas and Javascript to suit the traders needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ik9f1NXi1075BYfEqM2vTA.png" /><figcaption>Overview of the Crypto Trackers “Trades” sheet</figcaption></figure><h4>Features</h4><ul><li>Dashboard-View</li><li>Stores unlimited transactions (trades, withdrawals, …)</li><li>Retrieves automatically the fiat value for crypto currencies (historical and current)</li><li>Creates a coin performance report (including the average cost and the current value of all assets)</li><li>Creates a coin location report of your accounts and wallets</li><li>Creates a profit / loss report (based on the invested fiat); so you know how much is left of your hard earned money</li><li>Stores most fixed values in adjustable settings (e.g. main fiat currency, proxy url)</li><li>Allows to define aliases which maps your currency code to the one used by the market-data service (to retrieve the correct price e.g. XBT for BTC)</li><li>Allows to define default fallback exchange rates for coins that are not listed yet (for example of your ICOs). After listing on the market-data service, it will retrieve the current price instead.</li></ul><h4>Advantages</h4><ul><li>Additional import helper available (Bitstamp, Coinbase Pro/GDAX, Binance).<a href="https://docs.google.com/spreadsheets/d/1_N74DXHHTVxcH08Tx_sHiz-2xUxB_qIqfF17x1y8kFE/edit?usp=sharing"> Download here</a>.</li><li>Use of all Excel-like functionality within your portfolio and reports (e.g. filter, visualizations, pivot tables, …)</li><li>Data is stored on your drive only, nobody else has access to it</li><li>Open source (you can dive in the source-code and change it)</li><li>Faster to enter manually than using entry masks (also easy to copy&amp;paste)</li><li>Take advantage of all other existing extensions for Google Sheets</li><li>Import of any data for transforming (e.g. CSV import, intelligent paste functionality of Google Docs, …)</li><li>Freedom to change anything according your needs (add new columns, change the code, use search &amp; replace, …)</li><li>Create snapshots/backups by simply duplicate the Google Sheets file</li><li>Copy&amp;paste compatible with lots of applications</li><li>Possibility to change the fiat value for each transaction/trade individually</li></ul><h3>How to use</h3><ol><li><strong>Save </strong>the<a href="https://docs.google.com/spreadsheets/d/1bdyUft3gziDUUA1mScCsXx9Ih47rcRTDJN-bcp47fzw/edit?usp=sharing"> Free Crypto Portfolio Tracker</a> to your drive (you need a Google account to download the Google Sheet to your personal Google Drive)<br><strong><em>UPDATE</em></strong>: Better download <a href="https://docs.google.com/spreadsheets/d/1XtHY5pR4iVSAcTWN5QWn8-WTHEoQ2ALDIKXaPSvhQS8">this fork</a> (actively maintained)</li><li><strong>Open </strong>it (you will see some demo data that should be deleted before starting with your own data)</li><li><strong>API Key</strong>: Get a free <a href="https://www.cryptocompare.com/cryptopian/api-keys">CryptoCompare API key</a> (see <a href="https://min-api.cryptocompare.com/pricing">here</a>) and store it in your sheet in <em>Settings &gt; API KEY: CryptoCompare</em> (same column as “USD”!).</li><li><strong>Authorize the script</strong> component “CryptoHelper”. Simply click on <em>Cryptocurrency &gt; Add fiat rates </em>in the menu, which triggers the script functionality, then follow the instructions to allow the execution of the embedded script (you can review and edit the source code any time). <br><em>Note:</em> Don’t panic if you receive a notification email by Google, letting you know that CryptoHelper got access to your account. Google is taking security notifications very serious, nobody except yourself has access to your data!</li><li><strong>Retrieve fiat values: </strong>Click in the menu on <em>Cryptocurrency &gt; Add fiat rates </em>and confirm the dialog to fill the gray columns for fiat values in your <em>Trades</em> sheet.</li><li><strong>Generate standard reports</strong>: After retrieving the fiat values of all your trades (<em>Add fiat rates</em>) and setting the sort order to “Date Z-A”, click on <em>Cryptocurrency &gt; Update portfolio value.</em></li><li><a href="https://twitter.com/MindupLife"><strong>Follow on Twitter</strong></a><strong> </strong>for updates and tips (and show your appreciation) and feel free to share your experience.</li></ol><h4>Important</h4><ul><li>Don’t delete the default sheets or change their names, but you can add your own ones</li><li>Don’t modify the reports (sheets with a lock symbol), they will be overwritten each time you generate them</li><li>Always sort the <em>Trades </em>sheet by “Date Z-A” before generating reports!</li></ul><h3>Trades sheet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*AXdoV9w0NmPiyCaaj56t3A.png" /><figcaption>If you select some rows, you are able to create/insert multiple empty entries</figcaption></figure><p>You need to enter/paste all your trades in this sheet. It is suggested to create new trades on top, as you need to sort them “newest first” (Date Z-A), before generating the reports. To add new entries on top, simply right click on the row number and select “Insert 1 above”. If you select multiple rows, you can insert more than one new row at the same time, which is important to paste values (=new trades). If you add columns this way, all formatting and data validation (=dropdowns) will be inserted, too. You only need to copy the formulas for the columns <em>Exchange </em>and <em>Wallet </em>manually. See the Binance import example (chapter “Best practice with example Binance”) below for more information.<br><em>Just a technical note: Using an array formula to avoid copying the formula manually resulted in poor performance.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*CGy-ZtFdUJ5q4SRZmtZfzg.png" /><figcaption><strong>Tip</strong>: <strong>Use format painter</strong> to keep your sheet in an easily readable layout (e.g. decimal precision and date format)</figcaption></figure><h4>Columns</h4><ul><li><strong>Date</strong>: Google Sheets recognizes lot’s of different date formats, you may want to use the format painter to display all dates in the same format.</li><li><strong>Type</strong>: The type of your transaction. The existing types are described further down in this article.</li><li><strong>Buy</strong>: Amount that you bought</li><li><strong>Currency (buy)</strong>: Currency that you bought (USD, BTC, …)</li><li><strong>Fiat value (buy): </strong>Fiat value of the bought amount at the transaction day. Filled automatically.</li><li><strong>Sell</strong>: Amount that you sold</li><li><strong>Currency (sell)</strong>: Currency that you sold (USD, BTC, …)</li><li><strong>Fiat value (sell)</strong>: Fiat value of the sold amount at the transaction day. Filled automatically.</li><li><strong>Fee:</strong> Amount of fee</li><li><strong>Currency (fee): </strong>Currency of fee (USD, BTC, …)</li><li><strong>Fiat value (fee): </strong>Fiat value of the fee amount at the day of transaction. Filled automatically.</li><li><strong>Exchange: “</strong>Read-Only” field (contains a formula to show the exchange/technology of the account that you select)</li><li><strong>Wallet</strong>: “Read-Only” field (contains a formula to show the wallet of the account you select)</li><li><strong>Account</strong>: The account which the transaction belongs to (needs to be specified in <em>Account Settings</em> sheet). Will cause filling <em>Exchange </em>and <em>Wallet</em>-column automatically (if you copy the formula).</li><li><strong>Transfer code:</strong> Here you can store the transaction hash, if available. So you can later easily check/confirm the trades.</li><li><strong>Comment</strong>: Here you can enter any information. It’s good practice to comment some special trades or “workaround-trades”.</li></ul><h4><strong>Types</strong></h4><p>Types are colored automatically using conditional formatting. They can be maintained in the <em>Settings</em> sheet. You can add your own but don’t delete or rename existing types, as some are used hard-coded in the report generation.</p><ul><li><strong>Withdraw (Sell)</strong>: If you send assets to another wallet belonging to yourself. There should be always a <em>Deposit </em>transaction following this type if it’s a transfer (and not going back to your non-tracked bank account).</li><li><strong>Deposit (Buy)</strong>: If you receive assets on your account. There must be a previous withdraw transaction, if it’s not a fiat transfer from your bank account. All non-transfer and initial deposits without prior withdraw must be done in your fiat currency to ensure proper reporting.</li><li><strong>Trade (Buy+Sell)</strong>: For all trades on Exchanges. You can also use it if you participate in ICO’s for the token exchange (e.g. ETH for XYZ).</li><li><strong>Loss (Sell)</strong>: Loss of your assets. For example if you sent it to a wrong address, someone scammed you or you simply can’t remember where it went to.</li><li><strong>Mining (Buy)</strong>: If you got coins because of mining or staking activities.</li><li><strong>Airdrop (Buy)</strong>: Free coins. Who doesn’t like it?</li><li><strong>Dividend (Buy)</strong>: If you got assets for simply holding something.</li><li><strong>Expense (Sell)</strong>: If you used assets to buy something.</li><li><strong>Correction (Buy or Sell)</strong>: To fix wrong values in the report. Should be only very small amounts less than 10 USD. Otherwise you need to go over your books and find out what is causing the wrong values.</li><li><strong>Gift (Sell)</strong>: If you give someone something (for example you send coins as a gift to a friend).</li></ul><blockquote><strong>Important</strong>: Fill always Buy and Sell amount+symbol for the type Trade !! But don’t fill both for all other types.</blockquote><h4>Fees</h4><p>Fees are always additional to the sell amount. Which means e.g. if you want to buy BTC (1 BTC = 6,032.10 USD) with 0.25% fee while having 5,000.00 USD on your account:</p><ul><li><em>Buy in BTC</em>: 0.8268264</li><li><em>Sell in USD</em>: 4,987.50</li><li><em>Fee in USD</em>: 12.50</li></ul><p>Same principle applies for sending transactions with transaction fees (like for Ethereum and ERC-20 tokens). In case of transactions (Withdraw and Deposit), the selling and buying amount should be the same:</p><ul><li><em>Withdraw</em>: Selling= 1 ETH, Fee = 0.0002 ETH (account balance is subtracted by 1.0002 ETH)</li><li><em>Deposit</em>: Buying = 1 ETH</li></ul><h4>Currencies</h4><p>You should use the main common currency codes (Bitcoin: BTC, Ethereum: ETH, Litecoin: LTC, Stellar: XLM, EOS: EOS, etc.), otherwise you need to add aliases for all the coins in the sheet <em>Coin settings.</em></p><h4>Best practices</h4><p><strong>For ICO (Initial Coin Offering) / STO (Security Token Offering) / etc.:<br></strong>If you participate in any of these offerings, you can track them in two ways, depending on the distribution of coins:</p><ol><li><strong>Advanced (5 rows in your Trade sheet)</strong>: You create a new account (in <em>Accounts </em>sheet) for this coin/token offering (like you would own a wallet there). Then you track it in the <em>Trades </em>sheet as you would send (=withdraw+deposit) the tokens from your existing wallet to this new wallet. Afterwards you create a trade for the amount of tokens that you get for your coins. At the end you send them back to your own wallet (=withdraw+deposit).</li><li><strong>Simple (1 row in your Trade sheet)</strong>: You simply create a new trade (Trades sheet) for your sending wallet and put the transaction costs in the fee column.. But this will have the disadvantage that it’s not a correct presentation of the reality and the date/time will not fit with to the wallets transaction logs on the distributed ledger.</li></ol><h3>Coin settings sheet</h3><p>This sheet needs some attention if you wish to use your own crypto-currency symbols or like to add default fallback exchange rates (e.g. if your coin is not listed yet and you can’t believe that it’s value has already gone zero ;-) ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*tpaXkZRvZyP8WxBcqNRKRg.png" /><figcaption>Coin settings: default fiat exchange rate and alternative identifier for automated services</figcaption></figure><ul><li><strong>Currency</strong>: Your currency symbol/identifier in your <em>Trades </em>sheet and reports</li><li><strong>Name</strong>: Just for your information (to identify the currency)</li><li><strong>FallbackRateFiat</strong>: The fiat value of this coin, in case it’s not found on the exchange rate service(s) like CryptoCompare.</li><li><strong>CryptoCompare</strong>: Add here the identifier of the coin that is used on<a href="http://cryptocompare.com/"> CryptoCompare.com</a>, if it differs to your currency symbol (otherwise you won’t receive correct prices).</li></ul><h3>Accounts sheet</h3><p>This sheet will add new accounts to your <em>Trades </em>sheet. The column <em>Display</em> can’t be edited, its a formula. Enter your <em>Wallet-Name </em>and choose <em>Exchange/Technology</em> (maintained in <em>Settings sheet</em>). To safe you from some headache, you may also want to enter your wallet address for later research in your own transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaeTKhiN2yk15M5WSPBJnQ.png" /><figcaption>Accounts sheet to manage your wallets and exchange accounts</figcaption></figure><p>You should create one account row per wallet, especially on all different kinds of Distributed Ledger Technologies. Regardless how many different assets you store in this wallet (e.g. in Ethereum wallets).</p><p><strong>Best practice for exchanges</strong> would be to create one account row per user per exchange (the <em>Wallet-Name</em> will be your username if you own multiple accounts on that exchange). “For ICO (Initial Coin Offering) / STO (Security Token Offering) / etc.” please see the chapter (with exactly this name) above.</p><h3>Settings sheet</h3><p>The most important basic setting is your main fiat currency in <strong>Display currency</strong>. So far it’s tested with EUR and USD, but it should also work with other currencies. If you have issues, please let me know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*wy2J2PRetBniuNwBXu50pw.png" /><figcaption>Basic settings</figcaption></figure><p>For the <em>Techup PHP-Proxy</em> fields, please see the chapter “Avoid rate limit issues” further below. The <strong>Types </strong>are described in chapter “Trades sheet” &gt; “Types”. You can add new types but please do not delete or rename them. <strong>Exchanges/Technology</strong> is used for the accounts and you should add all exchanges and DLT (ETH, BTC, XLM, NEO, DOGE, EOS, …) you are using. If a DLT allows multiple kinds of tokens/coins you just need to add the technology, for example Ethereum for all ERC-20 tokens out there.</p><p><strong>UPDATE</strong>: You need to add a (free) <a href="https://www.cryptocompare.com/cryptopian/api-keys">CryptoCompare key now</a>, it is not possible to use the service any longer without a <a href="https://min-api.cryptocompare.com/pricing">free API key</a>.</p><h3>How to import trade data</h3><p>If you want to import data from exchanges like Binance, KuCoin, Huobi, etc., I highly recommend to add a new sheet <em>Imports</em>, which stores the last import date and time for each exchange/account (entered manually after each manual import processing). This way you have more control about the actuality of your trades and avoid double entries (on import).</p><p>In general you can import most data easily by using Excel/Sheet formulas (for example string splittings) and search&amp;replace functionality. After you have created your import processing sheet (see Binance example below), it’s just a matter of 2 minutes to execute any additional import into the <em>Trades </em>sheet manually.</p><p><a href="https://docs.google.com/spreadsheets/d/1_N74DXHHTVxcH08Tx_sHiz-2xUxB_qIqfF17x1y8kFE/edit?usp=sharing">Download an import helper (containing binance) here</a>. It includes the import overview sheet and the import processing sheet for binance and bitstamp. For more details see next chapter “<em>Best practice with example Binance</em>” . Contributions of new import sheets are welcome in order to speed it up for everyone.</p><p>If your exchange doesn’t offer a proper export format, you can simply copy&amp;paste the HTML/trade data to temporary or pre-made import sheets and process the data within these sheets. <strong>Important</strong>: Never paste them directly into your <em>Trades</em> sheet!</p><h4>Best practice with example Binance</h4><p>First choose your desired trades and export them to Excel (xls) format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uxn_z07aEDZpqyTl3KYVA.png" /><figcaption>Export trades from binance</figcaption></figure><p>Download the file and either open it on Google Drive or in your local Excel (or any Open Source Office that can read this format).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzYohpHUivwWe8nXbkNgMg.png" /><figcaption>Binance Excel export without modifications</figcaption></figure><p>Now add columns for the most important header fields of the <em>Trades</em> sheet in the right order, so we can copy&amp;paste them later easily:</p><ul><li>Date and time (in a format Google Sheets can understand)</li><li>Type (containing only a fixed value “Trade”)</li><li>Buy amount</li><li>Buy currency</li><li>Placeholder column (fiat value of buy amount)</li><li>Sell amount</li><li>Sell currency</li><li>Placeholder column (fiat value of sell amount)</li><li>Fee amount</li><li>Fee currency</li></ul><p>Then we need to fill these columns with formulas (except of the fixed value “Trade” as type for all entries). The following formulas are an example for row two:</p><ul><li>C “Buy”: =IF(L2=&quot;BUY&quot;;N2;O2)</li><li>D “Buy currency”: =IF(L2=&quot;BUY&quot;;LEFT(K2;3);RIGHT(K2;3))</li><li>F “Sell”: =IF(L2=&quot;BUY&quot;;O2;N2)</li><li>G “Sell currency”: =IF(L2=&quot;BUY&quot;;RIGHT(K2;3);LEFT(K2;3))</li><li>I “Fee”: =P2</li><li>J “Fee currency”: =Q2</li></ul><p>We will leave the fiat values empty, as they will be filled by our automated scripts, but we need the columns to paste the data properly into our <em>Trades</em> sheet.</p><p>To copy this formula from row 2 to all others, select all cells (B2 to J2) and drag it down to the last column. Next step is to add new rows in the same (or higher) number as our new trades count into our <em>Trades </em>sheet. Afterwards simply copy the trades into the created empty rows by using <em>Paste special -&gt; only values</em>. Once you have created an import sheet for your exchange, you can reuse it. <strong>Then an import will just cost you around 2 minutes</strong>. If you want to share your exchange import sheet (with formulas), feel free to do so and let me know. <a href="https://docs.google.com/spreadsheets/d/1_N74DXHHTVxcH08Tx_sHiz-2xUxB_qIqfF17x1y8kFE/edit?usp=sharing">You can download an import helper (containing binance and bitstamp) here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbh1tC6N9pmH1PkOqlGqew.png" /><figcaption>Sheet with our added columns for import into trades table, the values are filled by our formulas</figcaption></figure><h3>Review and change source code</h3><p>You can review (there is no backdoor!) and change the code in <em>Tools &gt; Script Editor</em>, which does the magical work for you (retrieving exchange rates and creating reports).</p><h3>Upgrade to a new sheet version</h3><p>After a new release you can copy&amp;paste the content of your <em>Trades-</em>sheet and your modified values in<em> Coin settings</em>-, <em>Accounts</em>-, and <em>Settings</em>-sheet to the new released sheet. The effort to upgrade should be max. 5 minutes.</p><p><strong>UPDATE</strong>: The source code is now <a href="https://github.com/TechupBusiness/coin-tracker-google-sheets">here on Github</a> for easier versioning and collaboration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldm4wIJT2U9aJ_DuwA1DkQ.png" /><figcaption>Since version 1.0.1 you can see your version number in sheet “Info”</figcaption></figure><h3>Avoid rate limit issues</h3><p>As the embedded script is executed on Google servers, it is sharing its IP address with other Google Apps Scripts. So if you want to access an API which has limits for the IP, this could lead to accessibility issues (or even bans for the IP address). Therefore you will find a small (protected) PHP “proxy” script on<a href="https://github.com/TechupBusiness/google-script-php-proxy"> Github here</a>. You can run it on any web server that will route your request to your desired service and you don’t need to worry about any IP related problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*JsAAxTSDMESfipMsNM3GZg.png" /><figcaption>Settings-Sheet: Setup the “proxy” to avoid IP address limitations</figcaption></figure><p>You can simply set it up by entering your (https!) URL (including the script filename, by default proxy.php) and your token.</p><h4><strong>Notes</strong></h4><ul><li>Indeed, the “proxy” could be more secure, but for normal use it is secure enough (don’t publish your proxy URL and token anywhere!).</li><li>If changes are not applied when running the menu actions, please wait 10 minutes (expiration time of cache for settings).</li></ul><h3>Known limitations</h3><ul><li>Prices are taken only from cryptocompare.com. Coinpaprika.com, a new free very interesting API, may be implemented soon.</li><li>Historical prices from CryptoCompare are aggregated only per hour (not per minute). This means that the fiat values may differ from your expected “real” price of the trade-moment.</li><li>The value of AverageCoinPrice in the report <em>Portfolio values</em> may be misleading as the fiat value of the coin/token could have changed during trades because of price changes. <br><strong>Example</strong>: You buy 1 coin XYZ for USD 200 (you payed USD 200). After that the price of XYZ rises and you sell it for Bitcoin (worth 210 USD). Now Bitcoin rises (but also XYZ) and your Bitcoin purchase is worth 300 USD. Next you use it to buy again 1 coin XYZ. The report will pick up your invested 200 USD first, then your sell for 210 USD (USD 200/1 coin minus USD 210/1 coin = USD -10). Next your buy worth 300 USD is added to the calculation (USD -10 + USD 300/1 coin = USD 290). The average coin price for 1 coin is then 290 USD for this report (even though you invested only USD 200 from your bank account).<br><strong>UPDATE</strong>: Please see also <a href="#add4">Troubleshooting → “I want to have more realistic results for my portfolio values for my mining and airdrops”</a></li><li>Calculation made with double-precision 64-bit format IEEE 754 values (means not 100% accurate, see<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript#Numbers"> https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript#Numbers</a>)</li><li>Reports are fixed calculated values, formulas were not used to make it more dynamic (e.g. if you change your coin count in the report, the fiat value would not increase).</li><li>No input masks/wizards to simplify to enter data (e.g. you need to add two rows for each wallet transfer manually) or to validate your input data.</li><li>If you change an asset value that has already a fiat value, you need to delete the existing fiat value. Otherwise the script will calculate with the wrong old fiat value.</li></ul><h3>Contribution &amp; support</h3><p>Please let me know if you need more features or some help. Code/sheet improvements are very welcome (please see <a href="https://github.com/TechupBusiness/coin-tracker-google-sheets">Github</a> for the code part)! I will add them after a review to the sheet and mention you with name and URL.</p><p>If you have still issues after reading the whole article and checking the troubleshooting section, please write an email to <strong>support at techupbusiness.com </strong>.</p><p>Donations are also welcome:</p><ul><li><strong>BTC: </strong>3ECGVjb9GMbBf5UfKbSyriHSga851r7xMc</li><li><strong>ETH/ERC20: </strong>0x7434B3Fcc0264F6EA173c6135fDeF63286Ee1f97</li></ul><h3>Troubleshooting</h3><p><strong>“Invested sum is wrong in profit overview”</strong><br>All fiat deposits and fiat withdraws are summarized and represent your current invested fiat value. Please don’t deposit/withdraw any currency other than your fiat currency. If you wan’t to add them, you need two virtual trades as a workaround to represent your asset deposit/withdraw:<br>1) Deposit/withdraw fiat value of your asset<br>2) Trade your asset for the fiat amount</p><p><strong>“The coin prices and/or values are wrong”</strong><br>You should go through your trades row by row and check all rows related to your “wrong” asset symbol. Make sure to always fill <em>Buy</em> and <em>Sell</em> side for all rows of type “Trade”.</p><p><strong>“Fiat rates does not appear when I click on <em>Add fiat rates</em>“</strong><br>Probably you forgot to add the CryptoCompare API key or the currency you are using is not known to CryptoCompare. Make sure you added a <a href="https://www.cryptocompare.com/cryptopian/api-keys">free CryptoCompare key</a> (you may need to <a href="https://min-api.cryptocompare.com/pricing">register first</a> for the free plan) in your <em>Settings</em> sheet. If the currency is not know, please check the <em>Coin settings</em> sheet and add a default exchange rate or alternative CryptoCompare name.</p><p><strong>“A specific fiat rate is not loaded”</strong><br>Please check on <a href="http://cryptocompare.com/">CryptoCompare</a> for the id of your asset. You can find the ID by using the normal search in the results list or extract it from the URL of the assets detail page. If you want to use your own asset id in your trades sheet, add it to the <em>Coin settings</em> sheet (see the chapter <em>Coin settings sheet</em> in this article).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*dYBdHegoCqczZ94GXOz5wg.png" /><figcaption>Getting the ID from the search results (id is in brackets)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*8fW3oMH3ekYnWGhVH28eKw.png" /><figcaption>Getting ID from URL of detail page (<strong> </strong>/coins/&lt;ID&gt;/overview<strong> </strong>)</figcaption></figure><h4>“Date sorting does not work properly”</h4><p>You probably have “dates” in these cells that are not parsed as dates by Google Sheets. If you can’t sort them you probably need to fix them first.</p><h4>“I want to use more than one fiat currency”</h4><p>Right now the sheet only allows one fiat currency (e.g. USD or EUR) for the profit report as “base”. Means, if you have an USD and an EUR bank account and send the money to exchanges, one of these currencies will not be recognized as fiat deposit within the report. Assuming your “main” display currency is EUR, a workaround would be to add two more trades to your USD deposit: First you deposit the value of the already tracked USD in EUR to the same wallet. Next you exchange it against zero, using the <em>Correction </em>type. This way the report tracks your deposit in EUR as investment in the main fiat value but doesn’t consider it later.</p><h4>“Changing the proxy URL in the settings have no effect”</h4><p>This can happen, because settings are cached after they are read. Please wait 10 minutes, then the cache will be cleared.</p><h4>“I want to have more realistic results for my portfolio values for my mining and airdrops”</h4><p>First make sure that you upgraded to <a href="https://medium.com/@techupbusiness/free-crypto-portfolio-tracker-based-on-google-sheets-ef76070ec325#1a58">v1.0.1</a>. Then the following will work…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PLYxTC2fDG6L8fvPsN_vg.png" /><figcaption>Example trades with automatic fiat values</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCLdOEZsczJ1P8tg5epk3w.png" /><figcaption>Resulting portfolio values</figcaption></figure><p>The resulting portfolio values are not really correct, because the costs for 1 BTC may be zero (Airdrop) or something else (Mining = electricity costs). This portfolio tracker is not considering the pricing history of each asset amount automatically. It would require deeper changes in the code. Only if you vote for it in the comments, this may come one day.</p><p>But… there is a manual workaround already available:</p><p><strong>For Airdrops</strong>: Simply set the fiat values of the “free” tokes to zero (for all transactions that are related to these “free” mined coins). And you will get a profit of 100%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhbF2zteXGlCt7BGsOqnVg.png" /><figcaption>Resulting portfolio values if you set the fiat values for all trades related to mining to zero</figcaption></figure><p><strong>For Mining</strong>: To put your electricity costs into calculation, set your actual costs manually for all transactions that are related to these mined coins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9xmBB9_d0wzf3MsFV_X6Q.png" /><figcaption>Resulting portfolio values if you set the fiat values for all trades related to mining of 1.0 BTC to 2.500 USD (per 1.0 BTC, would be 2.250 for 0.9 BTC, please refer to “Example trades with automatic fiat values”)</figcaption></figure><h3>Links</h3><ul><li>Thanks to <a href="https://cryptobulls.info/">cryptobulls.info </a>for the video review: <a href="https://www.youtube.com/watch?v=mXkG4fIuz8o&amp;feature=youtu.be">https://www.youtube.com/watch?v=mXkG4fIuz8o</a></li></ul><h3>Changelog</h3><h4>1.0.0 Initial version (<a href="https://github.com/TechupBusiness/coin-tracker-google-sheets/tree/v1.0.0">Github</a>)</h4><ul><li>Contains already most functionality described as described in this article :-)</li></ul><h4>1.0.1 Small bug-fix / behavior change (<a href="https://github.com/TechupBusiness/coin-tracker-google-sheets/tree/v1.0.1">Github</a>, <a href="https://github.com/TechupBusiness/coin-tracker-google-sheets/compare/v1.0.0...v1.0.1">Changes</a>)</h4><ul><li>Removed hard-coded “Eur” from “Portfolio Values” sheet (use fiat currency from settings instead for the column name)</li><li>Changed the calculation of <strong>PayedCoinPriceTotalFiat</strong> (includes now also Mining, Dividend, etc.) — <a href="#add4">more information</a></li><li>Fixed a potential show-stopper bug for future releases</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef76070ec325" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[node.js await/async trap when chaining]]></title>
            <link>https://mindup.medium.com/node-js-await-async-trap-when-chaining-2481861a4c54?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/2481861a4c54</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[asyncawait]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Sun, 23 Sep 2018 13:10:55 GMT</pubDate>
            <atom:updated>2018-09-24T07:09:57.638Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This article is written for developers and about JavaScript basics, when working with asynchronous methods and </em><em>await .</em></p><blockquote>Never try to access a property or method of your awaited result (without brackets). It will result in (seemingly) very strange behavior at another place(s) of your code.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qw5o0XTebvQ9sI7t" /><figcaption>“orange excavator” by <a href="https://unsplash.com/@besluk?utm_source=medium&amp;utm_medium=referral">Luke Besley</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a> (Partner of <a href="http://ost.com/">OST.com</a>)</figcaption></figure><p>Recently we ran into the problem, that suddenly at a specific line of the code, the debugger just seemed to jump out of the function to a parent function without reaching catch or finally or any other exception handling. Like it would swallow any error. It happened always at the following line of code:</p><pre>client = <strong>await this</strong>._pool.connect()</pre><p>It just ignored every try to catch and tackle the problem:</p><pre>process.on(&#39;unhandledRejection&#39;, (err) =&gt; {<br>    console.error(err)<br>})</pre><pre>...</pre><pre><strong>this</strong>._pool.on(&#39;error&#39;, (err, client) =&gt; {<br>    <strong>let </strong>{ logger } = self.loadModules()<br>    logger.logCritical(err.message, &#39;Database error&#39;, err)<br>})</pre><pre>...</pre><pre><strong>this</strong>._pool.connect().then(...).catch(...)</pre><pre>...</pre><pre>try {<br>  client = <strong>await this</strong>._pool.connect()<br>} catch(ex) {<br>   logger.logCritical(ex)<br>} finally {<br>   logger.logInfo(&#39;Why is this not reached?&#39;)<br>}</pre><p>Even though this method was called multiple times successfully, suddenly at one call it stopped working and seemed to push the debugger back in the stack to a parent method, a few levels up. Was there something really strange going on with the development environment, maybe a memory issue or triggered node.js bug by the database connector?</p><p>After a while some clouds started to dissolve, it was not throwing an error or breaking the interpreter execution, it simply didn’t wait for the promise! Instead this method was suddenly executing asynchronous without waiting, ignoring any await in front of it. It only happened for a specific method call chain, which looked like this:</p><pre>getPricePoint(...)<br>|-- getCandles(...)<br>    |-- runSelectQuery(...)<br>        |-- query(...)</pre><p>Even though the await command was used properly, there was something different to “normal” for one call in getCandles:</p><pre>return <strong>await this</strong>.runSelectQuery(table, where, {<br>    start: &#39;ASC&#39;<br>}, Limit).rows</pre><p>The magical .rows … After removing this piece of code, suddenly the code execution was working again like expected, no “magical” removal of the await by the interpreter any longer. The await was waiting, everything worked again like it should:</p><pre>client = <strong>await this</strong>._pool.connect() // waiting \o/</pre><p>So if your await is not waiting for a promise-returning method in node.js, simply check if you maybe made a mistake in the parent stack chain. Like calling a method or reading a property of the returned await result “directly”. Unfortunately this doesn’t result in an error, even though the property .rows is obviously not a function and definitely not async, which could be awaited for by the interpreter. Means node.js will silently run your awaited method without any notification asynchronously, without waiting.</p><p>Just to make it complete: Of course you CAN chain, but then do it smart and use brackets:</p><pre>return (<strong>await this</strong>.runSelectQuery(table, where, {<br>    start: &#39;ASC&#39;<br>}, Limit)).rows</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2481861a4c54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — The finalization]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-the-finalization-16fadb6e3e04?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/16fadb6e3e04</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Wed, 08 Aug 2018 08:05:54 GMT</pubDate>
            <atom:updated>2018-10-04T14:24:44.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5n_tDkP5UKyAJOX1RPdYg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/ZahNAl_Ic3o?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Austin Neill</a> on <a href="https://unsplash.com/search/photos/win?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (Partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software </em><a href="http://cs-cart.com/"><em>cs-cart</em></a><em> (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><p>The hackathon OST KIT Phase 3 is successfully completed for OST Loyalty 2.0 now. All requirements were met and OST Loyalty, a tiny little piece of the foundation of OST’s success, is ready to use. You can try it out online, the instructions can be found <a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">here</a>.</p><p><strong>Links to Github projects:</strong></p><ul><li><a href="https://github.com/TechupBusiness/ost-loyalty-cscart">OST Loyalty 2.0</a></li><li><a href="https://github.com/TechupBusiness/ost-kit-php">OST Simple Token — KIT API — PHP Wrapper</a></li></ul><p>As we already wrote in our <a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a>, the base idea, a point based customer loyalty program, is an ideal simple use-case for the blockchain, the first used technology for the distributed ledger. Nothing needs to be tested on the market first as it’s a known and commonly applied marketing and customer binding tool, which results in low barriers for the acceptance by “the mainstream”. Everybody is collecting points somewhere: if it’s the supermarket, petrol station or Airline. And OST Simple Token offers for non-tech companies an easy and cheap on-demand access to this distributed ledger technology. It seems to be the natural evolution path for this kind of customer loyalty programs. Exchangeable and with ownership by the users. If properly implemented, it will have a massive adoption potential for blockchain and especially OST, which is still strongly focussed on the financial aspect rather than data aspects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeOsOgsKdhA6LwAtEKpYmw.png" /><figcaption>Screenshot of the OST KIT backend to manage branded token-economies</figcaption></figure><p>We will publish an article within the next weeks, how the customer loyalty systems around OST Simple Token should be designed and fit together, as we strongly believe in the power of synergies and standards.</p><p>Previous publications on OST Loyalty 2.0 and the OST KIT phase 3 hackathon:</p><ul><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">OST Loyalty 2.0 — Week 1: The Kick-Off</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175">OST Loyalty 2.0 — Week 2: The foundation</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8">OST Loyalty 2.0 — Week 3: The wallet</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">OST Loyalty 2.0 — Week 4: The stage</a></li></ul><h3>Functional overview</h3><p>As a short summary, OST Loyalty 2.0 integrates branded tokens (BT) as a point-based customer loyalty program into cs-cart, an e-commerce software. Nothing new, if you read previous articles. In detail, it covers the functionalities, as follows:</p><ul><li>Customer earns BT when they buy something in the shop (configurable)</li><li>Customers can spend BT when they buy something (current fiat value will be used)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*wKtq4PSln04tJrqZzhBrwA.png" /><figcaption>Screenshot of branded token usage (earn and spend) on checkout</figcaption></figure><ul><li>Store owners can create promotions, which are flexibly buildable rules to incentive store users. You can create conditions and incentives, also in combination.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evz6fOyqJXdhSNI9zqk-wQ.png" /><figcaption>Promotion builder in CS-Cart</figcaption></figure><h3>OST KIT API, our wallet-integration and OST View</h3><p>When we started our journey with OST KIT Phase 2 a few months ago, there was no API library for PHP existing yet. So we decided at that time to create such a wrapper (with code-autocompletion support), which is now published on <a href="https://github.com/TechupBusiness/ost-kit-php">Github</a>. It contains all so far existing endpoints for OST in v0 and v1 of the KIT API.</p><p>For the implementation of OST Loyalty 2.0 we used most of the offered API endpoints (you can check the <a href="https://dev.ost.com/">API documentation</a> for more information):</p><ul><li>/actions to create needed actions for OST Loyalty (e.g. Registration-Bonus, Sales-Volume-Reward, Pay-with-tokens, …) if they do not exist yet</li><li>/users to create and retrieve user data</li><li>/transactions to execute created actions</li><li>/balances to get the balance of a user</li><li>/ledger to retrieve transactions of a user</li><li>/token to get all branded token data like the companies wallet, current exchange rate, …</li></ul><p>The other two endpoints /airdrops and /transfers were not needed yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNvt3Gxplw6T7HZAJjqf7g.png" /><figcaption>Screenshot of the OST Simple Token API documentation</figcaption></figure><p>As already mention in <a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8#3f2f">OST Loyalty 2.0 — Week 3: The wallet</a>, we had to store some additional information like the used actions, exact exchange-rates at the time of transaction and some referenced object ids (like order-ids) in the centralized e-commerce database. This allowed us to generate a transaction history with more meaningful information for the customer wallets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJGTdK916-vHslxD8OiJQA.png" /><figcaption>Screenshot of a transaction history for a customer in CS-Cart</figcaption></figure><p>Customer can then easily check the transactions and their wallets on <a href="https://view.ost.com/">OST View</a>, the blockchain explorer for the OST Simple Token side-chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mGC3EQgjBUNuNKKz1Km-A.png" /><figcaption>Screenshot of OST View transaction</figcaption></figure><p>Store owner can track API calls in their backend, if they enabled the logger in the logging-settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_f4WcLjJ51ZnD7zzFqjbg.png" /></figure><p>The add-on is also available on the <a href="https://marketplace.cs-cart.com/add-ons/marketing/ost-loyalty-tokenized-customer-loyalty-program-based-on-blockchain.html">cs-cart marketplace here</a>.</p><h3>Final words</h3><p>Tobias had fun but also tough weeks, especially at the end of the hackathons as there were tight deadlines. There were ups- and downs, but most downs came from the effort to implement the API properly in CS-Cart, as this is sometimes tricky because of either too much or too less “flexibility”. Occurring issues related to the OST KIT API could be worked around or were fixed in the new version v1. In our upcoming article about customer loyalty programs on OST, we will have a deeper look on further improvements of the OST KIT.</p><p>Fortunately the <a href="https://gitter.im/OpenSTFoundation/SimpleToken">OST Developer channel</a> and their support (support@ost.com) is always a great help with a direct contact to the OST Team or to even get help from other developers, hanging around there.</p><p>Thanks to all contributors, supporter, helping heads and the OST Team! Great idea — fantastic work!</p><h3>Video for OST KIT Phase 3</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYTpwTp6H_Dk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYTpwTp6H_Dk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYTpwTp6H_Dk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/efd94c1b87037e410d81110d749c9938/href">https://medium.com/media/efd94c1b87037e410d81110d749c9938/href</a></iframe><h3>Videos for OST KIT Phase 2</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBvM7vAmQnxg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBvM7vAmQnxg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBvM7vAmQnxg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f809cb2c522324789f076e32627ce88b/href">https://medium.com/media/f809cb2c522324789f076e32627ce88b/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVZjr30SPiFk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVZjr30SPiFk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVZjr30SPiFk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/34bf158d2f00fc396605555109d85502/href">https://medium.com/media/34bf158d2f00fc396605555109d85502/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16fadb6e3e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — Week 4: The Stage]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/d58e55a6643b</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Fri, 03 Aug 2018 17:02:51 GMT</pubDate>
            <atom:updated>2018-08-08T10:49:35.752Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSas-bbMSNyxHh7G__fJ9w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/WPJwCYJhHNI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Samuel Fyfe</a> on <a href="https://unsplash.com/search/photos/stage?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software cs-cart (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><p>One of the enhancements we made, were adding (optional) links to <a href="https://view.ost.com/">OST View</a>, the blockchain explorer for the OST side-chain. They are constructed by the following logic (we just used transactions and accounts):</p><pre># Generic template<br><a href="https://view.ost.com/chain-id/1409/address/0x4Fc4269D015C427Da2d41E647A87A89A8e205c93">view.ost.com</a>/chain-id/1409/[OBJECTNAME]/[0xHASH]</pre><pre># This means for us:<br>## Transactions<br><a href="https://view.ost.com/chain-id/1409/address/0x4Fc4269D015C427Da2d41E647A87A89A8e205c93">view.ost.com</a>/chain-id/1409/transaction/[0xHASH]</pre><pre>## Accounts / addresses<br><a href="https://view.ost.com/chain-id/1409/address/0x4Fc4269D015C427Da2d41E647A87A89A8e205c93">view.ost.com</a>/chain-id/1409/address/[0xADDRESS]</pre><p>The chain-id appears to be static, but will probably change later on. We will need to extend OST Loyalty with a dynamic side-chain id as soon as OST switches to production side-chains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*or0aMBr06osxMifD-PPx_A.png" /><figcaption>OST View, blockchain-explorer for OST Simple Token side-chain</figcaption></figure><p>Even though we wanted to publish the live demo this week, we had some bugs to fix and some enhancements to make (like adding the logging properly), which took quite some time. That’s why this will be one of our tasks for the next week — the final.</p><p><strong>UPDATE</strong>: We finalized the public demo in the meantime. You can check it out at <a href="https://ost-demo2.techupbusiness.com/">https://ost-demo2.techupbusiness.com/</a> and play around. Username is ost and password kit . You need to create an user account (you can use any email address) before you can start testing. Please notice:</p><ul><li>The system will still get some updates (you may see weird output on the website or something is not working properly)</li><li>You will get branded tokens for your registration</li><li>Even though you will see &gt;100 tokens on checkout as reward, we needed to adjust the API to max. 100 branded tokens because OST KIT does not except higher numbers than 100. Therefore you will receive max. 100 tokens in your wallet as a reward</li><li>The system will not send out any emails</li><li>You will get credited 1% of your sales volume as branded tokens in return (but max. 100 tokens, see above).</li><li>On checkout simply use “Other payment option” → “Phone ordering”</li><li>There is a coupon code to try on checkout: ost</li></ul><p><em>Unfortunately we found out, that the amount of tokens for transfers is limited to a maximum of 100, which does not really makes sense for us. So we updated </em><a href="https://github.com/TechupBusiness/ost-kit-php"><em>our PHP wrapper</em></a><em> to limit all amounts to a maximum of 100 (if the wrapper is used in “test” mode) and hope that this restriction will be removed.</em></p><p>We finished the first version of the OST Loyalty documentation and use markdown syntax. It will be included in the downloadable OST Loyalty add-on package for cs-cart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwjpwDbYdU05fFpQj2uVQw.png" /></figure><p>Next week we will make, besides the already mentioned live demo, the newest version of OST Loyalty, which is available for download, performs some code cleaning, prepare the video, ensures that we reach all hackathon goals and polish all edges that will pop-up.</p><h3>Adoption notes</h3><p>Recently <a href="https://blog.coinbase.com/new-features-woocommerce-plugin-send-bitcoin-and-litecoin-and-more-85f83fc520a">Coinbase published a WooCommerce extension</a> to allow 50 million WooCommerce store owners to accept crypto payments. This is exactly what we think (see also our <a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a>) is needed for OST to grow immediately: extensions for major e-commerce applications as a points based customer loyalty program. Later on we would like to see these BT economy tokens also getting accepted by third-party payment providers.</p><p>Read more about OST Loyalty:</p><ul><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">OST Loyalty 2.0 — Week 1: The Kick-Off</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175">OST Loyalty 2.0 — Week 2: The foundation</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8">OST Loyalty 2.0 — Week 3: The wallet</a></li><li><em>OST Loyalty 2.0 — Week 4: The stage (this article)</em></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-finalization-16fadb6e3e04">OST Loyalty 2.0 — The finalization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d58e55a6643b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — Week 3: The wallet]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/3701b4121ee8</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Mon, 30 Jul 2018 10:09:20 GMT</pubDate>
            <atom:updated>2018-08-08T08:08:24.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ss9rWpUmJzD1zQmF_RjBWA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/GTmLKWZzZuo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Julius Drost</a> on <a href="https://unsplash.com/search/photos/wallet?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software cs-cart (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><p>The past week was all about implementing the wallet feature with our custom PHP API Wrapper which you can find on Github <a href="https://github.com/TechupBusiness/ost-kit-php">here</a>.</p><h3>Balances</h3><p>The wrapper implementation worked like a charm in the beginning. The balances endpoint did what it should do, except the fact, that it gives us back three different kinds of balances:</p><pre>&quot;available_balance&quot;: &quot;14.243366506781137&quot;,          &quot;airdropped_balance&quot;: &quot;6.231683253390568746&quot;,          &quot;token_balance&quot;: &quot;8.011683253390568746&quot;</pre><p>The most relevant balance for us is the available_balance , but how are airdropped_balance and token_balance used? The answer was given in the supportive <a href="https://gitter.im/OpenSTFoundation/SimpleToken">OST Developer gitter.im channel</a>: the airdropped tokens will be used first for any transaction, then the “normal” tokens.</p><p>By default, the available_balance will be shown on each page in <a href="http://cscart.com/">CS-Cart</a> in a CS-Cart “block” (if the administrator placed it there, as we did).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0fN1PimreAFcL8_UxQ0Mg.png" /></figure><p>In addition, we show up the detailed balance to the user on the transaction page and linked to OST View (store owner can enable/disable these links in the settings):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CdpC9WdVYfOXQDDRWbr8Fw.png" /><figcaption>Wallet data receiving from Balances- and Ledger-API endpoint</figcaption></figure><h3>Ledger</h3><p>While implementing the transaction history by using the ledger endpoint, we struggled a bit because one of our requirements, custom meta data on the chain, does not exist (yet?) in OST KIT. So we had to enrich the transaction data from our centralized database to gather all the needed data and allow an easy and intuitive user experience.</p><p>In detail were missing and had to store together with the transaction id:</p><ul><li>action identifier (which triggered the transaction)</li><li>exact exchange rate to the default currency (can be any) in CS-Cart in the moment of transaction execution (important because this is the fiat value, that the transaction was eventually used to pay or to earn based on sales volume)</li></ul><p>If we would store the exchange rate on the blockchain, we would need to store also the exchange rate currency in addition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFGkhGJCywBzwMgyhnohew.png" /><figcaption>Action identifier and exact exchange rate-based value in moment of transaction</figcaption></figure><p>This week we are going to update our live demo systems and create the instruction- and help material for setting up and use of OST Loyalty 2.0 with CS-Cart. Besides some small enhancements and bug fixing.</p><p>Read more:</p><ul><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">OST Loyalty 2.0 — Week 1: The Kick-Off</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175">OST Loyalty 2.0 — Week 2: The foundation</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a></li><li><em>OST Loyalty 2.0 — Week 3: The wallet (this article)</em></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">OST Loyalty 2.0 — Week 4: The Stage</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-finalization-16fadb6e3e04">OST Loyalty 2.0 — The finalization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3701b4121ee8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — The halfway look-back]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/813e630e8b81</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[crm]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[customer-loyalty]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Fri, 27 Jul 2018 08:59:53 GMT</pubDate>
            <atom:updated>2018-08-08T08:08:09.995Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2rewO8PGuq_vN9JKJLH-ow.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/FrSEEdYr418?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">adrian</a> on <a href="https://unsplash.com/search/photos/arrived?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (Partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software </em><a href="http://cs-cart.com/"><em>cs-cart</em></a><em> (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><h3>Customer points as a loyalty program</h3><p>Personally we already experienced the influence of customer loyalty programs to collect “points” years ago. As consumers we had no higher interests in such programs at that time. Because the benefits were very limited, as it usually just offered a discount to buy other products (which we might could get for the same price somewhere else).</p><p>One major company that addressed most downsides of this programs in Germany is <a href="https://www.payback.de/">Payback</a>. They allow customers to earn points in every participating store (most known retailers are their partners) when the customers show their Payback customer card, in a credit card format, to the cashier. Customers can then use these points for discounts on specific products (we know this already) or … change it into fiat-vouchers and use them on all participating stores. Even though it is a very small cash back, people like using it and mostly even forget their concerns about their data privacy. Nowadays Payback supports countless different and major retailers (also online) in Germany, Italy, Poland, India and Mexico.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpTvWnovB-WUl3FYi8Y53Q.png" /><figcaption>Source: Screenshot of <a href="https://www.payback.de/home/willkommen">https://www.payback.de/home/willkommen</a></figcaption></figure><p>This makes it very convenient for people as they like to collect, save and get benefits, and they can use it in all their favorite local and online stores.</p><p>In Switzerland, some of the bigger market players (“oligopoly”) have their own point programs like “<a href="https://www.supercard.ch/">Supercard</a>” from <a href="https://www.coop.ch/">coop</a> and “<a href="https://www.migros.ch/de/cumulus.html">Cumulus</a>” from <a href="https://www.migros.ch/">Migros</a>. This exists, of course, also in other countries. Loyalty programs are “in” and they work to attract and lock-in customers, more or less depending on their functions. Interestingly, a large number of customers don’t use their points. Instead, they collect them but rarely spend them. It seems that the point collection is the most important part of this loyalty program journey. In most cases the points are getting deleted after some inactivity/non-spend time. This can result in frustration sometimes.</p><p>You also find this feature of “points” nowadays in most e-commerce software (sometimes as an extension). But in all cases, the points are just saved in a local database and are often bound to a specific company (some exceptions like Payback exist). Transferring them somewhere else is not possible.</p><h3>Why OST Loyalty</h3><p>After seeing the success (and spread) of point-based loyalty systems and hearing about the OST POC Phase 2, it was clear for us, that this would be the perfect (mass) adoption use-case for OST branded tokens. It would allow companies to offer customers a “branded points” based customer loyalty program with low service fees, hosted, in a distributed ledger (blockchain). These tokens are “owned” by the customers, are transferable and have a real value that even increase over time (when companies staking OST). All properties, that the traditional loyalty systems are lacking of.</p><p>We started as an e-commerce startup years ago, and became e-commerce specialists on our road. The systems that popped up that time and caught our attention were <a href="https://shopware.com/">Shopware</a>, <a href="https://magento.com/">Magento 1</a> and finally <a href="https://www.cs-cart.com/">CS Cart</a>. As we had good experiences in the latter system as it allowed us a flexible integration (which also has its downsides), it was our first choice to realize a proof-of-concept for a “points” loyalty system extension based on OST branded tokens. We believe that this is definitely a very useful traditional marketing instrument, for which OST Simple Token is the perfect answer.</p><p>After finishing POC Phase 2, we noticed, that there were also other teams working on something similar like “<a href="https://medium.com/@jayNay">Craft Loyalty Tokens</a>”. And over the last two weeks in Phase 3, while communicating actively with the OST Community, we noticed that there seems to be a huge demand for loyalty systems on all major e-commerce platforms. This confirms our own impressions that a customer loyalty and reward system are the perfect simple use-case for OST “as-it-is” and will help its adoption.</p><p>We and the community would like to see at least the following e-commerce systems covered in the near future:</p><ol><li>Shopify</li><li>WooCommerce / WordPress</li><li>WIX</li><li>Magento</li><li>Shopware</li></ol><p>Other teams are welcome to pick them as their project! Maybe we can cover one of them in another OST Simple Token hackathon?</p><h3>Current progress</h3><p>As you can read in our weekly articles, we successfully upgraded our PHP API Wrapper, which you can find on Github <a href="https://github.com/TechupBusiness/ost-kit-php">here</a>, to support the latest wallet features of OST KIT. Right now we are finishing the implementation of the wallet functionalities this week.</p><p>As a more detailed look-back, please refer to our weekly article series:</p><ul><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">OST Loyalty 2.0 — Week 1: The Kick-Off</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175">OST Loyalty 2.0 — Week 2: The foundation</a></li><li><em>OST Loyalty 2.0 — The halfway look-back (this article)</em></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8">OST Loyalty 2.0 — Week 3: The wallet</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">OST Loyalty 2.0 — Week 4: The Stage</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-finalization-16fadb6e3e04">OST Loyalty 2.0 — The finalization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=813e630e8b81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — Week 2: The foundation]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ecb1a2ed175</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Sun, 22 Jul 2018 19:59:20 GMT</pubDate>
            <atom:updated>2018-08-08T08:07:54.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_No0GJeibfxn9w8u8KD64A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/TuO1ijJWeR0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Deepal Pallav Suthar</a> on <a href="https://unsplash.com/search/photos/foundation?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (Partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software cs-cart (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><p>This week we updated our PHP API Wrapper library to OST KIT 1.1, fixed some bugs and published it on <a href="https://github.com/TechupBusiness/ost-kit-php">Github</a>. Our wrapper supports now the complete API, including the new transfers, ledger and balances-endpoints. All parameters are available as easy-to-use function parameters with PHPDoc declaration in repository classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*wTBSTsrHodhh9U5_-iZyqw.png" /><figcaption>Example: List method for transfers, returns an array of transfer models</figcaption></figure><p>All data returned by the API is parsed into “typed” models as shown below. In our <a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">previous article</a> we covered the big advantage of this (IDE code completion support). Neither developers need to keep the documentation open while coding, nor they need to remember all properties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*nn6CNJBTl3dGYFRhsKtzCg.png" /><figcaption>Example: “typed” transfer model</figcaption></figure><p>We also published the first version to install the e-commerce software <a href="http://cscart.com/">CS Cart</a> automatically via composer on <a href="https://github.com/TechupBusiness/cscart-composer">Github</a>. The optional installation of OST Loyalty will follow within the next week(s).</p><p>While upgrading to the newest CS-Cart version 4.8.1sp1, we noticed that the backend got a nice little facelift, which makes on us a more clean impression than the old UI. As expected for minor upgrades, there were fortunately no bigger issues for OST Loyalty 1.0 occurring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BmSAL2uoznw7aNDfKFPoVw.png" /></figure><p>In the community, we noticed some voices that would like to see loyalty programs for e-commerce software. Seems that we are on a good track and hope that we can also use our knowledge to push OST on other e-commerce software later on. Because adoption is the key to growth.</p><p>Next week we are going to implement our new API functions into OST Loyalty to retrieve live users balances and transactions, besides fixing all bugs on the road in our Github contributions.</p><p>Read more:</p><ul><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718">OST Loyalty 2.0 — Week 1: The Kick-Off</a></li><li><em>OST Loyalty 2.0 — Week 2: The foundation (this article)</em></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8">OST Loyalty 2.0 — Week 3: The wallet</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">OST Loyalty 2.0 — Week 4: The Stage</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-finalization-16fadb6e3e04">OST Loyalty 2.0 — The finalization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ecb1a2ed175" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OST Loyalty 2.0 — Week 1: The Kick-Off]]></title>
            <link>https://mindup.medium.com/ost-loyalty-2-0-week-1-the-kick-off-33e78e167718?source=rss-3b6a3357d126------2</link>
            <guid isPermaLink="false">https://medium.com/p/33e78e167718</guid>
            <category><![CDATA[e-commerce-software]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[TechupBusiness]]></dc:creator>
            <pubDate>Sat, 14 Jul 2018 18:43:18 GMT</pubDate>
            <atom:updated>2018-08-08T08:07:33.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbxLoYJ-hZnLeMMxFNHkzA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/HN_4K2diUWs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jason Briscoe</a> on <a href="https://unsplash.com/search/photos/kick?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (partner of <a href="http://ost.com/">OST Simple Token</a>)</figcaption></figure><p><em>OST Loyalty is an add-on for the e-commerce software cs-cart (online stores and marketplaces) that creates a customer loyalty program based on </em><a href="https://ost.com/"><em>OST Simple Token</em></a><em>, an easy-to-use side-blockchain for the crypto-currency Ethereum (ETH). It is the result of our participation in the first “hackathon” </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-phase-ii-developer-proofs-of-concept-4df5b06c8694"><em>OST KIT Phase 2</em></a><em>. This series will discover our progress for </em><a href="https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-iii-embedded-wallet-lite-challenge-4a67ea214971"><em>OST KIT Phase 3</em></a><em> to integrate the user wallet into OST Loyalty.</em></p><p>If you want to know more about OST Loyalty and what it can do, watch our <a href="https://youtu.be/BvM7vAmQnxg">introduction video</a> and <a href="https://youtu.be/VZjr30SPiFk">final submission</a> video on Youtube, made for Phase 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S3_xMr6eUhToigMnLg7dNA.png" /><figcaption>Overview how user can earn or spend branded tokens on OST with CS-Cart</figcaption></figure><p>In this first week we focussed on the new libraries and API specifications, to find out how and which functionality we want and can implement.</p><p>One of the major decision we had to made was, if we should replace our own PHP API library, which supports IDE code-completion, with the official one that was release after phase 2 and doesn’t support code-completion. We decided to keep our own library and extend it with the new functionalities, because the OST team always care about backward compatibility, so we can rest assure once an API is final, our library will not suddenly stop working. At least we will follow this path as long as we won’t run in bigger troubles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*vCHSw6Fe0rATXGrzZI6tTA.png" /></figure><p>Therefore this week was all about orientation and exploring the new possibilities with the new API and analyzing the existing PHP library.</p><p>Next week we are going to upgrade our test systems to the newest CS-Cart version and extend our PHP API library with the newest changes and publish it on Github. Besides that we will publish our solution to install CS-Cart (and optionally our extension) via composer and command-line on Github too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*Q2R1boOg129RZfyJC9j0cw.png" /><figcaption>composer.json for installing CS Cart and OST Loyalty (or and other extension) automatically</figcaption></figure><p>Stay tuned! The challenge is just starting.</p><p>Read more:</p><ul><li><em>OST Loyalty 2.0 — Week 1: The Kick-Off (this article)</em></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-2-the-foundation-8ecb1a2ed175">OST Loyalty 2.0 — Week 2: The foundation</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-halfway-look-back-813e630e8b81">OST Loyalty 2.0 — The halfway look-back</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-3-the-wallet-3701b4121ee8">OST Loyalty 2.0 — Week 3: The wallet</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-week-4-the-stage-d58e55a6643b">OST Loyalty 2.0 — Week 4: The Stage</a></li><li><a href="https://medium.com/@techupbusiness/ost-loyalty-2-0-the-finalization-16fadb6e3e04">OST Loyalty 2.0 — The finalization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33e78e167718" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>