EOS Nodeos & Cleos Setup

Excited to start this EOS 201 course!

I am using Windows on my main computer, but I have an old laptop where I installed Ubuntu as @thecil encouraged me to get started with Linux! :wink: :+1:

So I installed Ubuntu on my old laptop, but I installed Ubuntu 20.04 not knowing it was a very recent release.

Installing the Ubuntu 18.04 Debian Package from the link provided in the course (EOSIO v. 1.8.1) did not work, I got an HTTP request sent, awaiting response... 404 Not Found error in my terminal, I guess because this package is not fit for the Ubuntu 20.04 version. I tried to install the package for EOSIO v. 2.0.5 found on EOS Github page, but I got the same error message.

I would need now to wait for a new release by EOS for Ubuntu 20.04. It seems that it is coming soon, because an EOS dev commented two weeks ago on Github: “A new LTS release is about to be available, so it will be great to have deb packages for it.”

Of course I could uninstall Ubuntu 20.04 and install the 18.04 version, but I will wait for a while, I hope the package will be available soon for 20.04.

Another option for me would be to install a VM on Windows and use Ubuntu on my main computer with the VM. Does this solution work well and does it take not too much memory?

1 Like

Thats a total valid solution sir, you can install ubuntu 18.04 on a VM and use the Nodeos & Cleos with it… the ubuntu version 20.04 is still too new, so it’s normal to find issues like yours for daily use, still is better to stay with 18.04 until all software update to the new version.

Carlos Z.

2 Likes

I tried to install the binaries on Linux: Ubuntu 18.04 Debian Package Install. (I have Ubuntu 18.04 installed on my laptop.)

wget https://github.com/EOSIO/eos/releases/download/v1.8.1/eosio_1.8.1-1-ubuntu-18.04_amd64.deb gets me a 404 Not Found Error. The reason I found is the v1.8.1 Debian package is not available anymore for download on the EOSIO Github site. If I simply click on the github.com link above, it gets me a 404 error as well.

I checked carefully the EOSIO Github site, and their older releases (the most recent one is now 2.0.5.1), and I found the 1.8.1, but the download icon is not there anymore, it seems it is not available anymore for download.

Can I find the link to the 1.8.1 version somewhere else, to use with wget? Or can I install a more recent version? (But I am note sure it will work later with the Nodeos Start Command)

Your assistance would be appreciated :slightly_smiling_face:

yes, you are right, probably they have deleted, just download the most recent version, should be able to work with new features and old ones with any issue.

wget https://github.com/EOSIO/eos/releases/download/v2.0.5/eosio_2.0.5-1-ubuntu-18.04_amd64.deb

Hope you find this useful! :slight_smile:

Carlos Z.

1 Like

Thanks Carlos. That’s what I did first, but then at the “Start Nodeos” lesson, I wanted to execute the Nodeos Start Command in the terminal, and it didn’t work.

Here is the Nodeos Start Command provided in the course:

nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false >> nodeos.log 2>&1 &

