diff --git a/README.md b/README.md index 72fce05..32877dc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The documentation is posted at [hexdocs](http://hexdocs.pm/elixir_ipfs_api/) The package is published on [Hex](https://hex.pm). Add the elixir\_ipfs\_api as follow -``` +```elixir defp deps do [ ... @@ -32,14 +32,14 @@ end Start the IPFS daemon by running the following in terminal -``` +```bash $ ipfs daemon ``` This will start the ipfs daemon with the API endpoint at localhost:5001. If you want to start the API endpoint at a different address then add to the config -``` +```bash $ ipfs config Addresses.API /ipfs/127.0.0.1/tcp/5007 ``` @@ -47,7 +47,7 @@ $ ipfs config Addresses.API /ipfs/127.0.0.1/tcp/5007 The [IpfsConnection](http://hexdocs.pm/elixir_ipfs_api/IpfsConnection.html) entity contains the information of the IPFS API endpoint. By default it will try to connect to http://localhost:5001/api/v0 -``` +```elixir conn = %IpfsConnection{host: "127.0.0.1", base: "api/v0", port: 5007} ``` @@ -56,7 +56,7 @@ conn = %IpfsConnection{host: "127.0.0.1", base: "api/v0", port: 5007} ### Adding content to IPFS -``` +```elixir iex> conn = %IpfsConnection{} iex> IpfsApi.add(conn, "Hello world from Elixir-Ipfs-Api") {:ok, @@ -67,7 +67,7 @@ iex> IpfsApi.add(conn, "Hello world from Elixir-Ipfs-Api") ### Getting content from IPFS -``` +```elixir iex> conn = %IpfsConnection{} iex> IpfsApi.get(conn, "QmTcCZJEW1kUcYU1bKQk9SMGRsTisMMWXuxJ1AQerHwyaA") <<81, 109, 84, 99, 67, 90, 74, 69, 87, 49, 107, 85, 99, 89, 85, 49, 98, 75, 81, 107, 57, 83, 77, 71, 82, 115, 84, 105, 115, 77, 77, 87, 88, 117, 120, 74, 49, 65, 81, 101, 114, 72, 119, 121, 97, 65, 0, 0, 0, 0, ...>>