EOS Development Screencast: Running a Single Node Local Testnet (MacOS)

in #eos6 years ago (edited)

EOS Development Screencast: Running a Single Node Local Testnet (MacOS)

Hello, there fellow steemers, wherever you are in this world! As promised the start of a series on developing on EOS. The idea behind this is pretty straightforward, I want to take you along on my journey discovering the EOS code. To do this I will make condensed screencasts showing you what I am doing and hoping this will help new people along.


▶️ DTube

In this screencast, we are setting up the foundations for our future tinkering, a single node EOS local testnet. Our first stop in building next-generation distributed applications on EOS.

As EOS is in active development the first question to ask is which branch of EOS to use?

After some googling, I found that Dawn-3.0 has just been released and is ready for us to experiment with. This release is still in early alpha and not compatible with the public testnet. It will not be available until Q1 of 2018. It packs some interesting new features which we can look at in future screencasts.

This tutorial will cover the build and installation of a public testnet compatible version.

First of all, clone the EOS repository.

git clone https://github.com/EOSIO/eos

Check out our dawn-2.x release, and initialize the submodules and update them recursively.

git checkout dawn-2.x
git submodule init
git submodule update --recursive

Now we have our codebase pointing to a compatible version with the public testnet and can install our dependencies.

In the root folder of the source tree, we have a script called build.sh. Reading the code you can see we can call this build script with 2 parameters. The first parameter specifies the architecture (ubuntu, darwin) and the second (full, build) specifies whether to install all dependencies or just build on the dependencies we have installed before.

To give an example:

./build.sh darwin full

will install first all dependencies, and

./build.sh darwin build

will not install any dependencies and just build the software.

For now, we will assume we have a clean machine and will run the command that installs all the dependencies. This may take a while, so you can do your dishes or prepare some beverage for the second part of this tutorial :-)

After all, dependencies are installed and the project has been built correctly. We are ready to configure a local single node testnet.

To do this, navigate to the following directory:

cd build/programs/eosd

You should find the eosd executable there. This program executes using a "data-dir" storing the block_chain and the configuration it uses to operate. We will run it once to have a directory ready.

On my setup, I could not kill the eosd using Control-C, so I had to pkill -9 eosd in another terminal to get it to exit after first execution, let me know when you encounter the same.

We now have a "data-dir", containing the following files:

drwxr-xr-x  4 bmaas  staff   136 Feb 25 09:15 blockchain
drwxr-xr-x  4 bmaas  staff   136 Feb 25 09:24 blocks
-rw-r--r--  1 bmaas  staff  5995 Feb 25 09:24 config.ini

To do local development and experiment, we need to configure config.ini you can follow the README on the eos GitHub page @ Local Single Node Testnet.

It boils down to specifying genesis-json, enable stale production, specifying testnet-producers and loading the producer, wallet, chain and HTTP plugins.

For your convenience, I prepared a config.ini for your here.

Single Node Testnet Config.ini

In the "data-dir" directory just do:

wget 'https://gist.githubusercontent.com/monetashi-io/952d26e4573958e050a40d224ebc5e72/raw/4731c69da49053e5e77c04c0d4f29ae931866b33/config.ini' -O config.ini

and you are ready to go!

Let's run the eos daemon:

./eosd

You should be able to see eosd spinning and producing blocks every second, a world of potential is awaiting you!

Let me know if you want topics specific topics covered, as this will guide us in our explorations.

The time is now Crypto Crusaders! Steam On!

Sort:  

Dude this is awesome. Thanks for making this. I'm busy right now but looking forward to diving into this. Also excited for more from you

Let me know your requests, building a list of topics to cover :)

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64344.02
ETH 3142.36
USDT 1.00
SBD 4.01