Scripts for Managing Multiple SmartCash Smart Nodes on One Server

in #smartcash6 years ago

I finally got all my Smart Nodes up and running (see my previous post for more on what a Smart Node is) and needed to create some scripts to manage them.

This isn't really a start up guide as much as it tells a story of what I did, and it might be helpful for those who already understand how Smart Nodes work, but want some scripts to manage multiple nodes on a server.

The first step on my new box was to get IP addresses added.

Adding lines like this in the iface eth0 inet static block inside /etc/network/interfaces/ did the trick:

  up route add -net x.x.x.11 netmask 255.255.255.240 gw y.y.y.y eth0
  up ip addr add x.x.x.11/28 dev eth0
  up ip addr add x.x.x.12/28 dev eth0

Where y.y.y.y is the main server IP and x.x.x.11, x.x.x.12, x.x.x.13, etc are the IPs we want to add. This example assumes you have a /28 which has 15 usable IPs. The 11, 12, 13 are just examples.

Next I followed the start up guide and will add notes here starting with these parts:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:smartcash/ppa
sudo apt-get update
sudo apt-get install smartcashd

mkdir ~/smartcash/
mkdir ~/smartcash/SmartNode_bootstrap
cd ~/smartcash/

You can use all of the scripts I made on your server as well (make sure they are executable via chmod +x <file>). A lot of these borrow heavily from the scripts you can find here: https://github.com/SmartCash/smartnode but have been modified to handle multiple nodes.

  • create_node.sh
    Script for copying from an already synced SmartCash SmartNode to a SmartNode01, SmartNode02, etc folder.

  • clear_all_logs.sh
    Clears all log files every other day

  • smart-cli.sh
    Call smartcash-cli for a specific node

  • checkdaemons.sh
    If the blocknumber isn't increasing, restart the deamon.

  • makerun.sh
    Make sure each smart node is running. If it's not, restart it.

  • printblocks.sh
    Print out the current block numbers for all nodes.

  • smart-start.sh
    Start a specific Smart Node.

Start with a bootstrap of the blockchain via:

wget http://proteanx.com/txindexstrap.zip
unzip txindexstrap.zip

Copy those folders into SmartNode_bootstrap and start up your server via smart-start.sh:

./smart-start.sh _bootstrap

That will take a long time to sync up. You check the status with:

./smart-cli.sh _bootstrap getinfo

Once it's done, you're ready to start creating your nodes. First, shut it down:

./smart-cli.sh _bootstrap stop

Now you should be ready. Have all your GenKeys, IPs, Node Numbers, and RPC Ports ready. I just increment the Node Numbers (01, 02, 03, etc) and RPC Ports (9679, 9680, 9681, etc)

./create_node.sh

The just fill in the prompts starting with your first node (01), and you should be good to go. Next just start your first node with:

./smart-start.sh 01

Verify it's working with:

./smart-cli.sh 01 getinfo

Once you get all your nodes set up, create two text files start_number.txt and end_number.txtand put in them your start and end numbers for how many nodes you have. For example, if you had 30 nodes on one machine, put a single 1 in start_number.txt and 30 in end_number.txt.

If you have additional servers to set up, I recommend zipping up the SmartNode_bootstrap folder and sending it to the new server via scp to save you some time.

I also set the following crontab entries to ensure the log files don't get too big, the blocknumbers are increasing, and the daemons are running:

0 0 */2 * * ~/smartcash/clear_all_logs.sh
*/2 * * * * ~/smartcash/makerun.sh
*/30 * * * * ~/smartcash/checkdaemons.sh

I spent quite a bit of time putting these scripts together to manage my nodes, so I hope it saves you some time.

Please don't ask me what the future price of SmartCash will be or if Smart Nodes will remain this profitable for long. I have no idea.

Using this calculator tool by @bitcoiner as a guide, here's what we see now:

Sounds crazy, right?

I don't know if we'll end up having > 50,000 nodes or if the price will go down or what. Maybe hyperinflation will tank the price. Maybe node opperators will regularly sell to add down pressure. At this point, I'm treating all of this as pretend money until it has a lot more volume, is traded on a lot more exchanges, and has a lot more use-cases as cash in real-world situations. For now, I'm just having fun, taking a risk on a relatively new project.

