Run this notebook

Use Livebook to open this notebook and explore new ideas.

It is easy to get started, on your machine or the cloud.

Click below to open and run it in your Livebook at .

(or change your Livebook location)

# JungleBus ```elixir Mix.install( [ {:bsv, "~> 2.1"}, {:httpoison, "~> 1.8"}, {:jason, "~> 1.3"}, ], config: [ bsv: [ network: :main # network: :test ] ] ) server_url = "https://junglebus.gorillapool.io" ``` ## Consuming JungleBus Endpoints https://junglebus.gorillapool.io/docs/ ```elixir txid = "A-TXID-GOES-HERE" address = "AN-ADDRESS-GOES-HERE" height = 800000 ``` `GET /v1/transaction/get/:txid` ```elixir url = "#{server_url}/v1/transaction/get/#{txid}" ``` ```elixir response = HTTPoison.get(url) ``` ```elixir {:ok, body} = response ``` ```elixir body.body |> Jason.decode! ``` ## By Address ```elixir url = "#{server_url}/v1/address/get/#{address}" ``` ```elixir response = HTTPoison.get(url) {:ok, body} = response body.body |> Jason.decode! ``` ```elixir url = "#{server_url}/v1/address/transactions/#{address}" ``` ```elixir response = HTTPoison.get(url) {:ok, body} = response body.body |> Jason.decode! ``` ## Blocks `GET /v1/block_header/get/:height` ```elixir url = "#{server_url}/v1/block_header/get/#{height}" ``` ```elixir response = HTTPoison.get(url) {:ok, body} = response body.body |> Jason.decode! ``` `GET /v1/block_header/list/:height` ```elixir url = "#{server_url}/v1/block_header/list/#{height}" ``` ```elixir response = HTTPoison.get(url) {:ok, body} = response body.body |> Jason.decode! ```
See source

Have you already installed Livebook?

If you already installed Livebook, you can configure the default Livebook location where you want to open notebooks.
Livebook up Checking status We can't reach this Livebook (but we saved your preference anyway)
Run notebook

Not yet? Install Livebook in just a minute

Livebook is open source, free, and ready to run anywhere.

Run on your machine

with Livebook Desktop

Run in the cloud

on select platforms

To run on Linux, Docker, embedded devices, or Elixir’s Mix, check our README.

PLATINUM SPONSORS
SPONSORS
Code navigation with go to definition of modules and functions Read More ×