-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add Mix Install/Docs, Start/Stop ABCI Server guides #3
Changes from all commits
61a25bf
f8a333c
e4101d0
e3bc50f
0cac0c2
f4b6396
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,103 @@ | |
|
||
An Erlang application that allows writing [Application Blockchain Interface](https://github.com/tendermint/abci) servers. | ||
|
||
ABCI Server with Erlang bindings is used by the [Tendermint Ecosystem](http://tendermint.readthedocs.io/projects/tools/en/master/ecosystem.html#abci-servers) | ||
|
||
This application uses [semantic versioning 2.0](http://semver.org/). | ||
|
||
[erlang.mk](https://erlang.mk/) is used as a build tool. | ||
|
||
## Installation with Mix and Usage in Interactive Elixir (IEx) | ||
|
||
* Add ABCI Server (Erlang) to mix.exs. [Choose a Release Tag](https://github.com/KrzysiekJ/abci_server/tags) | ||
```elixir | ||
defp deps do | ||
[ | ||
# ABCI Server (Erlang) - https://github.com/KrzysiekJ/abci_server | ||
{:abci_server, git: "https://github.com/KrzysiekJ/abci_server.git", tag: "v0.4.0"} | ||
] | ||
end | ||
``` | ||
|
||
* Install Mix Dependencies | ||
```bash | ||
mix deps.get | ||
``` | ||
|
||
* Documentation Generation. Open Documentation in Web Browser | ||
```bash | ||
cd deps/abci_server/ && make docs && open doc/index.html && cd ../../ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already covered in the “Documentation” section. |
||
``` | ||
|
||
* Run IEx | ||
```bash | ||
iex -S mix | ||
``` | ||
|
||
* Create a Fake Module named Foo | ||
``` | ||
iex(1)> defmodule Foo do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This module doesn’t implement the |
||
...(1)> def bar() do | ||
...(1)> IO.puts("You're using ABCI Server!") | ||
...(1)> end | ||
...(1)> end | ||
{:module, Foo, | ||
<<70, ..., 117, ...>>, {:bar, 0}} | ||
``` | ||
|
||
* Show ABCI Server Information (using `module_info/1` which is the Erlang equivalent of Elixir's `__info__/1`), Start ABCI Server, Stop ABCI Server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a generic Erlang function. I don’t see much utility in putting information about this in README. |
||
``` | ||
iex(3)> :abci_server.module_info | ||
[ | ||
module: :abci_server, | ||
exports: [ | ||
start_link: 4, | ||
start_listener: 2, | ||
... | ||
], | ||
attributes: [ | ||
... | ||
behaviour: [:gen_server], | ||
behaviour: [:ranch_protocol] | ||
], | ||
compile: [ | ||
... | ||
], | ||
native: false, | ||
md5: <<65, ..., 206>> | ||
] | ||
``` | ||
|
||
* Run the ABCI Server's `start_listener` and `stop_listener` functions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already written in |
||
``` | ||
iex> {ok, _} = :abci_server.start_listener(Foo, 46658) | ||
{:ok, #PID<0.181.0>} | ||
|
||
iex> ok = :abci_server.stop_listener(Foo) | ||
:ok | ||
``` | ||
|
||
* Test the Running ABCI Server (Erlang) in separate Bash Terminal Tab - https://github.com/tendermint/abci#tools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is Tendermint-related documentation, no need to duplicate it here. |
||
``` | ||
abci-cli test | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
If when running IEX you get error `(Mix) Could not start application ranch: could not find application file: ranch.app` then a possible solution is to install Ranch 1.4.0. | ||
* Remove existing Mix dependencies | ||
```bash | ||
rm -rf deps | ||
``` | ||
* Adding Ranch 1.4.0 to the mix.exs file of your Mix project. | ||
```elixir | ||
{:ranch, git: "https://github.com/ninenines/ranch.git", tag: "1.4.0"} | ||
``` | ||
* Install Mix Dependencies | ||
```bash | ||
mix deps.get | ||
``` | ||
|
||
## Documentation | ||
|
||
Run `make docs` and open `doc/index.html`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a generic Elixir command, no need to put it here.