The absolute beginner’s guide to Playing for Keeps

The simplest, step-by-step instructions on how to get a Keep Network node running on the Ethereum testnet.

Jack Baldwin
44 min readSep 22, 2020

You should have heard of Keep Network by now: it’s the undeniable frontrunner in building decentralised finance applications around the Ethereum and Bitcoin blockchains.

If you’re following Keep, you should have also heard of Playing for Keeps, a monthly contest being run by the Keep Network team.

Playing for Keeps is a chance to learn how to stake KEEP tokens on the Ethereum testnet, and win KEEP tokens by contributing to the community.

Banner by @kather
Banner by @Kather

The monthly prizes have been running from 100 KEEP tokens, up to 100,000 KEEP tokens, with hundreds of winners each month. At the time of writing, one KEEP token was worth around one US Dollar — this is serious money!

There are two key criteria to sharing in the Playing for Keeps prizes:

  1. Running a KEEP Network node on the Ethereum testnet.
  2. Contributing to, and growing, the Keep Network community.

In this article, we’re going to focus on the first part — the second part is going to be up to you and your creativity.

Needless to say, there’s room for everyone to contribute: designers, marketers, engineers, developers, writers, translators— as long as you’ve got a handy skill and the will to get involved, you can be part of the Keep community.

I’m keen — let’s get this going!

Hold up tiger! I want to lay down some key points and considerations first:

Prior knowledge: this guide assumes you don’t have any prior technical knowledge — not of using cryptocurrency, running a network node, or fiddling with your computer’s command line.

I wrote this guide with the help of some friends — mostly writers and designers. None of us are very technical people.

We got our nodes setup and running after struggling with some of the existing guides, which are mostly built by and for software developers.

Those guides assumed we knew all sorts of technical stuff. Some of the steps seemed to make no sense, or skimmed over key bits of information, and caused us more problems down the track.

So, this guide is full of pictures, explanations about the tools you’re using, and other handy info that will get you through the process without missing a beat.

You might even learn something about blockchain along the way.

If you’re a pro — and know about ethereum wallets, network nodes, and you’re comfortable with Linux — you will be a step ahead here. This guide should still be maintained as the most up-to-date one out there, so it’ll work for you too.

We’ll try to break out the really basic information out so you can easily skip past it if you don’t need it.

What you need: not much. We’ve done our best to keep this guide as lean and mean as possible — you’re only up for the following:

  1. Time — this process takes a bit over an hour, and we recommend trying to get it done all in one go.
  2. Google Chrome — we will be using a Chrome extension to manage a connection to Keep’s dashboard.
  3. Credit card number or Paypal account — we won’t be spending any money, but one of the services we’ll use requires this when you sign up. They grant you free credit though, so you can just delete your payment information later on.

None of the money or tokens we’ll use today is real — it’s all ‘play money’ created on a test network. That means if you really screw up, you can just request more play money.

And, to be clear, at no point are you required to spend any of your money to get this up and running.

That’s it — let’s get this going!

We’re going to start with the first of six easy steps.

The six steps we’ll be undertaking today — from creating a wallet to launching a node.

1. Let’s create your first wallet!

First, we’re going to create an Ethereum Wallet that holds your ‘play money’ — testnet Ethereum and Keep tokens.

If you’ve never created an Ethereum Wallet before — don’t worry!

An Ethereum Wallet can hold different currencies on the Ethereum blockchain — like ETH tokens and KEEP tokens.

If you already have a wallet, we recommend starting with an entirely new one, just to be safe.

There are lots of ways to create an Ethereum Wallet. For this guide, we’re going to use a service called MEW’: My Ether Wallet.

MEW, or MyEtherWallet, is an easy-to-use platform that allows users to interact with the Ethereum blockchain.

Visit MEW from this link: https://www.myetherwallet.com/

An image of a internet browser showing the URL myetherwallet.com.

Make sure to double check the URL — there are lots of fake versions of MEW out there that bad actors have made to scam people out of their Ethereum tokens. You can see a screenshot of a validated MEW URL above.

An animated image showing a user creating a wallet using myetherwallet.com.

On the MEW homepage, click on ‘Create A New Wallet’, and then choose the second option: ‘By Keystore File’.

We should note that MEW have a big callout saying that ‘Keystore File’ is not the recommended way to create a wallet.

That’s usually true, but since we’re just working with ‘play money’ today, and only on a ‘testnet’, we’re going to go ahead and do it to make our life easier.

The keystore page on the myetherwallet.com website.

Enter a 9+ character password, and make sure you record this somewhere. We’ll need it later.

Once you’ve done that, MEW will quickly generate a new file for you.

The download keystore page on the myetherwallet.com website.

Click Download Keystore File and save it somewhere you’ll remember.
We’ll need it later.

The file will be called something like: “UTC — 2020–04–11T21–11–10.51”.

You can close the MEW site now — we’re all done with that platform for today.

The success page on the myetherwallet.com website.

Good job! You’re now the proud owner of your very own Ethereum wallet!

Quick recap: By now, you should have two things saved or recorded:

  1. A password for your MEW Ethereum Wallet written down; and,
  2. A keystore file saved to help you access the wallet (called something like UTC — 2020–04–11T21–11–10.51).

2. Put your mask on!

Next, we’re going to connect the Ethereum Wallet that you just created to a Google Chrome extension called MetaMask.

Metamask is a great tool that helps you access your Ethereum Wallet and connect it to decentralized applications.
The MetaMask extension homepage.

First, let’s get the MetaMask extension from the Google Chrome Web Store. Don’t worry — it’s free.

You can simply follow this link: https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en

Make sure you’re using Google Chrome — this won’t work on browsers like Safari or Edge.

MetaMask does have a Firefox extension as well — but we’ll be using Chrome for this guide.

An animated image of someone installing the Metamask extension on their Chrome browser

Add the MetaMask extension to your browser.

Chrome should pop up a box asking ‘Add “MetaMask”?

It will list some permissions that MetaMask needs to do its job — these are all okay, so click ‘Add extension’.

You’ll want to make sure that the MetaMask extension icon is pinned to your browser’s toolbar. It should do this by default — you’ll see the little fox face icon sitting in the top right of your browser.

But, in case it didn’t:

Click the ‘jigsaw’ extension icon on your browser’s toolbar.
Click the ‘pin’ icon next to Metamask
to keep the icon handy on your toolbar.

MetaMask should open a new page on your browser now — with its fox logo and a big blue button.

The welcome to MetaMask page of the MetaMask extension.

Click ‘Get Started’ to kick off the MetaMask process.

Unfortunately, MetaMask doesn’t give us the option from the very start to import our Ethereum Wallet using the Keystore file we created before.

That’s hidden in a menu that only unlocks once you create a wallet directly with MetaMask.

So, we need to create a wallet with MetaMask first, which will unlock the menu with the option to bring in our Keystore file afterwards.

Wait up! I can hear you asking:
“Hey
— why didn’t we just go straight to MetaMask and create a wallet here, instead of messing around with MEW?”

Good question. That is an option, but later on we need to look inside that Keystore file we created with MEW to help set up our Keep network node.

MetaMask uses a different method to create a wallet which doesn’t use a Keystore file.

It’s some more messing around now, to save us some effort later on.

Under, ‘Yes, let’s get set up!’, click Create a Wallet’ on the ‘New to MetaMask’ page.

The ‘New to MetaMask’ page of the MetaMask extension.

MetaMask will then ask to gather some data analytics — that’s up to you.

The analytics page of the MetaMask extension.

Then it will ask you to create a password.

Create a password.
Record this somewhere, as we’ll need it later.

The create a password page of the MetaMask extension.