It seems that history_plugin and history_api_plugin are now deprecated (see https://developers.eos.io/manuals/eos/latest/nodeos/plugins/history_api_plugin/index). Anyhow, the command did not work for me.

This is the reason why I uninstalled the most recent version (v2.0.5) and posted this thread on the forum.

But if you think it is the right way ahead, I will re-install the v2.0.5 binaries and try to sort it out with different options with the plugins.

Best,
swisscrypto

OK, I installed again the Debian Package on Ubuntu 18.04 with v2.0.5 (as v1.8.1 is not available anymore) from the link you provided me with:
wget https://github.com/EOSIO/eos/releases/download/v2.0.5/eosio_2.0.5-1-ubuntu-18.04_amd64.deb
and followed other instructions: Setup Directory, Get Absolute Path and Install CDT (v1.6.1).

It worked, I could install them.

Then, in the Start Nodeos lesson, I wanted to execute the Nodeos Start Command:

nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false >> nodeos.log 2>&1 &

I also tried with --plugin eosio::state_history_plugin instead of --plugin eosio::history_plugin which is deprecated (https://developers.eos.io/manuals/eos/latest/nodeos/plugins/history_plugin/index).

But when I try to execute it, the terminal is returning something weird:

[1] 9473

I guess it is some place in the code where the process is terminated?

So it is not properly installed, because if I type then tail -f nodeos log, I am getting a bunch of lines and then the process ends:

$ tail -f nodeos.log
info 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:412 operator() ] Support for builtin protocol feature ‘ONLY_BILL_FIRST_AUTHORIZER’ (with digest of ‘8ba52fe7a3956c5cd3a656a3174b931d3bb2abb45578befc59f283ecd816a405’) is enabled with preactivation required
info 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:412 operator() ] Support for builtin protocol feature ‘RESTRICT_ACTION_TO_SELF’ (with digest of ‘ad9e3d8f650687709fd68f4b90b41f7d825a365b02c23a636cef88ac2ac00c43’) is enabled with preactivation required
info 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:412 operator() ] Support for builtin protocol feature ‘FIX_LINKAUTH_RESTRICTION’ (with digest of ‘e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff526’) is enabled with preactivation required
info 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:412 operator() ] Support for builtin protocol feature ‘GET_SENDER’ (with digest of ‘f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d’) is enabled with preactivation required
info 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:908 plugin_initialize ] Starting fresh blockchain state using genesis state extracted from blocks.log.
warn 2020-05-14T15:54:33.793 nodeos chain_plugin.cpp:1093 plugin_initialize ] 13 St13runtime_error: “state” database dirty flag set
rethrow “state” database dirty flag set:
{“what”:"“state” database dirty flag set"}
nodeos chain_plugin.cpp:1093 plugin_initialize
error 2020-05-14T15:54:33.794 nodeos main.cpp:121 main ] database dirty flag set (likely due to unclean shutdown): replay required
^C
[2]+ Termine 2 nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::state_history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin=’*’ --contracts-console --http-validate-host=false >> nodeos.log 2>&1

(“Termine” means “ends the process” in French, I need to switch my terminal into English…)

Your help would be appreciated! @thecil @filip

Thanks!

well thats weird, i install the same version that i advice you and it’s running good for me, please try to do this little tweak for the nodeos command and let me know.

Tweak for NODEOS

after creating that little script, you can use the “tail -f nodeos.log” and you should see something like this over and over (it means thats blocks are being produce).

#490 @ 2020-05-14T20:06:00.500 signed by eosio [trxs: 0, lib: 489, confirmed: 0]
info  2020-05-14T20:06:00.900 nodeos    producer_plugin.cpp:2093      produce_block        ] Produced block 6aae739ed2dfe1c2... #491 @ 2020-05-14T20:06:01.000 signed by eosio [trxs: 0, lib: 490, confirmed: 0]
info  2020-05-14T20:06:01.400 nodeos    producer_plugin.cpp:2093      produce_block        ] Produced block 961ec63c9dc01054... #492 @ 2020-05-14T20:06:01.500 signed by eosio [trxs: 0, lib: 491, confirmed: 0]
info  2020-05-14T20:06:01.900 nodeos    producer_plugin.cpp:2093      produce_block        ] Produced block 093d77a86344ec2b... #493 @ 2020-05-14T20:06:02.000 signed by eosio [trxs: 0, lib: 492, confirmed: 0]
info  2020-05-14T20:06:02.400 nodeos    producer_plugin.cpp:2093      produce_block        ] Produced block b366033a95cdd9e2... #494 @ 2020-05-14T20:06:02.500 signed by eosio [trxs: 0, lib: 493, confirmed: 0]

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

thanks a lot.
I had so many issues with nodeos in my VM crashing unexpectedly and bieng unable to restart it properly.

JJ.

1 Like

I ran your script on my VM Lubuntu 18.04 ( with EOSIO 2.0.0.1 ) and I have no issue .

