I am looking for some kind of walk through or tutorial about how to use ethereum with an ruby on rails application?
Is there anything out there?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityYou can find so many tools for using ruby to access the Ethereum Blockchain.
You have for example (like 5chdn♦ said in a comment):
Also, here you have an Ethereum StackExchange answer which tells about how to connect Geth by IPC on rails.
You can check also ethereum.rb.
It is more recent ruby gem, supporting parity 1.5+ and solidity compiler. It comes with:
There is also the ethereum-tx gem. It is intended for keeping the signing and building of transactions separate from the full node. You could host your full node on the same server, but you don't need to. For a lot of Ethereum applications, you only need to be able to read the blockchain and send transactions. Depending on the frequency with which you need to do this, you could run your own node, or maybe get away with using a block explorer's API.
If you already have private keys with ether you can import them, or generate new keys to send Ethereum(see Ethereum::Key
class). Once you have some keys you can build transactions and sign them with the key(see Ethereum::Tx
class). Finally, you can encode those transactions and broadcast them to an Ethereum full node using the JSON-RPC API, or any block explorer that supports raw transactions(either way you just need an HTTP library).
The one thing left to do is get notifications about when an address receives messages or ether. Events work for contracts, but not regular accounts. I'm not really sure of a fully comprehensive solution in any language, so I'd recommend rolling your own based on your specific needs.
I have published an Ethereum on Rails template on Github.
It is a boilerplate application that allows authenticating users in your Rails 7.0 application with an Ethereum wallet (e.g., MetaMask).
You can use this repository as a template to create your custom Rails application that already has Ethereum support bundled. It uses the new eth
gem for Ethereum account management.
https://github.com/fogonthedowns/blupee is a simple Ruby interface for working with the Ethereum Blockchain:
new wallet:
ether_wallet = Blupee::API::Ether.new_wallet('[hidden]')
wallet balance:
ether_balance = Blupee::API::Ether.balance("0xad96B1072E60f6279F628E7512242F9b1A83127F")
erc20 tokens:
args = {wallet_address:"", contract_address:""}
Blupee::API::Token.balance(args)