We’re following this process through to unlock the option to import the Ethereum Wallet that we want to use with our Keystore file.

While we don’t need the wallet we’re creating now, we do need to hold onto the password.

We’ll use it to login to MetaMask itself later on — the extension will lock you out otherwise.

Next, it will give you the option to copy your Secret Backup Phrase. That’s up to you — as long as you’ve securely stored your MetaMask password, you should be okay.

If you were using real money and tokens on the wallets connected to MetaMask, we would strongly recommend you note down your Secret Backup Phrase.

It’s just a throwaway, so feel free to click ‘Remind me Later’.

The secret backup phrase page of the MetaMask extension.

Success! The party popper emoji is always a good sign.

Click ‘All Done’.

Now, we’ve finally unlocked the option to use our Ethereum Wallet of choice, by importing our Keystore file.

Click on the MetaMask icon on your browser’s toolbar.

Click on the ‘mosaic’ multicoloured circle icon on the top right of the MetaMask extension.

A picture of the MetaMask extension, after successfully creating a wallet.

Click ‘Import Account’.

The ‘import account’ option of the MetaMask extension.

This will open a new ‘Import’ tab on the MetaMask extension.

This has two options in the dropdown box: ‘Private Key’ and ‘JSON File’.

The Import Account page of the MetaMask extension.

Click ‘JSON File’.

What does JSON mean? It’s a type of text file containing ‘JavaScript’ code. In this case, it’s just another name for our Keystore file.

Click ‘Choose File’, navigate to your Keystore file named something like ‘UTC — 2020–04–11T21–11–10.51’ that we created earlier, and select it.

Enter the MEW password you created earlier in the password box.

A completed ‘Import Account’ page of the MetaMask extension.

Hit the ‘Import’ button.

If that worked —

Good job! Your Ethereum Wallet is now hooked up to MetaMask!

*Party Popper Emoji*

Before we finish with this step, let’s give your wallet a nickname so we can find it easily in the future.

Click on the 3 dots to the right of ‘Account 2’.

Click on ‘Account details’ .

The account details option of the MetaMask extension.

Click on the pencil icon to give your account a new name.

Renaming our imported wallet on the MetaMask extension.

Enter something like ‘Keep Testnet’.

Our wallet, renamed on the MetaMask extension.
Double checking our renaming worked on the MetaMask extension.

With that sorted out, we’re ready to move on.

Quick recap: By now, you should have four things saved and set up:

  1. A password for your MEW Ethereum Wallet written down;
  2. A keystore file saved to your machine;
  3. The MetaMask Chrome Extension along with its password; and,
  4. Your Ethereum Wallet imported onto the MetaMask Extension.

3. Get me some fun money!

Have you ever played Monopoly? Or messed around on the virtual stock market?

The Ethereum blockchain lets us play around with ‘fun money’ in the same way, by using an Ethereum blockchain ‘testnet’.

Welcome to the testnet — where everything’s made up and the points don’t matter — meme.

We mentioned testnets earlier in the guide, along with a bunch of other jargon — but we saved the detail until now to stop your head from exploding.

A testnet is an alternative blockchain that’s used for testing applications, contracts, and other things with ‘play money’.

We’re going to use the Ropsten Testnet. There’s a few different testnets, but Ropsten most closely mirrors the real-life Ethereum blockchain and operates with similar rules.

The Keep Network team uses the Ropsten Testnet to try out their applications, code and smart contracts before using them on the real Ethereum blockchain.

Before you ask, I have no idea what the name ‘Ropsten’ means.

Point me in the right direction!

Because we want to play with test money, and not real money, we’re going to point our Ethereum Wallet to the Ropsten Testnet.

An animated image of changing our Ethereum wallet network to the Ropsten testnet, using the MetaMask extension.
Changing your Metamask account to the Ropsten testnet.

Click on the MetaMask extension icon.

In the top middle of the MetaMask tab, there’s a dropdown box with ‘Main Ethereum Network’.

Click on that dropdown box and select ‘Ropsten Test Network’.

MetaMask will take a second to load the testnet, and you’re switched over. You won’t notice anything else change apart from the Network name for now.

So — let’s get us some fake tokens.

Turn on the tap!

Tokens on the testnets are usually given out via ‘faucets’.

What’s a faucet? Well, it’s a tap that gives out free money.

What is a faucet? A service that allows users to enter their wallet address and receive free tokens to their wallet.

You won’t find a Bitcoin or Ethereum faucet on the main network anymore — those tokens are worth too much for people to give away these days.

But, there are kind souls giving away fake money on the testnets for us to play with.

In order to get our test Keep Network Node up and running, we need to get two kinds of fake tokens on testnet:

  1. ETH tokens — Ethereum tokens; and,
  2. KEEP tokens — Keep Network tokens.

The first step in getting those tokens sent from a faucet to our Ethereum Wallet, is to get our Wallet’s address.

Address the issue.

Every wallet has an address. Think of that address like a postal address, or a bank account number, so people know where to send you money and tokens.

Click on the MetaMask extension icon.

Under the ‘Ropsten Test Network’ in the top-middle of the icon that we clicked on before, you’ll see your Wallet’s name and a greyed out string of numbers below.

Click on your Ethereum Wallet’s name.
MetaMask will copy your Wallet’s address to the clipboard, just like if you right click on something and select ‘copy’.

Double checking our renaming worked on the MetaMask extension.

Now, if you paste that copied text somewhere, you’ll see your Wallet’s full address.

It should look something like this: 0x8f076df6434f7a8da4793118f9f8cf82f958e319

All Ethereum Wallet addresses start with 0x, followed by a unique string of numbers —just like a street address has different numbers and street names. So of course, your address won’t be exactly the same as the one above.

From faucet with love.

Now we have our address, we can plug it into a faucet and get our testnet tokens sent to our wallet. Let’s start by getting our testnet ETH.

An animated image of sending test ETH from the Ropsten testnet faucet to our Wallet address.
Gif of getting your test Ethereum from the Ropsten faucet.

Go to the default Ropsten Testnet Faucet at this URL: https://faucet.ropsten.be/

The Ropsten Ethereum Faucet homepage.

You’ll see a message asking you to enter your testnet account address.

Paste your Ethereum Wallet address into that field,
and hit ‘Send me test Ether’.

Entering our wallet address into the Ropsten Ethereum Faucet homepage.

You’ll see a message showing that the transaction is now in process. You can click the link on that message to track when the transaction gets added to the blockchain and written into a block.

This can take a little while to process. Each faucet transaction on that website sends you 1 testnet ETH token.

We only need 1 ETH token to complete the process today, so you don’t need to hammer that button.

If the default Ropsten Testnet Faucet is down, MetaMask also provide a faucet which works exactly the same way — except, it already knows your Wallet Address thanks to the MetaMask extension.

In case you need it, you can find the MetaMask Faucet URL here: https://faucet.metamask.io/

Using the MetaMask Ether Faucet — if the Ropsten faucet is not working.

You can hit ‘request 1 ether from faucet’ and it will generate a transaction, just like the Ropsten Testnet Faucet website.

Whatever faucet you decided to use…

… when the faucet transaction is done, you can click on the MetaMask extension and it should show an amount of ETH now sitting in your testnet wallet.

These transactions can take a little while, so if it still shows 0 ETH in your wallet — just hold on for a minute and check again.

Note, if you pop back onto the Main Ethereum Network, your wallet will show up as empty — we only have play money, after all.

Finders, KEEPers.

You’ve got your testnet ETH. Now it’s time to get your testnet KEEP tokens.

The KEEP faucet is a little less user friendly. Instead of going to a website and entering your Ethereum Wallet address into a form, you actually include your address as part of the URL when accessing the faucet website.