The Smart Cash team has dealt with quite a few bumps and bruises lately. They had an issue with the zerocoin protocol which may have led to some hacked coins (I'm still waiting for an official announcement from their team on that). Fixing that caused problems for exchanges, including Cryptopia which, as of this post, is delisting SmartCash (you can still get them on Crypto Bridge).

The rollout of Smart Nodes went fairly well, but there's also some issues with the rewards payout not being correct and some (like myself) not getting any rewards while others are getting double rewards. Hopefully this will be fixed by their team very soon. I like how they are communicating well about the issue:

You can find out more via their Discord channel.

Here are my previous Smart Cash Posts:


Luke Stokes is a father, husband, business owner, programmer, STEEM witness, and voluntaryist who wants to help create a world we all want to live in. Visit UnderstandingBlockchainFreedom.com

I'm a Witness! Please vote for @lukestokes.mhth

Sort:  

The answer I still cannot find is... what makes smart cash novel compared to other master node systems? Anyone know? :D I’ll upvote that post 100% !

Seems to be very big community based project, targeting the third world countries mainly

Managing all of them on one server sounds a lot better than having to manage each of them on their own individual servers. I am quite intrigued to see what happens with the smart nodes and seeing if they get these issues worked out with the payouts for the nodes. I would definitely would like for the going to be on some more exchanges something maybe like binance or bittrex even it’s just to get some more volume because we are somewhere around like 600x for our volume to the market cap currently.

Yeah, the price and market cap are both kind pretend until we get some real volume on some major exchanges. It's still early. Time will tell.

You are exactly right! I think they have a strong development team and have a great vision. I’m still not sold about what happened with rollback and cryptopia and the zerocoin exploit.

I know. I definitely have some concerns about the hashing power available and whether or not they will be at risk of 51% attacks in the future.

How distributed is the coin as far as whales go?

Always hard to really tell as multiple people can control multiple addresses, but here's the top 100 list: https://explorer.smartcash.cc/richlist

I hadn’t seen this before! Thanks for sharing it! #5 has nearly 20 million. That is insane

Σ$$$ Tipped @sevinwilson Σ25 SMART! Comment @smartbot help to claim. Currently the price of SmartCash in the market is $0.343 USD per SMART. Current value of the tip is $8.58 USD. To find out more about SmartCash, please visit https://smartcash.cc.

thanks for your shearing.

Glad I found this!! I'm really into masternodes and this look pretty similar and the amount to start seems low enough for me!!!

Me and a friend got enough coins for Smart Nodes and I looked into a lot of different masternodes and this one honestly seems like a sleeper considering you can get the Smart Node earnings and Smart Rewards each month as well. Our plan is to earn enough coins and keep putting up more Smart Nodes. Time will tell but I guess I have my hopes these things will be worth 50K + a piece sooner than later.

I'll put my money on it going up. I feel it in my bones😂. It's gonna rise.

I don't know of you wouldn't mind me translating this to French.
It will really be of much benefit to the new small upcoming French community.
I would of course give you credit as the original author and put your link in the post.

Sure, go for it. Feel free to link back to this original so they can give me some upvote love as well. :)

Sure thing
Thanks☺

Hey, I don't know what your talking about, but I like the way you say it. How do I set up just a single node?

Wow, thanks for sharing and explaining your process. This will definitely be helpful if I decide to go with multiple nodes. I'm actually hoping for a nice dip to start accumulating some more SMART. Their discord is super helpful as well. Hopefully the payment scheduling is just a minor blip before a long haul of steady node payouts :)

I hope so too. Still waiting for my first reward after more than 2 days of being live.

When programmers give updates,
What does a novice like me understands?

Not every post is for everyone. :)

Well is smart creative to setup a smartcash nodes as well as working on it i so much congratulate you@lukestokesand would love to learn more of this

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64223.84
ETH 3158.34
USDT 1.00
SBD 4.29