[1] 9473
[1] is job iD because of '&'at the end of the command line.
9473 probably the process of nodeos ( ps aux | grep nodeos ).

I will try later on with eosio 2.0.0.5 and let you know.

2 Likes

Thanks for the tweak.

I followed your instructions. The terminal says Nodeos started, but when I check status on tail -f nodeos.log, I get the following:

info  2020-05-15T09:16:38.431 nodeos    chain_plugin.cpp:412          operator()           ] Support for builtin protocol feature 'ONLY_BILL_FIRST_AUTHORIZER' (with digest of '8ba52fe7a3956c5cd3a656a3174b931d3bb2abb45578befc59f283ecd816a405') is enabled with preactivation required
info  2020-05-15T09:16:38.431 nodeos    chain_plugin.cpp:412          operator()           ] Support for builtin protocol feature 'RESTRICT_ACTION_TO_SELF' (with digest of 'ad9e3d8f650687709fd68f4b90b41f7d825a365b02c23a636cef88ac2ac00c43') is enabled with preactivation required
info  2020-05-15T09:16:38.431 nodeos    chain_plugin.cpp:412          operator()           ] Support for builtin protocol feature 'FIX_LINKAUTH_RESTRICTION' (with digest of 'e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff526') is enabled with preactivation required
info  2020-05-15T09:16:38.431 nodeos    chain_plugin.cpp:412          operator()           ] Support for builtin protocol feature 'GET_SENDER' (with digest of 'f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d') is enabled with preactivation required
info  2020-05-15T09:16:38.445 nodeos    chain_plugin.cpp:908          plugin_initialize    ] Starting fresh blockchain state using genesis state extracted from blocks.log.
warn  2020-05-15T09:16:38.449 nodeos    chain_plugin.cpp:1093         plugin_initialize    ] 13 St13runtime_error: "state" database dirty flag set
rethrow "state" database dirty flag set: 
    {"what":"\"state\" database dirty flag set"}
    nodeos  chain_plugin.cpp:1093 plugin_initialize
error 2020-05-15T09:16:38.450 nodeos    main.cpp:121                  main                 ] database dirty flag set (likely due to unclean shutdown): replay required

Any thought?

I found this on Nodeos Troubleshooting:

“Database dirty flag set (likely due to unclean shutdown): replay required”

nodeos needs to be shut down cleanly. To ensure this is done, send a SIGTERM , SIGQUIT or SIGINT and wait for the process to shutdown. Failing to do this will result in this error. If you get this error, your only recourse is to replay by starting nodeos with --replay-blockchain

Is it what I need to do?

Ok, lets create another tweak for that issue. :grin:

There are 2 ways that we can use in order to restar our blockchain to get rid of that issue.

1. Create another script to use it when we have a corrupted blockchain:

in ubuntu terminal , after properly apt-get update and upgrade.

Install nano if dont have it.

sudo apt-get install nano

Navigate to your contract folder.
Run command:

sudo nano nodeos_replay

inside black interface of nano, copy/paste this:

nodeos --replay-blockchain -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false >> nodeos.log 2>&1 &
echo "Nodeos REPLAY BLOCKCHAIN started, check status on 'tail -f nodeos.log'"
echo " "
echo "IMPORTANT: Remember to close proprely with command 'pkill nodeos'"

Ctrl+S to save on nano.
Ctrl+X to leave nano editor.

Run Command to make nodeos_start file executable:

sudo chmod +x nodeos_replay

Start command by:

./nodeos_replay

This will rebuild all the blockchain from scratch, so if you have some accounts or tokens created, you probably are going to lose them, so be sure to always use the “pkill nodeos” command in order to properly close the nodeos process to avoid a corrupted blockchain issue.

2. Manually deleting the eosio blockchain data folder.

Open a Terminal window, we have to navigate to the “.local” folder

cd ~/.local/share/eosio/nodeos/

Manually delete the “data” folder

sudo rm -vrf data

rm is the command to delete any file/folder on linux, -vrf means [v = verbose to explain what is being done, r= remove directory and content recursively, f= force to ignore nonexistent files and arguments]