First, let’s copy and paste the URL below— either into your Chrome address bar, or just into a notepad program to start with:
https://us-central1-keep-test-f3e0.cloudfunctions.net/keep-faucet-ropsten?account=YOUR_WALLET_ADDRESS

See the bolded part after the ‘=’ sign?
‘YOUR_WALLET_ADDRESS’?

Paste your Wallet address into that section. Now, it should look something like this:
https://us-central1-keep-test-f3e0.cloudfunctions.net/keep-faucet-ropsten?account=0x8f076df6434f7a8da4793118f9f8cf82f958e319

Once you’ve got that URL sitting in your Chrome address bar, hit enter and visit the website.

An animated image of navigating to the Keep Network faucet.

If the URL was all correct, the KEEP testnet faucet should grant you 300,000 KEEP tokens, just like that.

You can tell if it worked, if the first line of the page says something like:
Created token grant with 300000000000000000000000 KEEP for account: 0x8F076DF6434F7A8dA4793118f9F8cf82f958E319

Just like the ETH testnet transaction, this one might take a little while to process.

You can copy and visit the URL on the second line of the page to check the status of the transaction.

Great job! You’ve got your testnet ETH and KEEP sitting in your wallet.

Quick recap: By now, you should have six things saved and set up:

  1. A password for your MEW Ethereum wallet;
  2. A keystore file saved to your machine;
  3. The MetaMask Chrome Extension;
  4. Your Ethereum Wallet imported onto the MetaMask Extension;
  5. 1 testnet ETH token in your Ethereum Wallet; and,
  6. 300,000 testnet KEEP tokens in your Ethereum Wallet.

4. Make your fake money fake work for you!

Noone likes doing real work. Even less people like doing fake work. So, why not use your newly found fake blockchain money to make fake passive income for you?

This is called Staking.

James Bond plays high stakes hungry hippos — a meme. Shout out to the Hungry Hippo cafe, long live the Hungry Hippo.
High stakes action… on the testnet.

High stakes action!

Staking is the action of locking up tokens in your wallet to earn a reward, by keeping a blockchain running smoothly. Doing this makes you a staker.

On a ‘staking’ blockchain, a staker is randomly selected by the network to write the next batch of transactions onto the blockchain.

When they process those transactions, they earn rewards. This provides a financial incentive to stake tokens, and keep a blockchain running smoothly.

Staking also secures against bad behaviour.

Since a staker will have a lot of money tied up in that blockchain, they won’t want to attack it by messing with the transactions they process — they might lose their tokens, or their tokens could lose their value.

The particular type of staking we’re doing today is called Delegating.

It’s a delegate operation!

Since we have our Wallet, our test ETH token, and our test KEEP tokens, we’re ready to become a test staker.

Head to the Keep Network ‘Test Token Dashboard’.
The URL is here: https://dashboard.test.keep.network/tokens

The Token Dashboard is where we manage what our KEEP tokens do.

Right now, we’re limited to a couple of applications for our KEEP, but the Keep Network team are building out more as we speak.

Connect MetaMask to the Token Dashboard.
Under ‘Choose a wallet type’, click MetaMask.

An animated image of connecting MetaMask to the Keep Network token dashboard.

Since we’re all set up with MetaMask, it’s the easiest way to connect our Wallet with our test tokens to the Token Dashboard.

MetaMask will open a popup saying ‘KEEP Token Dashboard would like to connect to your account’. Click ‘Connect’.

It’ll take a moment to process the connection, and then it will return you back to the delegation page on the Token Dashboard.

Here, you should see the grant for 300,000 KEEP tokens that we received from the KEEP faucet earlier.

The Token Overview page of the Keep Network dashboard.

If they aren’t showing up yet… give the testnet some time. Your transaction may still be processing.

Click the ‘Manage’ button on the Granted Tokens card, on the homepage (pictured above).

Once again, your 300,000 token grant will be shown here.

Underneath, you’ll see a card called ‘Delegate Tokens’. This is where a staker can put up their stake, locking their tokens away on the testnet.

You’ll notice there are four fields to complete — Token Amount, Authorizer Address, Operator Address, and Beneficiary Address.

Actually, a ‘staker’ on the Keep Network is really made up of four parts:

  1. The Owner — this is the person who owns the tokens that will be staked. Although it’s not written on the Delegate Tokens page — you’re the person putting up the tokens, so by default, you’re the owner.
  2. The Authoriser — this is the person who authorises contracts on the network. They protect the staker from buggy upgrades and bad contracts.
  3. The Operator — this is the person who runs the day-to-day operations of the staker.
  4. The Beneficiary — this is the person who collects the rewards from staking.

We mentioned a moment ago that the particular type of staking we’re doing today is called delegating.

The reason for this, is that each of the four roles above can be filled by different people or groups — if we want them to.

For example, as a small operator, you may do everything yourself.

Or, you might outsource the ‘operating’ or ‘authorizing’ roles of the staker to a third party that does this professionally. They would charge a fee for helping to maintain your stake.

Finally, you might want to send your rewards to a secure wallet completely unconnected to the one where you hold your KEEP tokens. So, the ‘beneficiary’ could be a different address as well.

Today, we’re just running on the testnet, and we don’t need to put too much thought into how we’ll run our Keep Network node.

So we’re going to be the owner, chef, waiter, and customer of our own restaurant — we are going to delegate everything to our own address.

Let’s get staking.

Enter 150,000 KEEP Tokens in the ‘Token Amount’ field.

An animated image of managing our token grant on the Keep Network dashboard.

The minimum requirement to stake on the Keep Network is 90,000 KEEP tokens. We have 300,000 — but let’s save half in case there’s another cool feature we want to test in the future.

Enter your Ethereum Wallet address into the three Address fields under that: Authorizer Address, Operator Address, and Beneficiary Address.

The ‘delegate tokens’ page of the Keep Network Dashboard.

As mentioned, if you were running a node on the main Ethereum network, these addresses could and probably should be different. But, not today.

Press ‘Delegate Stake’.

Type in ‘DELEGATE’ when prompted, and click the Delegate button.

The Delegate confirmation page on the Keep Network dashboard.

This will open a MetaMask notification asking you to confirm a transaction.

Note, it mentions a ‘Gas Fee’.

A ‘Gas Fee’ is a small fee you pay in ETH tokens to process your transaction on the Ethereum blockchain. That’s partly how people maintaining the network get paid their rewards.

Luckily, our ETH is just play money on the testnet, so it doesn’t actually cost us any real money today.

Click ‘Confirm’.

MetaMask confirming our transaction on the Keep Network dashboard.

That will launch a transaction on the blockchain, carrying a message to lock up your KEEP tokens.

The transaction can take a bit of time, depending how busy the Ropsten testnet is — be patient. The Token Dashboard will refresh once it’s gone through.

You can scroll down on the ‘Delegate Tokens’ page to the ‘Grant Delegation Overview’ section. When your transaction has gone through on Ropsten, this will show your 150,000 KEEP delegation and its status.

This also needs to be confirmed by the network, so that will show as ‘Pending’ for a while.

The delegation overview page of the Keep Network dashboard.

Once that process has completed, the yellow ‘Pending’ status notification will change to a green ‘tick symbol’ with today’s date next to it.

Now, it’s time to authorize some smart contracts — we are fulfilling the Authorizer role as part of being a staker, after all.

Respect my authority!

Contracts are smart now? What’s that about?

Well — if a regular contract is something written up by a lawyer, a smart contract is pretty similar — just written by a software developer instead.

What are smart contracts? Smart Contracts are contracts written in computer code.

For example, you could set up a contract between yourself and a customer. The customer wants access to a file you are selling. When your smart contract detects the right payment has landed from their wallet address into your wallet, it could automatically grant them access to the file by sending them the password.

