Quick start

The simplest way to consume the stream is using one of the clients. This example will walk you through the process of using a TypeScript client to start consuming a stream.

Prerequisites

  • You have npm or yarn installed on your computer.

  • You can extract data from ZIP archives.

Steps

  • Navigate to the Stream Registry.

  • Choose any stream with a "JSON" label. For example, proxima.eth-main.blocks.1_0

  • Click on it to get to the stream page.

  • Under "Details" click the "Download Consumer App" button. It will download a zip archive with a sample TypeScript application that uses our client to read the chosen stream.

  • Unzip the downloaded archive into a separate folder and cd to it.

  • Run npm install or yarn install

  • Run npm run build or yarn build

  • Run npm run start or yarn start

You should see a bunch of stream events printed to your console as the client reads them.

What's next?

You can investigate the code of the application and change the way it handles the events. It's really simple. For example, try to come app with an application that counts how many Ethereum blocks were mined by the miner 0xfeebabe6b0418ec13b30aadf129f5dcdd4f70cea (don't forget to handle undo events).

Rate limiting

By default, you are using an anonymous quota for requests which is really small. In order to increase the limit you should create your own API key in the User Portal and use it in the client.

Last updated