4
0
Fork 0

Updated README, and get rid of solc mix task

pull/5/head
hswick 7 years ago
parent 3b3ea4c654
commit 5ee2774822
  1. 29
      README.md
  2. 10
      mix.exs

@ -4,25 +4,17 @@
## Installation
1. Add exw3 to your list of dependencies in mix.exs:
def deps do
[{:exw3, "~> 0.1.0"}]
end
2. Ensure exw3 is started before your application:
def application do
[applications: [:exw3]]
[{:exw3, "~> 0.1.1"}]
end
## Overview
ExW3 is a wrapper around ethereumex to provide a high level, and user friendly json rpc api. It currently only supports Http. The primary feature it provides is a handy abstraction for working with smart contracts.
ExW3 is a wrapper around ethereumex to provide a high level, user friendly json rpc api. It currently only supports Http. The primary feature it provides is a handy abstraction for working with smart contracts.
## Usage
Ensure you have an ethereum node to connect to at the specified url in your config. Any easy local testnet to use is ganache-cli:
Ensure you have an ethereum node to connect to at the specified url in your config. An easy local testnet to use is ganache-cli:
```
ganache-cli
```
@ -33,7 +25,7 @@ config :ethereumex,
url: "http://localhost:8545"
```
Currently ExW3 supports a handful of json rpc commands. Mostly just the useful ones. If it doesn't support those specific commands you can always use the Ethereumex commands.
Currently, ExW3 supports a handful of json rpc commands. Mostly just the useful ones. If it doesn't support a specific commands you can always use the [Ethereumex](https://github.com/exthereum/ethereumex) commands.
```elixir
iex(1)> accounts = ExW3.accounts()
@ -84,17 +76,4 @@ iex(9)> ExW3.Contract.send(SimpleStorage, :set, [1], %{from: Enum.at(accounts, 0
{:ok, "0xb7e9cbdd2cec8ca017e675059a3af063d754496c960f156e1a41fe51ea82f3b8"}
iex(10)> ExW3.Contract.call(SimpleStorage, :get)
{:ok, 1}
```
## Compiling Solidity
Ensure you have solc installed:
```
solc --version
```
Then if you've made changes to the example contracts you can compile them like this:
```
mix solc
```

@ -53,14 +53,4 @@ defmodule ExW3.MixProject do
links: %{"GitHub" => "https://github.com/hswick/exw3"}
]
end
end
defmodule Mix.Tasks.Solc do
use Mix.Task
@shortdoc "Runs the solc compiler to create binary and abi of all contracts. Outputs to build directory"
def run(_) do
# calling our Hello.say() function from earlier
Mix.Shell.IO.cmd("solc -o test/examples/build --abi --bin test/examples/contracts/* --overwrite")
end
end
Loading…
Cancel
Save