OneLoveDTube uploader v0.9 Beta 1: Introducing support for Avalon testnet.

0.9b1 update thumbnail.png

Repository

https://github.com/techcoderx/ipfsVideoUploader

Pre-release info

The release of this beta release is to allow users to optionally post videos to Avalon blockchain (currently in testnet phrase, will be implemented on DTube 0.9 update) while posting them to Steem with the current JSON specification for DTube 0.8, without going through the hassle of making the post separately on new DTube website.

In order to achieve the above, it is necessary to make the code changes early to give some time for the users to utilize the testnet, before the mainnet launch. Therefore, this update post is released to comply with Utopian's guideline on commits as they must not be more than 14 days old.

In an event of a bug that was not present on v0.8.5 release, please notify me by making an issue on the repository, or contacting me on Discord techcoderx#7481. A rollback to the previous stable release (v0.8.5) on the live website is always available when an issue arises.

What's new

Avalon testnet support

The main spotlight of this beta release is the ability to utilize the new Avalon blockchain, which is in the testnet phrase at the moment. Since the JavaScript module for Avalon, jAvalon, is only available as a NodeJS server dependency, I have to use Browserify on all client-side JavaScript files. Therefore, to update to this beta, it is necessary to compile those files by running npm run build after installing Node dependencies.

Logins

Commits:

Users will be presented with a new login interface, with an option to log in with Avalon username and key, alongside with either Steem Keychain or SteemConnect. Avalon logins will then be stored in the browser with sessionStorage so that it can be accessed by the upload page to sign transactions later. If Avalon login fields are not filled out, all features related to Avalon will not be displayed, and related features will be disabled on the upload page.

In an event of a release of a more secure authentication method for Avalon blockchain accounts (e.g. native support on Steem Keychain, or release of a SteemConnect fork for Avalon), they will be considered for implementation in future code updates.

Custom keys need to have transaction type 4 (or COMMENT) authorized in order to authenticate and sign transactions. They may be created through channel pages on new.d.tube website, under the "Keys" tab.

Crossposting to Avalon (new DTube)

Commits:

On Avalon, all posts broadcasted onto the blockchain are self-voted using vote tokens, which generate depending on how much DTC (DTube tokens) an account has.

Screenshot 2019-06-23 at 11.04.54 PM.png

The vote weight slider above will be shown if Avalon login is detected, under the "Basics" tab. If the user adjusts the slider above 10%, a warning will show up alerting the user that they're using a significant amount of vote tokens in their account (10% vote on Avalon is completely different from a 10% vote on Steem).

document.getElementById('avalonvw').oninput = () => {
    let avalonVW = document.getElementById('avalonvw').value
    document.getElementById('avalonvwlabel').innerText = 'Avalon vote weight: ' + avalonVW + '%'
    if (avalonVW > 10)
        document.getElementById('avalonhighvwalert').style.display = 'block'
    else
        document.getElementById('avalonhighvwalert').style.display = 'none'
}

for those who asked for code samples, here you go 😉

If logged in with Avalon, a new post will be made on Avalon testnet chain alongside the Steem post. The user will still be redirected to the current version of DTube (just like v0.8.5 of the uploader). At the same time, the video will be available on new.d.tube as well.

As for the tags, the second tag broadcasted onto Steem (the first tag is always dtube) will be the first curated tag on Avalon posts.

Here is an example: https://new.d.tube/v/techcoderx/QmedMWg9BAicneQQax7LouQpUsMGGiBJkke6bPACnVFB95
(the permlink for DTube 0.9+ posts for IPFS video uploads will be the IPFS hash of source video)

Custom beneficiaries setting

Commits:

Another feature that is not present on the official DTube uploader, it is possible to add custom beneficiaries for DTube posts on Steem, in addition to the 2% fee to @dtube to support their curation and development efforts. This is now available in the Advanced tab, as shown below.

Screenshot 2019-06-24 at 11.04.12 AM.png

This feature is currently not applicable to posts broadcasted to Avalon testnet.

General uploader stats

Commits:

An API has been added to get the number of lifetime uploads by all users, and another one to get total disk usage for all users. These APIs will be called when the welcome page is loaded to show uploader statistics to site visitors.

The /totalUsage API call is also useful for determining the disk space requirements when running the sync.sh script, as it loops through usage.json file to tally up the total disk usage.

let usageData = JSON.parse(fs.readFileSync('db/usage.json','utf8'))
getAllUsage: (type,cb) => {
    let totalUse = 0
    for (let key in usageData) {
        if(usageData.hasOwnProperty(key)) {
            let use = usageData[key][type]
            if (!isNaN(use)) totalUse += use
        }
    }
    cb(totalUse)
},

Looking at the current stats, we have 468 unique DTube videos uploaded since the first announcement, with file sizes totalling 106 GB. Not too bad for the first 8 months!

Screenshot 2019-06-24 at 11.20.23 AM.png

Road to v0.9 final release

  • SCOT integration
  • Thumbnail swap tool for posts on Avalon
  • Revival tool to make old videos playable again
  • Disk usage stats for user when logged in (and an alert as it approaches the quota)

The JSON format for json_metadata for Steem posts can be updated easily to the new format when DTube 0.9 finally releases.

Github account

https://github.com/techcoderx

H2
H3
H4
3 columns
2 columns
1 column
6 Comments
Ecency