Getting started with testnet

The ThreeFold Grid is actually threefold in itself, composed of the networks: main, test, and dev. New versions of 0-OS and their associated new features are deployed for testing to dev and test first, before going live on the main grid. Any farmer can choose to run their node on any of the three networks, by configuring their 0-OS boot process accordingly.

With the beta launch of the new marketplace, certain exciting features, like capacity pools and easy website deployment, are only available on the testnet marketplace. So, there’s now a great reason for a wider audience to want to play on testnet, and this post is intended to provide instructions to get started.

Please note: the following instructions aren’t based on the latest version of 3Bot and therefore make things much harder than they need to be. Proceed with caution.

Testnet Tokens

Probably the most confusing aspect of testnet is that it uses versions of the ThreeFold tokens (TFT, TFTA, FreeTFT) which live on Stellar’s own testnet. Like the TF Grid, Stellar operates a separate testing network, where assets are assumed to not have any value and anyone can experiment with Stellar’s features. To make capacity reservations on the TF testnet, we’ll need a Stellar testnet wallet with trustlines for these tokens and some tokens to use. The good news is that there are easy tools to get this setup in just a few minutes.

Stellar Testnet Wallet

To generate a wallet on Stellar testnet, we’ll use the Stellar Laboratory. You’ll also need a running 3Bot admin interface, either deployed locally with the SDK or deployed on the Grid using the marketplace, to add the new wallet to your 3Bot.

Go to the test network account creation tool, generate a new keypair, and fund the wallet with the friendbot. This just requires hitting the “Generate keypair” button, clicking the “Fund…” link, and then pressing the “Get test network lumens” button below. We’ll need the test network lumens in order to get our wallet included in the test network ledger, as every wallet on Stellar requires a small amount of lumens to be activated.

image

Now, copy the Secret Key from this page, and choose the Wallet’s Manager in 3Bot’s admin interface from the navigation bar on the left. You’ll now see the Import Wallet button in the upper right hand corner of the page, below your 3Bot name. Click that, then choose “TEST” from the Network Type drop down menu, enter a name, and paste the secret key from Stellar Laboratory into the Secret field.

3Bot will automatically set up trustlines for TFT, TFTA, and FreeTFT on Stellar’s test network. Now we’ll be able to fund this wallet with some testnet FreeTFT.

Getting Testnet FreeTFT

Like on mainnet, you can get some FreeTFT for testing on testnet. Unlike mainnet, this happens automatically without needing human approval. Just go to the FreeTFT Testnet Faucet, login with your 3Bot app, and enter the public key from your new testnet wallet, also shown as the Address when you double click the wallet in 3Bot’s wallet manager.

The faucet will automatically fund your testnet wallet with FreeTFT, which you can verify in 3Bot admin:

image

Testnet Marketplace

Now we’re ready to go deploy a solution on the testnet marketplace. While this won’t be a full tutorial on the marketplace, there are a couple things to note.

First, very limited free capacity is currently available on testnet, as you can see in the testnet explorer. If you are able to reserve some of this capacity please be mindful to use only what you need and only for the duration needed to test it. As of the time of writing, I understand there is an effort to bring more free capacity online for testnet.

Second, testnet deployments require a capacity pool as a first step. This is a cool new feature that will allow deployments to maintain life beyond the usual expiration date system, by “topping up” the capacity pool with more tokens. Start there, then deploy a network, and finally solutions within it as usual.

Paying for Testnet Capacity

Unfortunately, it’s a bit of a manual process to pay for capacity reservations on testnet. The reasons for this are that the testnet marketplace doesn’t support making payments directly from wallets added to the 3Bot wallet manager and the 3Bot app doesn’t support Stellar test network wallets. This means that we’ll have to create the transaction using Stellar Laboratory (or using another wallet app that supports test network). Not to fear though, this isn’t too hard and could be seen as a fun opportunity to get behind the scenes a bit with Stellar transactions :slight_smile:

When you reach the payment step in a marketplace reservation, you’ll see a screen like this:

image

Open Stellar Laboratory’s Transaction Builder, and fill in the fields as follows:

  • Source Account will be your wallet public key/address, the same one we used in the FreeTFT faucet form earlier.
  • Transaction Sequence Number - use the “Fetch next sequence number” button to fill this automatically
  • Base Fee can be left as 100
  • Memo - choose “Text” and enter the Reservation id from the payment page
  • Time Bounds is optional and we don’t need to specify

Next, set up the payment operation as follows:

  • Operation Type - select “Payment”
  • Destination - copy the Wallet Address from the payment page
  • Asset - choose “Alphanumeric 12” and enter “FreeTFT” as the asset code
  • Issuer Account ID - enter GBLDUINEFYTF7XEE7YNWA3JQS4K2VD37YU7I2YAE7R5AHZDKQXSS2J6R (this is found on the payment page under Currency, after “FreeTFT:”
  • Amount - copy the Total Amount from the payment page

Then scroll down (no need to hit Add Operation, that would be for a second operation), and click the Sign in Transaction Signer button. On the next page, do the following:

  • Copy the secret key for your Stellar test network wallet, which can be found in the 3Bot wallet manager by clicking Show Secret, and paste it into the Add Signer field on the next page of the transaction builder under Signatures.
  • Click the Sign with BIP Path button, ignoring any error about a Ledger wallet
  • Click Submit in Transaction Submitter at the bottom of the page
  • Finally, click Submit Transaction to submit it to the network

Once you’ve submitted the transaction, go back to the marketplace and click the next button. After a short wait, you should be able to see your new reservation reflected on the relevant marketplace tab. Yahoo!

3 Likes

Awesome stuff once again Scott! thanks a bunch for posting.

1 Like