Posts

OpenAi is Great But Does It Know How To Code a Dapp On Hive? Of Course It Does...

avatar of @jerrythefarmer
25
@jerrythefarmer
·
·
0 views
·
8 min read

I would go as far as making a bet that it provides better explanations and contains more knowledge about Hive than 90% of Hive users which would include me as well ofc... I'll try to make this short as possible so let's dive right into it.

How Good Is It?

If you haven't seen me around these days it was because I was miles deep into the AI rabbit hole. GPT3 is so good that it can't even be put into words but the good part is that you won't be losing your job.

You can write code if you have no coding experience but if you don't know the entire structure including the backend of a complex website you have very slim chances of creating one using AI. BUT, if you spend some time asking it to teach you all of these things...

It also won't write your content for you, that just doesn't work. The tone is very robot-like and a lot of times it will use the same phrases over and over again. BUT, just like with coding, if you start giving it some inputs that require it to change the tone, structure, level of detail... It can create a kickass article but you will probably need to type in more words than what you would spend on writing it.

All in all, it is a great assistant. If you could hire someone that can do the same things as OpenAI you would do it in an instant. All of the small things that you don't like doing can just be outsourced to the AI. It's so good you can just copy and paste article revision requests from your clients and it will do an amazing job at applying exactly what they asked for. Don't just take my word for it, give it a try while it is free and see for yourself.

What we are really here for is Hive. And boy are you in for a treat...

Ai on Hive?

The following is a transcript of my conversation with the AI about Hive. At first, it was acting like it can't access the internet and knows nothing about Hive but if you know how to lead it in the right direction it starts doing some magical stuff. I'll cut out that part to make the transcript as short as possible.

Input: Is Hive dpos?

Output: Hive is a blockchain and cryptocurrency that was created as a fork of the Steem blockchain. Hive uses a variant of the Delegated proof of stake (DPoS) consensus mechanism to achieve distributed consensus and secure its network. In Hive's DPoS system, token holders can vote for "witnesses" who are responsible for maintaining the blockchain and producing new blocks. The top 20 witnesses by vote are chosen to produce blocks and earn rewards. This allows Hive to achieve high transaction speeds and low fees, while also giving token holders a say in the direction of the network.

Input: Why was there a fork from Steemit?

Output: In March 2020, the Steemit blockchain underwent a contentious hard fork due to a disagreement between the Steemit team and the Steem community over the direction of the project. The hard fork resulted in the creation of two separate blockchain and cryptocurrency networks: Steem and Hive.

The specific details of the disagreement are complex and varied, but at a high level, the Steemit team and the Steem community had differing opinions on how to best govern the Steemit platform and its associated cryptocurrency. The Steemit team wanted to centralize control over the platform, while the Steem community wanted to maintain a decentralized approach. Ultimately, the hard fork was seen as a way to allow each side to pursue its own vision for the future of the project.

Input: Was Justing Sun involved in this?

Output: It is not clear whether Justin Sun, the founder of the TRON Foundation and CEO of BitTorrent, was directly involved in the hard fork of the Steemit blockchain. In the months leading up to the hard fork, however, Sun and the TRON Foundation did play a significant role in the broader controversy surrounding Steemit.

In February 2020, Sun and the TRON Foundation acquired a controlling stake in Steemit Inc., the company behind the Steemit platform. This sparked backlash from some members of the Steem community, who were concerned about the potential centralization of the Steemit platform and the possible impact on its decentralized nature.

In the weeks leading up to the hard fork, Sun and the TRON Foundation took actions that were seen as attempts to consolidate their control over the Steemit platform, which further fueled the disagreement and ultimately led to the hard fork. It is not clear, however, whether Sun was directly involved in the decision to fork the Steemit blockchain.

Input: Is Hive only used for blogging?

Output: Hive is a blockchain and cryptocurrency that was created as a fork of the Steemit blockchain. While Steemit was initially created as a blogging and social media platform, Hive is not exclusively used for blogging and has a broader range of potential use cases.

Hive is a decentralized platform that allows users to create and curate content, earn rewards, and interact with one another. In this sense, Hive is similar to Steemit and other social media platforms, and it can be used for blogging and other forms of online publishing. However, Hive is also a blockchain platform with a built-in programming language, which allows developers to create decentralized applications (dApps) on top of the Hive network. This opens up a wide range of potential use cases beyond just blogging, including games, marketplaces, and other types of applications.

Input: What language is used to develop dapps on Hive?

