Scatter and the EOS JUNGLE (testnet)!

in #eos7 years ago (edited)

lion.jpg

Using Scatter with the Jungle EOS Testnet

We are oh so close to the EOS Mainnet launch! However, while the kinks are worked out or while you are testing your dApps having a trusty testnet to hook into is extremely valuable.

In this quick tutorial we'll be connecting our Scatter dApp to the Jungle testnet. We'll be taking the following steps:

  1. Create an account on the Testnet
  • This requires generating two private / public key combos to assign as Owner and Active keys. We can do this in many ways, but for brevity we'll do so here
  1. Add the Jungle Testnet to our Scatter Extension
  • If you're building a dApp you can "suggest" the testnet automatically to your users.
  1. Import our private / public keys into Scatter and create an identity.

Step One - Creating a Jungle Testnet account

Every EOS account requires an Owner and an Active key. The Owner key has superpowers, and as such it should be stored as safely as possible. The Active key is your day to day usage key. You shouldn't be careless with it, but it's the key you'll be using to interact with most dApps. Hence, we'll be generating two private / public key combinations. Please store and keep your private keys private.

Alright, head over to https://nadejde.github.io/eos-token-sale/ and click on "Generate EOS Key". This will spit out a new private / public key combo. Save this somewhere safe... and then refresh the page and repeat the process.

Screen Shot 2018-06-04 at 7.48.53 PM.png
Screen Shot 2018-06-04 at 7.49.39 PM.png

Now that we have our keys, let's head over to the Jungle testnet site and click on "Create account".

Screen Shot 2018-06-04 at 7.58.20 PM.png

Here we'll be asked for an account name. Take note of the very specific account name restrictions specified for EOS. Once you choose your name, go ahead and enter it. Now it's time to paste in your Owner public key and your Active public key. Again... make sure you are pasting in your public keys. They'll start with "EOS...". Once you've done this go ahead and click create. If all goes well and the name is available you'll see something like this:

Screen Shot 2018-06-04 at 7.58.38 PM.png

Now let's double-check that the account was created. Close that window and on the home page click on "Account info" and type in your new account name and click "Get". You should see the information of your newly created account, unfortunately with zero balance. We'll fix that in a sec. (Special note here: As of this writing, the testnet is creating the account with the same Owner and Active key. Double check this under account info and we'll use that when importing to Scatter).

Let's get some test EOS and Jungle tokens into this account. Hit the "Faucet" link and type in your account name and click "Send coins".

If you go to account info again, you'll see you now have some EOS and JUNGLE to play with :).

Step Two - Adding the Jungle testnet to scatter

There are two ways to add the testnet to Scatter. One of them is as a user, where we'll manually add it. The other way is programmatically as a dApp developer and suggest adding it automatically for your users.

First let's cover the manual option. We'll go to the Scatter extension, then choose "Settings > Networks > New". We should see a menu like this:

Screen Shot 2018-06-04 at 8.08.04 PM.png

Add in the address "dev.cryptolions.io" and the port "38888" and hit "Save".

Screen Shot 2018-06-04 at 8.10.38 PM.png

This will add the testnet to your list of networks.

Screen Shot 2018-06-04 at 8.11.58 PM.png

dApp developer sidebar - suggesting network automatically.

To suggest a testnet to your users automatically, we can reference this from the Scatter documentation.

We'll configure the network options as so:

const network = {
    blockchain: 'eos',
    host: 'dev.cryptolions.io',
    port: 38888
}

scatter.suggestNetwork(network);

This will prompt the user via Scatter to add this network to their extension automatically.

Screen Shot 2018-06-04 at 8.18.53 PM.png

Step Three - Importing our keys into Scatter and creating an Identity

This will be our last step to have Scatter and the Jungle testnet playing nice. Typically I'd suggest importing your "Active" key here. Unfortunately, the Jungle testnet as of this writing ends up duplicating one of your keys and using it for both Owner and Active.

Let's double-check which key our account ended up with. We go back to the Jungle testnet site and click on "Account info". If you look just a couple of lines down you'll see your Owner and Active public keys.

Screen Shot 2018-06-04 at 8.23.24 PM.png

You'll notice that it's unfortunately the same. That's ok. Let's look up which of our private keys corresponds to the pubic key listed. Once you have it, let's add it to Scatter.

In Scatter, select the "Key Pairs" option. You can name it whatever will help you remember the combo. Once you add the name, copy / paste the private key that corresponds to the public key we checked earlier and click "Save"

This will add it to your list of key pairs.

Screen Shot 2018-06-04 at 8.26.37 PM.png

Screen Shot 2018-06-04 at 8.41.31 PM.png

Alright... now for the final step. Creating a Scatter identity!

Let's go ahead and select the "Identities > New" option in Scatter. Under accounts make sure you select the "EOS:dev.cryptolions.io" network we added earlier. Under the "None" dropdown select the named Key Pair we also added earlier and click on "Import"

Screen Shot 2018-06-04 at 8.49.47 PM.png

Screen Shot 2018-06-04 at 9.03.02 PM.png

Screen Shot 2018-06-04 at 9.11.13 PM.png

Here go ahead and select the "Active" account. Click on "Use Selected Account". You'll see the account name being added. What is happening here is that the same public key is assigned for both Owner and Active and Scatter wants us to select which of the permissions levels to use. As you can see, there are other options that can be added for your Scatter / RIDL identity. These are very neat and the applications are interesting. Go ahead and read up on those on the Scatter site. Think of a single oAuth across many sites (dApps) via EOS. For now we'll leave those blank and hit "Save" on the top right corner.

Screen Shot 2018-06-04 at 9.11.36 PM.png

You'll see that a random identity is created for you. In my case here it's "RandomRhyno...". We are all setup! One way we can quickly confirm this is by using the token balance feature of Scatter.

In the bottom-left corner, you'll see a "circle" button. Click on that and you'll see your token balances appear!

Screen Shot 2018-06-04 at 9.13.37 PM.png

SWEET! We are all setup to use Scatter with any dApps on the Jungle testnet. That's it for now. If this was helpful and you want to show some thanks via Eth for now... you can do so via an ETH dApp that me and the Sense team worked on here:

https://ether.dm/0x2794d1321035f0ef2faad52e21cad2ef82362835

(And of course the EOS version is in the works 🚀)

PS: Sorry for the unresized images... figured it was better to get this out than to spend all night figuring this out 😛

Sort:  

great post! do you know how to register account on mainnet?

That's pending at the moment. Once the mainnet goes live, I'll dig in and write something for it :)

Great tutorial, and perfectly complements the 'EOS Voter' voting site we have published which currently connects to the Jungle Testnet - feel free to try it out with your newly created Jungle test account - details are all here https://steemit.com/eos/@eosphere/eos-voter-eos-voting-portal-with-scatter

Nice job @ajose01! I'm going to utilize this post for mine! :D

Congratulations @ajose01! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

This video tutorial may help too:

Coin Marketplace

STEEM 0.24
TRX 0.25
JST 0.040
BTC 93819.40
ETH 3392.19
USDT 1.00
SBD 3.40