That’s a pretty basic example— the smart contracts we’ll authorize today are more complex. There are three contracts we need to authorise today.

The first is Random Beacon: The ‘Keep Random Beacon Operator Contract’ will let our Keep Network Testnet node participate in one of Keep Network’s core features: generating truly random numbers.

It’s a long story, but computers have trouble generating truly random numbers. This can cause trouble when writing contracts around these numbers — what if someone can predict what number will show up next? Or influence what the number is?

If you were building a decentralised application on the blockchain using smart contracts — like a gambling dApp based on random dice rolls — it means people could easily game your system by predicting what the results of those rolls would be.

Keep Network randomly selects a staker to do work to keep transactions moving. If a staker on the network could mess with that random number, they could tip the odds in their favour to be selected more often and earn more rewards.

Authorizing the Random Beacon contract groups your stake of KEEP tokens with a random group of other stakes, and then all those random groups are randomly selected to generate random numbers.

The end result is a random selection of random numbers that becomes next to impossible to predict or mess with.

This helps Keep Network run smoothly, by ensuring everyone is playing fair and earning rewards on equal footing.

So, let’s start by authorizing the Random Beacon smart contract.

Click on ‘Applications’ on the left navigation bar.

This will expand a menu with ‘Overview’, ‘Random Beacon’, and ‘tBTC’.

Click on Random Beacon on expanded menu.

Navigating to the Random Beacon page of the Keep Network dashboard.

The first card on the Random Beacon page should be titled ‘Authorize Contracts’.

Click the ‘AUTHORIZE’ button on the right side of the page.

Clicking Authorize on the Random Beacon page of the Keep Network dashboard.

This will open a MetaMask notification asking you to confirm a transaction. Like the last transaction, this includes a gas fee.

Click ‘Confirm’.

Sending our authorized transaction onto the Ethereum blockchain, via MetaMask.

This generates a transaction on the testnet blockchain which will authorise the contract, connecting it to your Ethereum Wallet address.

Just like the other transactions so far, this can take a little while to go through.

Once the transaction has finalized, the contract we just authorized will move from the ‘Authorize Contracts’ section to the ‘Authorizations History’ section, with a green ‘Authorized’ status next to it.

Confirmation that our transaction went through on the Random Beacon page of the Keep Network dashboard.

Now, we need to authorize two more contracts which are part of Keep Network’s ‘tBTC’ decentralised application.

Never the two shall meet

We talked about the Random Beacon application running on the Keep Network system.

The second application they’ve built out is called ‘tBTC’.

Bitcoin on Ethereum — a tBTC banner from Keep Network.

The Bitcoin blockchain and the Ethereum blockchain are completely separate things. Never the two shall meet.

Of course, lots of smart people want to change that for a bunch of reasons.

Bitcoin is, these days, thought of by a lot of people as a really good store of value — a bit like a block of gold.

The Ethereum blockchain, conversely, is considered a really interesting environment to experiment with Decentralized Finance — ‘DeFi’.

Since Ethereum has lots of programming features built into it — like smart contracts — people are building interesting applications where you can lend, borrow, and trade assets, all without involving any middlemen like banks.

Whatever the use case, there’s reasons that people with bitcoin want to use it on the Ethereum blockchain — for example, they might want to loan it out and earn some interest.

Keep Network’s tBTC feature allows them to do that.

In effect, users can pay a small bond on the Ethereum blockchain to generate a tBTC smart contract.

That smart contract simultaneously locks up their bitcoin on the Bitcoin blockchain, and generates a ‘tBTC’ token on the Ethereum blockchain, one-to-one.

In effect; one tBTC token is worth exactly one bitcoin.

Users can later destroy their tBTC token on the Ethereum blockchain. When the smart contract sees this, it automatically releases the locked up bitcoin back to their Bitcoin blockchain wallet.

There are similar examples of this technology operating on the Ethereum blockchain already — such as tokenised USD and other currencies.

Keep it secret, keep it safe.

So, now you know why you’re authorizing these contracts. Let’s authorize them.

Click tBTC under the Applications navigation tab, on the left of the page.

This will open the tBTC application page. There should be two contracts listed on this page: ‘BondedECDSAKeepFactory’ and ‘TBTCSystem’.

Click the ‘Authorize’ button next to the BondedECDSAKeepFactory contract.

The tBTC page of the Keep Network Dashboard.

This will open a MetaMask notification asking you to confirm a transaction.

Click ‘Confirm’.

Sending our Authorize transaction onto the Ethereum blockchain, via MetaMask.

The BondedECDSAKeepFactory smart contract is a complex package. It contains all the code needed for our Keep Network node to generate ‘keeps’.

‘Keeps’ are where the network gets it name from; they are small containers, stored outside of the blockchain, securely filled with private data.

As a Keep Network node staker, we’ll be earning rewards by opening and maintaining these keeps.

Keeps allow other smart contracts to generate, store and access secret information like passwords, which really expands their functionality a lot.

Blockchains themselves aren’t good places to store secret information. Anyone can read the contents of any transaction on the network, so we can’t store passwords or other secure information within contracts themselves.

Keeps are a crucial part of the tBTC smart contract, for example — which needs to generate private data like Bitcoin wallet keys.

Speaking of tBTC, let’s authorize that contract now.

Click the ‘Authorize’ button next to the TBTCSystem contract.

Authorizing a second contract on the tBTC page of the Keep Network dashboard.

This will open a MetaMask notification asking you to confirm a transaction.

Click ‘Confirm’.

Sending our Authorize transaction on the Ethereum blockchain via MetaMask.

Just like before, this sends a transaction on the Ethereum blockchain, confirming we authorized those contracts and connected them to our wallet.

Viewing our transaction confirmations on the tBTC page of the Keep Network dashboard.

By the way — if you’re wondering what ECDSA means, it’s probably better you didn’t.

Elliptic Curve Digital Signature Algorithm is a wikipedia rabbithole you’ll be down for some time.

Bonding exercises

Our final step on the Keep Network dashboard is bonding some of our ETH token into the smart contract.

This ETH acts as collateral for the testnet tBTC application.

In other words, we put our money at risk to ensure we don’t behave badly on the network.

If we provide a bad or unstable service — or worse, try and mess with the system — our ETH collateral can be taken away from us.

On the same tBTC page under Applications, you’ll see a card with the title ‘Add ETH for Bonding’.

Click the ‘ADD ETH’ button under the ‘Add ETH for Bonding’ section.

The ETH bonding section of the tBTC page on the Keep Network dashboard.

This will open a pop-up that asks you to enter an amount of ETH you’d like to bond.

On the real network, you’d want to put up more ETH than we have on our testnet wallet — at least 20 ETH or so.

The logic of the network is:

  1. The more KEEP tokens you stake, the more often you get selected to do work on the network.
  2. The more ETH tokens you bond, the larger blocks of work you can do.

In a way, staked KEEP tokens show commitment to the network — we bought in big time to stake our KEEP, so we get selected to do work more often.

Likewise, ETH represents our security deposit.

Since we’re locking up and distributing expensive assets like bitcoin, we need to put up an amount of ETH that’s worth more than the assets we’re handling — in case we misbehave and the network wants to reclaim those assets.

Therefore, the bigger security deposit we put down, the more assets we’re allowed to work with — each time we are selected to do work.

Since we just have 1 ETH (a bit less since we’ve been paying gas fees)…

Enter 0.3 ETH into the ‘ETH Amount’ field.
Click the ‘ADD ETH’ button.

Adding 0.3 ETH into the bonding pool, on the tBTC page of the Keep Network dashboard.