Output: Hive is a blockchain platform that uses a programming language called HiveSQL to allow developers to create decentralized applications (dApps) on top of the Hive network. HiveSQL is a variant of the SQL (Structured Query Language) language, which is a widely-used and well-known programming language for working with databases. HiveSQL is designed to be easy to use and understand for developers who are familiar with SQL, and it allows developers to create and interact with data stored on the Hive blockchain in a similar way to how SQL is used with traditional databases.

In addition to HiveSQL, Hive also supports other programming languages and tools that can be used to develop dApps. For example, developers can use the Hive API to interact with the Hive blockchain from other programming languages, and they can use the Hive Keychain to manage their keys and sign transactions securely. This allows for a high degree of flexibility and creativity when it comes to developing dApps on the Hive platform.

Are you ready for it?

Input: Write a sample of this HiveSQL code

Output:

Input: If I wanted to deploy this code on the Hive blockchain how would I do it?

Output: To deploy this code on the Hive blockchain, you would first need to set up a Hive account and obtain some Hive tokens, which are used to pay for transaction fees on the Hive network. You can then use a Hive wallet or other Hive-compatible tool to access your account and interact with the Hive blockchain.

Once you have set up your Hive account, you can use the HiveSQL language to write and deploy your code on the Hive blockchain. HiveSQL is a programming language that is specifically designed for working with the Hive blockchain, and it provides a set of commands and functions that allow you to create and interact with data stored on the Hive blockchain.

To deploy the code example provided earlier, you would first need to create a HiveSQL script that contains the code. You could then use the hive command in your Hive wallet or other tool to execute the script and deploy it on the Hive blockchain. This would create the "users" table on the Hive blockchain, insert the data into the table, and query the table to show the data that was inserted.

Note that this is just a very basic example, and there are many other ways in which you can use HiveSQL and the Hive blockchain to create and deploy more complex and sophisticated applications. You can learn more about HiveSQL and how to use it by reading the HiveSQL documentation and exploring the Hive community forums and resources.

At this point, I had to push things further and they just got crazier by the minute. Btw if you know if this code works or not please let me know in the comments below!

This code creates a table called "swaps" that will be used to track swap transactions, and it defines a function called "swap_hive_hbd" that can be used to perform the actual swap. The function takes the user's ID and the amount of Hive that they want to swap as input, and it uses the current HBD/Hive exchange rate to calculate the amount of HBD that the user will receive in the swap. The function then updates the user's account to reflect the swap, and it inserts a record into the "swaps" table to track the transaction.

To use this function, you would call it with the appropriate user ID and Hive amount as arguments. For example, you could call swap_hive_hbd(123, 10) to perform a swap for user 123 where 10 Hive are swapped for HBD. The function would then return the amount of HBD that was received in the swap, or 0 if the user does not have enough Hive to perform the swap.

After a few tweaks, I told it to clean up the page a bit and add a button that would connect your keychain wallet. Of course, it knew exactly what Keychain is.

Put all that together and you get this.

I could go on and on with changing the colors, background, adding images, and anything else that comes to mind but the main point is this - If you can think it the AI can do it and it will keep explaining it to you while doing it. You will never need an online course again because this is like a 100x improvement.

My Mind Is Still Blown

I'm still overwhelmed by the notion that there is virtually no limit to this thing. People are too scared that this will take their jobs but they don't realize that their job is done and a new one begins. All of the content you ever created went into training this thing and now it is paying dividends.

Why write articles when you can write code?

Why rant about a dapp when you can make a better one and let the AI do the explaining why that other one sucks?

Why criticize anything when you can just make a better version of it?

The best way to describe GPT3 is in the form of a machine that can mold your ideas into different shapes and forms on demand. Anything that can be expressed in textual form can now be modified in any way you want and for GPT4 they announced text-to-video features if I'm not mistaken. With this thing you can rewrite movies and create your own versions in a matter of hours.

Just think of the possibilities...

Final comments:

The OpenAI chat bot is free but is outdated. It goes back to 2021 and has no recent data so if any changes happened during that time regarding code or some real-world events it will not know. However, the up-to-date version is also free if you create an account with OpenAi. It requires an Email and Phone number. This gives you access to Dalle2, the image generator and $18 of free credits on the up-to-date AI bot.

For the conversation above I used the free version.

Btw, if you don't mind giving away your phone number and personal data (if you share any in the conversation with the bots) I added a link above but here it is again in case you need it.

Posted Using LeoFinance Beta