Things to do while in Quarantine, as seen by Bitswift — Episode 2: Smart Contracts for Free Crypto Bitswift.press Follow Apr 4 · 8 min read

Episode 1 recap:

Previously on Things to do while in Quarantine we reviewed how to set up Linux on Windows using WSL feature in Windows. We then proceeded to install the Ardor server for Linux running on Windows, where we accessed the Ardor interface via our web browser.

If you want to review the previous Episode check here: https://bitswift.press

In this Episode 2 of Things to do while in Quarantine we will learn how to set up our previously created Ardor node using WSL to earn free Ignis rewards from the Ardor platform by way of Smart Contract. By participating with this Smart Contract we are passively

Increasing the number of Open API nodes on Ardor (allowing apps to use open nodes for their functions)

Encouraging the upgrade of nodes to the latest version. (Ensuring consistency across node version and providing an incentive to update)

Increasing the overall number of permanent and stable online nodes. (making the network stronger)

Provide Additional Archival Nodes (maintain nodes on the blockchain which are preserving the entire history of the chain, including its pruned data)

Sounds pretty cool, doesn’t it? Well, it is..and it’s a smart thing to do while stuck in quarantine, so let’s get at it.

Step 1. Configure the Node

As per Jelurida, to participate in the node reward program users need to set up a node with at least the peer port open to the Internet and a public and static IP address. If your node also has the API port open or it’s an archival node it may be eligible for additional rewards. You can participate with as many nodes as you want as long as each node uses a different IP address.

While we did get our WLS node setup in the last episode, we really did not do any configuration to dictate how our node will operate or what services, if any it would support. For example, we can tell our node to broadcast a hostname to its peers or to act as an archival node for the rest of the network. These settings are configured in a text file known as “nxt.properties”.

To configure our node we need to create and edit the nxt.properties file, for within this file exists all possibilities of the universe including unlocking free Ignis rewards from the Ardor platform.

For more information about the nxt.properties file or to see an example check here:

https://ardordocs.jelurida.com/Nxt-default_properties_configuration_file

Now, as they say, onward to free crypto and the eligibility for additional crypto rewards!

Let us browse into the directory below that we will create the nxt.properties file in. If you are not sure how to change into this directory check Episode 1.

ardor/conf/

Note that by default the config file will not exist so first, you will have to create it. Create the file using your crypto nerd wizardry with the following command on your WLS node terminal:

vi nxt.properties

Now we will add some juice to this file to earn those Ignis crypto rewards. As per the Smart Contract rules stated, we need to make our node operate as an Open API and Archival node. To do this add the following commands to the config file to prepare it for earning free Ignis rewards.

Add this for OpenAPI:

nxt.allowedBotHosts=*

nxt.apiServerHost=0.0.0.0

Add this for archival:

nxt.maxPrunableLifetime=-1

nxt.includeExpiredPrunable=true

If you are doing things properly it should look something like this:

Now that you have added the above parameters lets save our nxt.properties file and exit vim text editor. To do this press the ESC key and type the following command:

:wq

and push enter, you can push enter a few times if you want for good luck.

Great, the juice has been loaded into the node config file. We are one-stop closer to earning free Crypto rewards via Smart Contract and declaring our victory.

Now. Let us pause here for a commercial break.

Did you know you can claim free crypto on https://bitswift.cash? Every day, claim away, the choice is yours don’t delay. Bitswift.cash community assets, governed by mathematics, claim, claim, claim your crypto!. (some funky music playing in the background)(static) 9–6–7–11–11 Call Pizza PPizz…

Un pause.

Welcome back, that was weird.. damn those pesky commercials… now let’s continue with the remainder of the episode.

Part 2 — Verifying node config and services

Now that your node is configured let’s launch it and then check to ensure it’s running the Open API and Archival services. If you forget how to launch your WLS node please check back to episode 1.

To verify your node’s services you can check it here: https://explorer.jelurida.com/ardor/.

Click on the nodes button at the top of the page:

Type in your public (and static) Ip address into the search field on that page.

Ensure your node is reporting its an Archival and Open API node. Note if your node is not reporting and you just started it up, give it a few minutes (or even a few hours) to report its stats on the explorer.

It should look something like this under the “Services” section if you have done the job right:

Great, now our node has been configured properly, and we have verified on the blockchain explorer that our node is reporting the proper services running in order to earn the Ignis rewards. Now we will proceed to the final step, which is registering our node with the Smart Contract on the Ignis chain which will deliver us free Ignis based on how long our node has been online.

Step 3: Register the Node with the Smart Contract

While your WLS Ardor Server is running, open up your web browser and launch the Ardor GUI by browsing to the following address:

http://localhost:27876/index.html

Now login to your ARDOR account, if you don’t have one already create one and log in. Note that you will need some Ignis on the account to pay the fee to broadcast your message to the Contract Reward account.

Now to register for the Smart Contract Rewards we need to send a message to the Contract Runner that is account @noderewardardor, so follow the below instructions which I have conveniently copied and pasted from Jeluridas instructions to make my life a little easier.

Send an encrypted message on the IGNIS chain with your node’s IP address to the account with aliasthe @noderewardardor . The sender of this message is the account that will receive the rewards. You can use the same account for different nodes.

When selecting the account a Contract Reference input dropdown menu will appear. Please select NodeReward . The message text box should be populated with a JSON template. Put your node's IP address as the value of the nodeAddress parameter (replacing the [String] part). The message should be encrypted and prunable so make sure the Encrypt Message is checked and the Message is Never Deleted is unchecked. It should look like this:

If the message is correct you will receive an encrypted message back with a 30 char unique string that you should put in the platform field of your node.

If you look at the transaction info on the replied message and decrypt the contents you should see something like this:

The 8b0340fffe7371a34ca71c67ac749f part inside the encrypted message is the unique token assigned to your node. Make note of your token because we will now publish it into our nxt.properties config file to complete the tasks.

Step 4. Publish your Token

Finally, you need to publish the token as the platform string for your node. To do so set the received string as the value of the nxt.myPlatform property in the node’s nxt.properties file and then restart the node. Check steps 2 for editing the nxt.properties file to add the nxt.myPlatform property to it. Following the previous example the line on nxt.properties will look like this:

nxt.myPlatform=8b0340fffe7371a34ca71c67ac749f

or if you like visual representations it will look like this:

Save your nxt.properties file and restart your node.

Check the FAQ if you need help with setting the node configuration using the nxt.properties.

Congrats! You made it to the end with me. That’s all there is to it, your node will now start earning free Ignis through this Smart Contract. You can now leave your WLS node running and it will harvest passive crypto tokens (Ignis) from the blockchain. So now you have an Ardor Linux server running on Windows that is going to generate free crypto-currency for you so long as you leave it on, clearly, we are living in the future!

A credit of Ignis from the Smart Contract shortly after completing the above steps in this episode.

There are plenty of other ways to earn free-crypto throughout the Bitswift ecosystem. Our forging pool, bitswift.cash service, bundling Bitswift transactions, community giveaways, and promotions are all examples of how you could be benefiting from the Bitswift ecosystem.

We are committed to connecting businesses and individuals to the blockchain the way it was intended. That means educating people on methods they can use to generate value in the token economy, and ensuring the technology is integrated properly, leaving the end-user in control of their personal digital information.

Catch us next time in Episode 3 where we will cover more useful features relating to the Bitswift blockchain and its related digital assets.

Over and out.

Bitswift

PS. https://www.youtube.com/watch?v=LRDxUUhq9M4