The dashboard will take a little while to update. There are two fields shown here; available ETH and bonded ETH.

Available means it’s sitting there waiting for your node to be given some work — bonded means it has been put up against a tBTC redemption, and will be returned once that work is done.

Great job! You’ve connected to the Keep Network dashboard, staked your KEEP tokens and authorized a bunch of smart contracts!

Quick recap: By now, you should have nine things saved and set up:

  1. A password for your MEW Ethereum wallet;
  2. A keystore file saved to your machine;
  3. The MetaMask Chrome Extension;
  4. Your Ethereum Wallet imported onto the MetaMask Extension;
  5. 1 testnet ETH token in your Ethereum Wallet;
  6. 300,000 testnet KEEP tokens in your Ethereum Wallet;
  7. Connected to the Keep Network Dashboard;
  8. Delegated 150,000 of your testnet KEEP tokens;
  9. Authorized the Random Beacon, BondedECDSAKeepFactory, and TBTCSystem smart contracts; and,
  10. Bonded 0.3 ETH onto your tBTC smart contract.

5. This is Infura-iating!

Well, it would be infuriating if we needed to connect our Keep Network node to the Ethereum blockchain on our own.

Luckily, we have another handy service for that: Infura.

Infura is a set of tools that lets us setup a project on the blockchain without needing to handle everything ourselves.

Visit Infura from this link: https://infura.io/register
Create a new account under the ‘free tier’.

The registration homepage of Infura.

Once again, we’re not paying for anything today.

After you’ve created and verified your account, Infura will bounce you onto a ‘Let’s Get Started’ page.

Click ‘Get started and create your first project to access the Ethereum network!’

The ‘Let’s Get Started’ page of Infura, after registering.

This will prompt you to name and create your project.

Enter a name like ‘keep-testnet’ and hit ‘CREATE’.

Filling out the project details on the Project Settings page of Infura.

Infura will show you a page called ‘Project Details’. Under the ‘Keys’ heading, you’ll see a string of letters and numbers called your ‘PROJECT ID’.

Copy and save this PROJECT ID somewhere we can access it later.
It should look something like: 74eb4bc663164c6fa975464185cb48vc

Nice job. Your Infura project is set up and ready to go — almost.

Now, we need to dive deep into the ~digital ocean~ and set up a small server for our Keep Network node to run on.

Server up!

In the dark old days, getting your own server up and running was a pain. Now, there’s plenty of online services out there that let us easily do it in the cloud*.

*just remember, the cloud is just a computer in someone else’s… massive, sterile data center in the middle of the continental United States.

The service we’ll use today is called Digital Ocean.

They offer $100 of free credit to use over 60 days — that means we can get our server and network node up and running for free; at least for the next two months of Playing for Keeps.

Go to Digital Ocean using this referral URL:
https://www.digitalocean.com/?refcode=a488e731ffc3

The homepage / registration page of Digital Ocean.

The referral code gives us a bit of extra free credit to keep our network node running for longer as well. If you’d rather not help us out, feel free to take off the refcode at the end.

Enter your details and click the ‘Sign up with email’ button.

Digital Ocean will now send you a verification email.

The verification sent page of DigitalOcean.

Go to your email, open the verification email, and click the verification URL.

At this point in the account creation process, you’ll need to enter your payment information — the credit card number we said you’d need earlier.

Enter your payment information and click through.

The payment page of DigitalOcean registration. Don’t worry, we have $100 of free credit.

You won’t be charged anything now.

When your $100 of free credit runs out, Digital Ocean will start to charge you to run the server we’re going to set up. We’ll include information on how to deactivate your account further down below.

The good news is, so far our server has cost about 50 cents a day — so if you forget, it’s probably not the end of the world.

After verifying, Digital Ocean will open a screen titled ‘What are you trying to build?’

Ignore all the options, and click ‘Skip and go to Control Panel’ at the bottom of the page.

The ‘What are you trying to build page’ of DigitalOcean. We can skip this.

Once you’ve created your account, you’ll be presented with an onboarding screen. It probably created a Default Project for you, but we’ll ignore that.

Instead:

Click on the ‘+ New Project’ option in the menu on the left.
Name it ‘Keep-testnet’.

An animated image of creating a new project on DigitalOcean.

Sitting under ‘Explore DigitalOcean’ you should see a ‘Get started with a Droplet’ button in the middle of the screen.

A Droplet is Digital Ocean’s name for a virtual machine — a mini-computer running on one of their servers.

They let technical wunderkinds tailor these computers to their project’s exact needs. Since we’re not technical, nor wunderkinds, we’ll just put in the following settings:

Click on the ‘Get started with a Droplet’ button.

An animated image of setting up a new ‘Droplet’ server as part of a new project on DigitalOcean.

Choose an image: Ubuntu
Choose a plan: Basic / $20 a month

Add block storage: ignore this! Select nothing!
Choose a data center region: pick the location closest to you
VPC network: ignore this! Select nothing!
Select additional options: ignore this! Select nothing!

Near the bottom of this page, there’s a header asking what method of ‘Authentication’ you want to use.

Select ‘SSH Keys’.

This will expand a tab with another option asking you to ‘Choose your SSH keys’. We haven’t set any up yet, so —

Select ‘New SSH Key’.

Selecting SSH Keys as our authentication method when setting up our new Droplet server on DigitalOcean.

SSH means ‘Secure Shell’. An SSH key works a bit like a password, but with some extra layers of security and cryptography.

What we’re going to do is generate a ‘Key Pair’. A key pair includes:

  1. A public key, which our server will show to the world.
  2. A private key, which we use to securely access our server.

When a private key does a handshake with its matching public key, our server is unlocked and we can manage it remotely, from our home computer.

Just like a password, a private key is a secure piece of information which you shouldn’t share with anyone.

Keys to the kingdom

Now we’re getting serious, and a bit technical.

When you clicked on ‘New SSH Key’, Digital Ocean would have opened a window that looks like the one below:

The ‘Add Public SSH Key’ page of our Droplet server on DigitalOcean.

Now, obviously we don’t have a public SSH key to enter into that field yet, so we need to create one. Digital Ocean has a prompt on the right of the screen, telling us to run a command in our terminal.

Depending on what operating system you use, this next step will look slightly differently — but functionally, it’s the same.

On MacOS: Launch Terminal by going to Applications > Utilities > Terminal.

On Windows: Launch the Command Line / CMD by pressing the Windows / Start button, typing in ‘CMD’, and opening ‘Command Line’, or ‘cmd.exe’, whatever your computer shows.

The screenshots below are from the MacOS Terminal application. It will look a little different on Windows, but follow the same instructions, word for word.

Once you’ve got Terminal or Command Line open, copy and paste (or type in) the keygen command that Digital Ocean had written out for us:

ssh-keygen

Hit enter to submit the command.

Terminal will return a note saying ‘Generating public/private rsa key pair.’

It’ll then ask you to enter a file to save the key. By default, this should look like:

/Users/Your_User_Name/.ssh/id_rsa

Which is totally fine for what we need, so just hit enter.

Generating an SSH key pair using Terminal.

Next, it will ask you to enter a passphrase.

Enter a password.

It’ll ask you to enter that same passphrase again, to ensure you remember it.

Record this somewhere, as we’ll need it later.

Depending on your Terminal / Command Line application, it may also spit out a funny confirmation screen with cryptic diagrams and your key. Don’t worry too much about this.

This isn’t my real confirmation screen — don’t share pictures of yours on the internet either!

Now, we need to copy our public SSH key from the file we just created.

The code for this is slightly different between Mac and PC, so follow the relevant instructions below.

On Mac:

cat ~/.ssh/id_rsa.pub

Hit enter to submit the command.

