Skip to content

ltfschoen/abci_server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abci_server

An Erlang application that allows writing Application Blockchain Interface servers.

ABCI Server with Erlang bindings is used by the Tendermint Ecosystem

This application uses semantic versioning 2.0.

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

    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

    mix deps.get
  • Documentation Generation. Open Documentation in Web Browser

    cd deps/abci_server/ && make docs && open doc/index.html && cd ../../
  • Run IEx

    iex -S mix
  • Create a Fake Module named Foo

    iex(1)> defmodule Foo do
    ...(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

    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

      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

      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
    rm -rf deps
  • Adding Ranch 1.4.0 to the mix.exs file of your Mix project.
    {:ranch, git: "https://github.com/ninenines/ranch.git", tag: "1.4.0"}
  • Install Mix Dependencies
    mix deps.get

Documentation

Run make docs and open doc/index.html.

Contributing

To run tests, execute make tests.

Write function specifications. To run Dialyzer, execute make dialyzer.

No hard line length limit is imposed.

If you want to regenerate Protocol Buffers code after fetching new version of include/abci.proto, comment out eventual Go-related imports in that file and execute make gpb.

License

This software is licensed under under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

An application that allows writing ABCI servers.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Erlang 99.8%
  • Makefile 0.2%