0

I am developing a website (Php/mysql) for trading, which will communicate with block chain via smart contract. My website will be a service based website. it will not a high traffic website and have restricted access. So I need to host the website somewhere and also need to download Ethereum blockchain. I believe hosting website and creating ethereum node in same server will be a good idea so that code can connect locally to the blockchain. I will be using go-ethereum client and node.js.

I was thinking of using a VPS. My question is what should be the minimum hardware requirements (CPU, RAM. memory etc). Anything that I might need to take care of? Is AWS EC2 instance a better option ?

1

Minimum hardware requirements (for initial sync): 4 CPU, 8 GB RAM, 100 GB disk Minimum hardware requirements (for normal operations): 2 CPU, 4 GB RAM, 200 GB disk

Hosting a website and creating ethereum node on the same server is NOT a good idea. One will be affected by another. When your webserver gets overloaded, you'll have issues syncing the node. When Ethereum network gets congested, you'll have issues with your webserver. Use web3 with node.js (RPC). If you're sending raw transactions, you might want to use a public/private node - https://www.infura.io/ (public, free) or https://www.fosha.org/ (private, subscription).

1

If traffic isn't that concerned, you may want to look into my current setup.

My current setup is as follow,

- centos
- AWS Instance Type: t2.large: 2 vCPUs, 8GB RAM
- Disk: 80GB (50 GB currently used, expected to grow over time).

I am running Parity with the flag --warp synced, this will keep only the latest 64 states by default. however, its expected to grow over time, not much though.

We also tried geth with --fast sync mode, but we choose to use parity as our mainnet given the fact that it had the reputation of being the most robust and performant. Refer here for current geth --fast sync size

Give aways:

  • Set up a non-root user, with sudo rights
  • Remove root login via ssh
  • I strongly recommend restricting access to the JSON RPC interface. There are so many bots out there, they can easily get into publicly posted node and steel all your hard earned ethers from unlocked account.

Setup Parity as a service under systemd

Set up the following systemd service:

$ vi /etc/systemd/system/parity.service
[Unit]
Description=Parity

[Service]
Type=simple
User= <your_user_name>
Restart=always
ExecStart=/usr/bin/parity --warp --port 30303 --jsonrpc-port 8545 


[Install]
WantedBy=default.target

Tuning parity sync:

  • Parity offers continuous state trie pruning; —pruning fast will keep only latest 64 states in the client. Its expected grow with less growth. Its default with latest version?
  • To speed up block processing, you can increase the cache size based on your memory size.If you have 8 gb, you can leave 1/2GB —cache-size 1024. You can increase even further based your memory usage.
  • Use database compaction if you want to optimize using following flags based on your disk type --db-compaction hdd or --db-compaction ssd respectively.

parity --pruning fast --db-compaction ssd --cache-size 1024

This chain data will have to be removed and re --fast(if you are using geth client) or --warp(if parity client) synced periodically to keep the disk space requirements lean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.