Outputting the content of our Public Key file using Terminal.

On PC:

type c:\users\Your_User_Name\.ssh\id_rsa.pub

Fill in your PC user name into the Your_User_Name text above.

This completes the file path we need — note, it should point to the same place as where we generated our SSH key files just a moment ago.

Hit enter to submit the command.

We’re back together again.

Whatever Operating System you’re on, the code above should repeat the contents of your ‘id_rsa.PUB’ file that we just created before.

That’s the file that contains our public key.

It should look like a long string of letters, numbers and symbols. Something like below:

A23rrB3NzaC1yc2EAAAADAasdaBAQDEzGcHOJAhs2MMCdy8GRaDaxAegIHQLcwLyDa3v/aZ8ASD55ZwZqOEKHa5d7D22/f6uY4EMaBdt8cN9rzFV8tc+nta3U4kld9lZ603WtVzDVFtaqLONDXd0ApVoiaKqNuadasdasd6xOD2W1CebRao+07blJgzN18WUdEmrWIESSzUQDFFW0MANuYJEc73eM3yi6123adbro4OFEImEjuOCHqDq6CG86PIWTEQCcHAYyGLH4IXccWEBjpZwineTbpv3ns41313

It may also be preceded by the text ‘ssh-rsa’, and ended with your computer username and computer’s name — e.g. Jack@BeeseChurger.

If that’s the case, it’ll look like the below:

ssh-rsa A23rrB3NzaC1yc2EAAAADAasdaBAQDEzGcHOJAhs2MMCdy8GRaDaxAegIHQLcwLyDa3v/aZ8ASD55ZwZqOEKHa5d7D22/f6uY4EMaBdt8cN9rzFV8tc+nta3U4kld9lZ603WtVzDVFtaqLONDXd0ApVoiaKqNuadasdasd6xOD2W1CebRao+07blJgzN18WUdEmrWIESSzUQDFFW0MANuYJEc73eM3yi6123adbro4OFEImEjuOCHqDq6CG86PIWTEQCcHAYyGLH4IXccWEBjpZwineTbpv3ns41313
Jack@BeeseChurger

Either way —

Copy everything that your terminal wrote out for you,
and paste it into the ‘Add public SSH key’ field
on DigitalOcean.

If that went smoothly, DigitalOcean will put a little green tick next to the field.

Enter a name for the SSH key — something like ‘Keep-test-key’ — into the ‘Name’ field underneath.

Again, you’ll get a green tick next to that if you’re good to go.

Adding our Public SSH Key to DigitalOcean.

DigitalOcean will now select your ‘Keep-test-key’ as the SSH key for the server you’re setting up.

Skip past the ‘Finalize and create’ section — all the default settings should be okay. We don’t need any tags or backups.

Click the ‘Create Project’ button at the bottom of the page.

An image showing the ‘create a project’ button after completing our project’s details on DigitalOcean.

Right on! DigitalOcean should now kick you back onto your keep-testnet project page. The Droplet you just set up will show a progress bar next to it — your server is spinning up.

Our droplet spooling up on our new project on DigitalOcean.

Once that’s done, the bar will disappear and you’ll see a string of numbers in its place. This is your server’s IP address. It’ll look something like this — 162.22.256.15
— but not exactly, as it’s unique to your server.

Save this IP address somewhere, as we’ll need it later.

Looking at our IP address of the Droplet server we just added to our DigitalOcean project.

Phew! Stress! But, you’ve got an Infura project set up, and a DigitalOcean server set up — everything you need to launch a node!

Note: if you don’t want to pay for DigitalOcean beyond your free credit:
1. Set a reminder in your calendar 60 days from now;
2. On that day, delete all your droplets and other resources;
3. Click Account -> Settings -> Account Settings page; and,
4. Scroll down and click Deactivate Account.
This will also take your Keep Network node server offline, so you will no longer be eligible for PFK rewards after deactivating your DigitalOcean account.

Quick recap: By now, you should have 15 things saved and set up:

  1. A password for your MEW Ethereum wallet;
  2. A keystore file saved to your machine;
  3. The MetaMask Chrome Extension;
  4. Your Ethereum Wallet imported onto the MetaMask Extension;
  5. 1 testnet ETH token in your Ethereum Wallet;
  6. 300,000 testnet KEEP tokens in your Ethereum Wallet;
  7. Connected to the Keep Network Dashboard;
  8. Delegated 150,000 of your testnet KEEP tokens;
  9. Authorized the essential smart contracts;
  10. Bonded ETH onto your tBTC smart contract;
  11. Created an Infura Account and set up a project called ‘keep-testnet’;
  12. An Infura ‘project-id’ which you’ve got saved somewhere;
  13. Created a DigitalOcean account, and set up a project called ‘Keep-test’;
  14. Generated an SSH key pair, entered your public key into DigitalOcean, and saved a passphrase somewhere; and,
  15. Created a DigitalOcean ‘Droplet’ server, and saved its IP address somewhere.

6. Keep Network, à la node.

Have you ever run your own flipping server before? Now you have!

We’re on the road home now — time to launch our Keep Network node on that shiny DigitalOcean server.

To do this, we’re going to have to hook deep into the Matrix using our newly found computer hackin’ skills. That’s rightwe’re going to use the Terminal / Command Line again, just like we did when we generated our SSH keys.

If you’ve never really used the terminal before, this can be a little intimidating. Don’t stress — we’re seasoned computer experts and will make this as easy as possible.

A picture of me on my parent’s computer. Meme
Image of the author, hacking on Terminal

The first thing to understand: launch ‘Terminal’ or ‘Command Line’ fresh. Whatever they show on the screen to begin with, that’s our starting point for this next section.

Command Line, for example, might show a filepath — just ignore that and enter the code as instructed.

The second thing: we’ll display our blocks of code in these special grey boxes:

Echo “This is a command that you can copy and paste into your terminal”

When you see a grey box in this article, copy and paste everything that’s included inside the grey box.

Try copying and pasting code that into your terminal and hitting enter.

It should ‘echo’ the text back to you. See? Easy.

If there’s more than one line of text in the grey box, that means you should copy and paste that whole box and hit enter.

Echo "This is the first command"
Echo "This is the second command"
Echo "This is the third command"

The nature of your terminal means that each line will be executed, one after the other.

So, if we have more than one line, it means there’s a whole string of commands we’re putting through at once, and the computer will execute them one-by-one for us.

Lastly, we might need you to enter some of your own information into the code lines. Where that’s the case, the text will be in BOLD, like below:

Echo "Enter_Your_Name_Here is a cool person"

Works like a charm. We’ll also point it out in the instruction text around it, so you don’t get mixed up at any point.

If you need to paste in complex text, such as IP addresses or long keys, sometimes it’s easier to paste the example command into a program like NotePad or TextEdit, replace the example information with your information, and then paste and run it in your terminal from there.

If you ever have trouble pasting text into your command line, be aware that certain apps have different shortcuts than you’d usually use.

For example, on my Windows Command Line, after I’ve connected to my DigitalOcean Droplet server, I need to right-click to paste — Ctrl+V doesn’t work.

Feeling confident? Nope? Neither was I, but I got there in the end.

Command Line Code Crusaders

Okay, so you’ve got your Terminal / Command Line open in front of you.

The first thing we need to do is securely login to our DigitalOcean Droplet server using our SSH key.

We’ll need our Droplet’s IP Address, which you should have written down somewhere during the last section. It’ll look something like this: 162.22.256.15

Replace the xx.xx.xx.xx section of the command below with your Droplet’s IP address.

Run the command in your terminal once your IP address is in there.

ssh root@xx.xx.xx.xx

Using the example above, that command would look like:
ssh root@162.22.256.15