You will be promted with somethin like this thanks to the verbose option:

removed 'data/somethingFile'
removed 'data/otherFile'
removed directory 'data'

Now you can close this terminal window and start again the blockchain with the script “nodeos_start” that you have created before.

Be aware that both methods will probably make you loose any account or token that you have created in the past, so have to restart all the accounts and smart contracts deployment from scratch. In both cases, to avoid this issue, you have to be sure to use the “pkill nodeos” command in order to properly close the nodeos process to avoid a corrupted blockchain issue.

Remember you can check here my personal (now public) library that i have to do to save me some time to learn and run a lot of commands.

  1. EOS Coding: this is a list of tutorials i made for myself to save a lot of time on the way.
  2. EOS Dog Contract Improvements: you can find here my own improvements on the Dog Contract has an example for the Academy.
  3. Issues & Fixes i found in the path.
  4. Linux tweaks for nodeos.
  5. EOS Developers portal.
  6. EOS functions index.

Hope you find this useful! :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

3 Likes

I was not allowed to do that:

ok this is easy, “permission denied” means that you have to run the command has a root user. Because the user that you are using at the moment it is not allow to start process or files.
Each time you get that message, just use the root user to start it

sudo ./nodeos_replay

You could try to research more about the permissions for files/foldes/process/script to get a better understanding of the subject!

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

I did it this time with sudo, but now the nodeos_replay command is not found:

However, the nodeos_replay file is in my contracts directory. Was it successfully made executable?

1 Like

ok sorry my bad, you forgot to make the “nodeos_replay” executable, i misstype it on the little guide.

you need to make it executable with:

sudo chmod +x nodeos_replay

after that, has you can see, it will change the color from gray to green, green color is made for executable files.

try again to run it with:

sudo ./nodeos_replay

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

Great, now it’s working! The node is running :grinning:

Is pkill nodeos fine when I need to shut dow Nodeos?

OK, I will continue the course and create a wallet.

Thanks a lot @thecil, this was very helpful! :+1:

1 Like

Great! happy to know that you made it work! be proud of it!
Also yes, everytime you want to shutdown the Nodeos process correctly, you have to use “pkill nodeos”, by doing it you will avoid to get the last issue (corrupted blockchain).

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

Hi guys,

Everytime I restart nodeos I have to re-deploy the contract and I have no data persistence for the table dog.

$ cat ~/stop_nodeos.sh
pkill nodeos
sleep 2
ps aux | grep nodeos | grep -v “grep” || echo “nodeos stopped”
grep “nodeos successfully exiting” /home/jj/nodeos.log | tail -2

cat ~/start_nodeOS.sh
nodeos -e -p eosio
–plugin eosio::producer_plugin
–plugin eosio::producer_api_plugin
–plugin eosio::chain_api_plugin
–plugin eosio::http_plugin
–plugin eosio::history_plugin
–plugin eosio::history_api_plugin
–filter-on=""
–access-control-allow-origin=’

–contracts-console
–http-validate-host=false
–verbose-http-errors >> nodeos.log 2>&1 &

Any clues ?

Thanks .

JJ.

1 Like

Hello sir, try this command instead for your “start_nodeOS.sh” (remember to backup it first)

nodeos -e -p eosio 
--plugin eosio::producer_plugin 
--plugin eosio::chain_api_plugin 
--plugin eosio::http_plugin 
--plugin eosio::history_plugin 
--plugin eosio::history_api_plugin 
--access-control-allow-origin='*' 
--contracts-console 
--http-validate-host=false >> nodeos.log 2>&1 & 
echo "Nodeos started, check status on 'tail -f nodeos.log'"
echo " "
echo "IMPORTANT: Remember to close proprely with command 'pkill nodeos'"

Also, which folder is your nodeos.log located? and the contract? Operating system that you are using?

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

Is it possible to delete a default cleos wallet?
I don’t see this possibility in cleos wallet subcommands.

Likewise, is it possible to delete an account?

1 Like