Skip to content

This project contains different whatsonchain.com plugin examples.

Notifications You must be signed in to change notification settings

TAAL-GmbH/woc-plugins-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

woc-plugins-example

This project contains different WhatsOnChain plugin examples. To learn more about plugins click here

Prerequisites

Node.js 18.14.2 or above

Installation

  1. Clone this repo using git clone https://github.com/TAAL-GmbH/woc-plugins-example.git
  2. Move to the directory: cd woc-plugins-example
  3. Run cp .env.template .env
  4. Run npm i in order to install dependencies
  5. Run npm start.

You will now be able to run the examples below.

Examples

Transaction type plugins

Block type plugin

Address type plugin

Script type plugin

Search type plugin

Data decoder plugin

How to test the plugin on whatsonchain.com

  1. Go to https://whatsonchain.com/ and then select 'Manage Plugins' link from the tools menu.
  2. For this example select 'Block' from the decoder type drop down.
  3. For this example lets name the plugin 'Block Anim'.
  4. For the webhook url field use the following placeholder url http://localhost:3000/block-decode/{network}/anim/{blockhash} (Make sure you have the application running locally. In reality this will be the using the deployed url rather then running from localhost).
  5. For the preview hash use an actual blockhash from mainnet. For this example you can use: 000000000000000002c7b29b04ec4431c380751463c6b3cb23f6fad414de8fe7.
  6. The remaining fields you can fill in however you wish.
  7. Make sure you have the example application running and then select the save button. You should be able to see a preview.

If you go to the any block page like https://whatsonchain.com/block-height/782095 you should now see a tab called 'Block Anim' which will allow you to view the decoder. As information is stored in local storage only you can view this on the browser you added the plugin to.

Publishing the plugin

To make this plugin accessible to all user's on WhatsOnchain the decoder application will need to be published (Assuming at this point that your application is already deployed). You can then follow the instructions on how to publish by going to 'manage plugins' link on WhatsOnchain then clicking on the burger menu icon to the right of the plugin menu item named 'Block Anim' and selecting publish.

All the instructions will be presented to you on how to then publish the plugin.

About

This project contains different whatsonchain.com plugin examples.

Topics

Resources

Stars

Watchers

Forks