If you set a passphrase when you created your SSH keypair in the terminal earlier, it will ask for that passphrase now.

Enter your passphrase to connect to your server.

An image showing successful login to our Droplet server, using SSH verification.

Note, that when you’re typing in a password on the commandline, it might look like your keyboard isn’t working — actually, it just doesn’t always show text when you’re typing passwords and passphrases. Type it in anyway, hit enter, and you’ll be connected.

If you get disconnected during this process, or close your terminal, you’ll need to reconnect to your server using the ssh root command and passphrase. Any steps you’ve done up until then should still be saved.

Next, we need to set up some firewall rules to protect our Droplet server.

sudo ufw allow 22/tcp
sudo ufw allow 3919/tcp
yes | sudo ufw enable

Those are three lines of code that we’ll execute at once. Paste them all and let your terminal run through them.

Enter the code above and hit enter.

In this case, we’re opening a couple of connection ports, and locking the rest of them behind a firewall.

You’ll see sudo show up a lot — that’s just a command to make sure that the code you enter afterwards gets through to your server, no matter what.

Next, we’ll install a tool called Docker that makes it really easy to deploy and run applications on all different kinds of servers.

Docker will make it painless to run our Keep node application on our Digital Ocean Droplet server.

sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io curl -y
sudo systemctl start docker
sudo systemctl enable docker

Enter the code above and hit enter.

That block of code will download the latest version of Docker, start it up, and enable it on our server.

Let’s check that it installed properly.

sudo docker --version

Enter the code above and hit enter.

That should return some text that looks something like the image below:

Confirming Docker has installed on our server using Terminal.

As long as it’s showing a software version, we have Docker enabled on our server.

Push and Pull (more pull, actually).

Next, we’re going to pull the Keep client application to our server.

‘Pull’ just means download, but slick computer peeps like us use that lingo.

A super cyber criminal giving you the thumbs up for using ‘cool slang’.
When you say ‘Pull’ instead of ‘Download’.
docker pull keepnetwork/keep-client:latest

Enter the code above and hit enter.

In this case, we’re using our handy new Docker tool to download — sorry, pull — the latest version of the Keep client.

Next, we’re going to create a few extra folders on our server. Like we said, a cloud server is just a computer sitting somewhere else. It works exactly the same way as yours, as far as file structure goes.

mkdir -p $HOME/keep-client/config
mkdir -p $HOME/keep-client/keystore
mkdir -p $HOME/keep-client/persistence

Enter the code above and hit enter.

That’ll create three folders within our Keep client folder — config, keystore, and persistence.

Our values.

Time to set some ‘values’. Not like company values — trust, respect, integrity — we don’t need those, no sir.

We’re after your regular type of values — variables, numbers and all of that.

First, let’s set the server’s IP:

export SERVER_IP=$(curl ifconfig.me)

Enter the code above and hit enter.

That uses an online service (ifconfig.me) to check your server’s IP, and then automatically sets that returned IP value as a variable on our server.

Next, let’s set the PROJECT ID from our Infura ‘keep-testnet’ project. You should have it noted down, from earlier.

export INFURA_PROJECT_ID=”YOUR_INFURA_PROJECT_ID”

Replace the bolded text above, including the apostrophes, with your Infura Project ID.

Enter the modified code and hit enter.

The modified code should look something like this:
export INFURA_PROJECT_ID=74eb4bc663164c6fa975464185cb48vc

Setting our Infura Project ID value using Terminal.

Next, we need to set our Ethereum Wallet address. You should have it saved somewhere, but you can just grab it from MetaMask if you need it.

export ETH_WALLET=”YOUR_ETH_WALLET_ADDRESS”

Replace the bolded text above, including the apostrophes, with your Ethereum Wallet Address.

Enter the modified code and hit enter.

The modified code should look something like this:
export ETH_WALLET=0x8F076DF6434F7A8dA4793118f9F8cf82f958E319

Setting our Eth Wallet value using Terminal.

Lastly, let’s set the password for our MEW Ethereum Wallet. You should have this saved somewhere secure as well.

export KEEP_CLIENT_ETHEREUM_PASSWORD=”YOUR_MEW_WALLET_PASSWORD”

Replace the bolded text above, including the apostrophes, with your MEW Wallet password.

Enter the modified code and hit enter.

The modified code should look something like this:
export KEEP_CLIENT_ETHEREUM_PASSWORD=SpookySecretPassword

Bewdiful!

We just need to check we set all of these values correctly. It’s pretty easy using the ‘echo’ command, which repeats a value back to your terminal.

echo $SERVER_IP
echo $INFURA_PROJECT_ID
echo $ETH_WALLET
echo $KEEP_CLIENT_ETHEREUM_PASSWORD

That should return your Server IP (which we didn’t enter, but will be the same as shown on your DigitalOcean Droplet), your Infura Project ID, your MEW Wallet Address, and your MEW Wallet Password.

Contract killer

On the Ethereum blockchain, smart contracts get updated from time to time.

Just like a software update, Keep Network updates their smart contracts as they develop and improve them. They patch out bugs and security issues as they’re discovered.

This means that we need to make sure our Keep Network node is pointed to the latest and greatest smart contracts.

Some other tutorials out there still contain old contract addresses — which tripped me up when I first created my node, and made this whole last step fall apart.

We’ll strive to keep this tutorial up to date, but it may be worth double checking the three bolded smart contract addresses in the code below with the three contract addresses shown on the Keep Network github page.

You can find the latest testnet contract addresses under section ‘8.2.3 — Testnet Contracts’.

Let’s make sure our node is pointing to the latest contracts with the following code:

export KeepRandomBeaconOperator= "0xC8337a94a50d16191513dEF4D1e61A6886BF410f"
export TokenStaking= "0x234d2182B29c6a64ce3ab6940037b5C8FdAB608e"
export KeepRandomBeaconService= "0x6c04499B595efdc28CdbEd3f9ed2E83d7dCCC717"

Enter the code above and hit enter.

If they match the contracts listed on the Keep Documentation link above, you don’t need to change anything — enter the code above and let it fly.

If they don’t, firstly — let us know — and secondly, replace the contract addresses in the code above with Keep’s latest ones, and then let it fly.

Now, let’s make sure that those export commands worked correctly. We’ll use ‘echo’ once again.

echo $KeepRandomBeaconOperator
echo $TokenStaking
echo $KeepRandomBeaconService

It should return three Ethereum smart contract addresses which match the latest Keep Network contracts on your terminal line.

Configure this one out!

Seriously, almost there (I’m getting tired of saying that too).

Now, we need to create a configuration file for our Keep Application. The following command will create a file for us.

Since we’re clever and set a bunch of values and variables just now, it’s going to automatically fill our file up with our specific details.

Cool, huh? Computers!!!

Be sure to copy ALL the text in the following grey block, paste, and run it on your terminal line:

