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

thanks for sharing this info <3

You seem pretty passionate by SmartCash setuping nodes and investing in it. For me what are you doing looks so complicated that I am even afraid to try to understand it...

This post is useful for a small group of people. For the rest... feel free to ignore.

Crypto news are useful for a small group of people too, but I don't know if everybody else should ignore them. Maybe on the same principle, some cutious people will read more about SmartCash and start to setup their own Smart nodes. On the other side, I agree with you, this article is more useful for a specific group of people :D

Σ$$$ Tipped @mejustandrew Σ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.

@smartbot help

You can use the following commands:

  • balance - displays your current wallet balance
  • address- displays your deposit address
  • withdraw <amount> <address> - withdraws the amount of SMART to address
  • tip <usernamegt; <amount> - sends the amount of SMART to username
  • terms - displays terms and conditions for using @smartbot

withdraw 25 Sit7VXpWFeGPSxqf9ALodhoEVb4DbDKyDb

@mejustandrew: Σ24.99 SMART has been withdrawn from your account to Sit7VXpWFeGPSxqf9ALodhoEVb4DbDKyDb. You have been charged Σ0.01 SMART withdrawal fee. Transaction a48d02b0db55d8ad5a1b0c00d0a465f94860d00f5ec4e2b990bd2a8d91ec4fea is now completed. To monitor the transaction status click HERE.

Wow, I see there is a tiping bot for SmartCash, this is such a nice idea! Thank you for giving me this tip. If I understand correctly, I will have to go to their website, download the wallet and make a new address in order to be able to receive your tip. Am I right?

I’d say for now just use the web wallet. I’ve used it for a long time and it works great and lets you access your private keys directly. It also has built in 2FA.

I can't believe, I have just received your tip, thank you so much! It feels good to get tipped by somebody, do you want me to send you back some SmartCash to get the same feeling? :D

Thank s

Awesome , great post. I recently discovered ur interesting blog. Which I didn't hesitate to follow you , upvote and resteem. Support me too , I am new on steemit. Upvote my comment . Thanks.

Thanks mate, I hope you have a great day!!!

this is going to be usefull, I have gotten close to the 10k (7.7) and am planning to start a node, and someone I know wants one as well but has no clue about servers (even less then me) so we are looking to a solution like this

This is specifically for those setting up multiple nodes. If you get to the point where you're ready to set one up, be sure to check the website for the latest tutorials on how to do it (and check Discord for help).

Σ$$$ Tipped @photolander Σ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 the detailed post and for addressing the current issues! It’s important to be real:) Glad that @SmartCash is working on it and communicating back. We love Smartcash and it will be fun to watch this coin blow up!!

Σ$$$ Tipped @consciousangel7 Σ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.

@smartbot withdraw SS6rchYeiPUPZTTLTqf8WLqFxrZkhZff1i 25

@consciousangel7: Σ24.99 SMART has been withdrawn from your account to SS6rchYeiPUPZTTLTqf8WLqFxrZkhZff1i. You have been charged Σ0.01 SMART withdrawal fee. Transaction aae3135d8d85a3684d65d4066c2c75c4b17c9f1647037bb2b37ca821d97fc9ab is now completed. To monitor the transaction status click HERE.

Thanks for the love @lukestokes :)

Awesome stuff. I'm currently working on gaining enough smartcash to set up my own nodes soon. I'm going to keep this saved for the day I'm ready to set up some master nodes. Thanks for the great work.

I have had an AWS account and I was able to get a 3 year t2 micro which is 1GB ram and 30GB hd for $100 which is about $3/month cost. I have 2 payouts on my node already so have already paid back my node cost. From here on it is just profit. I am REALLY curious to see what happens as the number of nodes increases.

I am pretty sure Smartcash will do well, it will really depend on the overall crypto-sphere. Everything is far to closely tied to bitcoin right now so are still under it's influence.

Wow, well done! That's a nice set up, but my hunch is you'll need more than a GIG as the blockchain grows long before 3 years, but I guess time will tell.

Yeah, i was thinking about it when setting it up, the future needs, but if it comes to it I can always grab another upgraded instance and shift to it if needed. With everyone's scripts being made available it will be even easier to migrate if I have to.

wish there was some easier way, i also have a few nodes to setup ;x

Ahhhh this will help many people, as I had trouble with these same issues as well. Will resteem and follow :)

All nodes on one server one point of failure by the same argument one point to manage. I would like to know the specifications of the server you use for this . Is it virtual or a physical server. Another question I have wondered about is how you solve the issue of unique IP addresses. I may reconsidere my setup if this is really workable. Thanks for sharing. I am re-steeming this.

It's a dedicated server. I originally went for a 64G server to manage them all, but there was a limitation in the number of IPs I could get, so now I have a 64G and a 32G. I could have easily done the nodes I wanted with just two 32G servers. It is a potential point of failure, but we're already up over 5k nodes, so I don't think it's a real concern for the network. I'll be adding even more monitoring scripts so it'll text me if needed, as I've done with my witness servers.

Thanks for the very detailed reply. I will seriously look at this option it is certainly more efficient to manage. It is a better plan for scaling number of nodes as well as handling more volume of transactions in the future.

Still hoping to jump into this one before the general FUD is over and everything will be pricey :) Thanks LUKE! Great work as always!

you are a genius, also a person who loves to share knowledge. hopefully your kindness will bring you to the top of success

how amazing what you do is very inspiring
UPCOTE my comnt en folow me

Nice post bro, when i reach the second now i will use your script!!

I just setup my first smartnode! :) So excited!! thinking to buy more to have more MNs. :) Just got a quick question, where can I see its ROI and some numbers about MNs ?! Thanks!

I really don't figure that out to manage 4 Masternode in one server. I am thinking of virtual server in one virtual server but it don't work as what I expected.

Thanks Luke! I think I will end up running two Smartnodes on the same server. This helps a lot .

Luke,
I found a lot of this info and scripts to be helpful.
I am using Ubuntu 18.04 LTS and it uses netplan not is up/down.
I add the subnets to the same interface with the route as the server ip.
I can ping the subnet IPs and I can netcat -l 9678 and it will open , but smartcashd (bind=10.10.10.2) will not open up 9678. Any help would be great. Other coin MNs are not as picky with the active port.