-
Notifications
You must be signed in to change notification settings - Fork 88
Home
Welcome to the eth.rb wiki! We'll try to use this space to explore some usage examples of the Ethereum Ruby gem.
A straightforward library to build, sign, and broadcast Ethereum transactions. It allows the separation of key and node management. Sign transactions and handle keys anywhere you can run Ruby and broadcast transactions through any local or remote node. Sign messages and recover signatures for authentication.
Want to fiddle around? Download the gem and run bin/console
which loads the eth
gem from a local path and includes the entire Eth::
namespace in a Pry console.
#!/usr/bin/env ruby
# use the local version of the code instead of a globally installed gem
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "eth"
include Eth
require "pry"
Pry.start
All examples in this wiki use this console for the sake of simplicity.
- Account Management (Secp256k1)
- Chain Management (EIP-155)
- Checksummed Addresses (EIP-55)
- RPC-Client (HTTP, HTTPS, IPC)
- Transactions (Type 0, 1, and 2)
- Solidity Bindings (compiler only)
- Smart Contracts (compile, deploy, transact, call)
Note, that this wiki only covers eth
of version ~> 0.5
and later. You can install it from Rubygems with gem install eth
and add it to your project.
Gemspec:
spec.add_dependency "eth", "~> 0.5"
Gemfile:
gem "eth", "~> 0.5"
Require:
require "eth"
Include (optional):
include Eth
Happy hacking. We have an informal Telegram community at @ruby_eth if you want to contribute or face any issues.