cat <<EOF >>$HOME/keep-client/config/config.toml
# Ethereum host connection info.
[ethereum]
URL = "wss://ropsten.infura.io/ws/v3/$INFURA_PROJECT_ID"
URLRPC = "https://ropsten.infura.io/v3/$INFURA_PROJECT_ID"# Keep operator Ethereum account.
[ethereum.account]
Address = "$ETH_WALLET"
KeyFile = "/mnt/keystore/keep_wallet.json"# Keep contract addresses configuration.
[ethereum.ContractAddresses]
KeepRandomBeaconOperator = $KeepRandomBeaconOperator
TokenStaking = $TokenStaking
KeepRandomBeaconService = $KeepRandomBeaconService
[LibP2P]
Peers = ["/dns4/bootstrap-1.core.keep.test.boar.network/tcp/3001/ipfs/16Uiu2HAkuTUKNh6HkfvWBEkftZbqZHPHi3Kak5ZUygAxvsdQ2UgG", "/dns4/bootstrap-2.core.keep.test.boar.network/tcp/3001/ipfs/16Uiu2HAmQirGruZBvtbLHr5SDebsYGcq6Djw7ijF3gnkqsdQs3wK", "/dns4/bootstrap-3.test.keep.network/tcp/3919/ipfs/16Uiu2HAm8KJX32kr3eYUhDuzwTucSfAfspnjnXNf9veVhB12t6Vf", "/dns4/bootstrap-2.test.keep.network/tcp/3919/ipfs/16Uiu2HAmNNuCp45z5bgB8KiTHv1vHTNAVbBgxxtTFGAndageo9Dp"]
Port = 3919
# Override the node's default addresses announced in the network
AnnouncedAddresses = ["/ip4/$SERVER_IP/tcp/3919"]# Storage is encrypted
[Storage]
DataDir = "/mnt/persistence"
EOF

Enter the code above and hit enter.

Entering our Config file settings into Terminal.

That’s a big block of text, and I won’t go through every line — suffice to say, our file is filled with important values and information.

As long as we set our values properly earlier, this should have come off flawlessly — if you run into issues, you may need to check the file.

Either way, let’s confirm it’s all set up. Enter the following to open up the file:

nano $HOME/keep-client/config/config.toml

Enter the code above and hit enter.

Opening our newly created config file to confim its contents are okay, using Terminal.

This command opens up the contents of the file in a terminal text editor and lets us check what’s inside.

It should look like the image below, only with your own values in place.

The contents of our Config file, open in Nano via Terminal.
Your config file should look like this — although the wallet and contract addresses will be different.

You’ll notice how the terminal took our block of code above, and used the values we set earlier to replace the placeholder values in there (e.g. $ETH_WALLET should have changed to your Ethereum Wallet address).

Save and exit by pressing:
Ctrl-X, then press y to confirm the save.

Nice one. You’ve just set your config file up!

JSON? JSON!! JSONNN!

Did anyone else play Heavy Rain on the PS3? No? So much for the sick title reference then…

The last — and I mean, very last thing we’re going to do before spinning up our node, is copy the contents of our MEW Ethereum Wallet keystore file — a .JSON file — over to our server.

We’ll need a text editing program like NotePad (Windows) or TextEdit (Mac) to do this part.

Navigate to your keystore file that you saved earlier.

We saved this file a while ago — it’s the one called something like: “UTC — 2020–04–11T21–11–10.51”.

Open it with your text editing program.

Keep that file open, as we’ll be copying the text inside shortly.

Before that, we need to create an empty .JSON file on our server, which we’ll then paste the text into.

nano $HOME/keep-client/keystore/keep_wallet.json

Enter the code above and hit enter.

That will create and open a file called ‘keep_wallet.json’ in a special terminal editor, ‘nano’.

Nano is a bit easier to read and use than the standard terminal / command line file editor.

Now that file is open, we should be able to copy the text from our Ethereum Wallet keystore JSON file and paste it into our newly created JSON file.

Copy the text from your keystore file, which should be open in a text editing program.

Dragging the keystore file into the text editor and copying the contents

Paste the text from the keystore file, into the new .JSON file you’re editing with nano.

An animated image of copying our Keystore file contents into our newly created JSON file on our server.
Pasting the contents of the keystore file from the text editor into Nano.

Save and exit by pressing:
Ctrl-X then press y to confirm the save.

If that worked correctly, you should be kicked back to the terminal line you were on before you created and opened the .JSON file with nano.

Moment of truth

Palms are sweaty, mom’s spaghetti — we’re about to press go.

sudo docker run -dit \
--restart always \
--volume $HOME/keep-client:/mnt \
--env KEEP_ETHEREUM_PASSWORD=$KEEP_CLIENT_ETHEREUM_PASSWORD \
--env LOG_LEVEL=debug \
--name keep-client \
-p 3919:3919 \
keepnetwork/keep-client:latest --config /mnt/config/config.toml start

Enter the code above and hit enter.

That block of code tells our Keep Network node to start running and never stop. It takes a moment to kick off, so wait a minute before going further.

Let’s make sure it worked.

sudo docker logs keep-client -f

Take a deep breath, enter the code above, and hit enter.

That code will start writing your network node’s logs into the terminal.

If you’re successful, you should see the KEEP logo show up in ASCII text, somewhere in the logs, you might have to scroll to find it but it’ll look like this:

If you see a big KEEP logo in ASCII, you did it.

Stop the logs by pressing ctrl+c.

There’s one last check we can do to make sure things are running smoothly.

sudo docker logs --tail 1000 keep-client -f | grep "number of connected peers: "

This will return an answer of how many peers on the Keep Network our node is connected to.

As long as the number of connected peers is above 0, your node is running!

It’ll look something like below, in this case there are 75 connected peers:

Confirming we have connected to peers using Terminal.

Did that work? It worked?! It worked!

By the way — if it didn’t work, you have a few options:

  1. Leave a comment and we’ll try to help; or,
  2. Join the Keep Network Discord Server and either
    a) search for help (pasting the error you’re receiving is a good start), or
    b) message me at @JackRemix#7613

You’re running a Keep Network node now, kid.

Took a while hey? But it was all worth it in the end. You’re part of the future of decentralized finance. Not every sucker on the street can say that.

As we said at the start of this article, there are two key criteria to sharing in the Playing for Keeps prizes:

  1. Running a KEEP Network node on the Ethereum testnet.
  2. Contributing to, and growing, the Keep Network community.

You’ve ticked the first item off the list. Now, go out and be creative — dream up your contribution to the next month of Playing for Keeps activities.

If you want to submit a Playing for Keeps entry, it’s pretty easy:

  1. Join the Keep Network Discord.
  2. Go to the #introduce-yourself channel
  3. Write a message with the following included:
    * A name by which to address you in the channel
    * Why you’re interested in Keep or tBTC
    * What you are submitting for Playing for Keeps prizes — This can be an idea if you aren’t ready with a fully formed idea!
    * If you’ve already produced something you want to submit as an entry

The Keep Network team also have a great guide on the Playing for Keeps competition, including what kind of content they’re looking for. You can find that here: https://blog.keep.network/how-to-play-for-keeps-297f246455d4

Playing for Keeps — you’re eligible now!

~getting meta~

This how-to guide is, in fact, my submission to Playing for Keeps.

I really wanted to make it easier for non-technical people — who have important contributions to make to the Keep Network community — to get started running a node.

Blame my arts degree, but I had real trouble following other guides which assumed a lot of technical know-how.

They’d include steps like ‘Generate SSH keys’ — what’s an SSH key? And how is one generated? Where do they come from? Was the SSH key inside our hearts all along? Was it the friends we made along the way?

Well, I know now, but I would have appreciated a hand up there.

This guide is the result of a failed attempt to get my node running earlier in the year, and then two days of troubleshooting and researching around technical assumptions in other guides. And, about three weeks of writing, screenshotting and refining what you see.

If you’ve read this guide, and had any issues or got confused at any point, please let me know in the comments. Especially if you’re not comfortable with things like terminal / the command line — this guide is meant for you, and you shouldn’t feel out of your depth at any time.

With that — many thanks and kind regards to those who helped me build, research and refine this guide.

Special thanks to @Dat for all the feedback and screenshot polish.

Many thanks to Ben Longstaff for his guide, which was a bit too technical for me, but got me across the line setting up my own node.

Big thanks and big love to anyone who helped with this article, or read it along the way.

--

--

Jack Baldwin

Writing & BD — in the Blockchain, Finance and DeFi space.