junglebus

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

JungleBus

JungleBus

Real-time BSV blockchain data streaming from GorillaPool. Indexes all Bitcoin transactions with special handling for data protocols.
来自GorillaPool的实时BSV区块链数据流。为所有比特币交易建立索引,并对数据协议进行特殊处理。

When to Use

使用场景

  • Subscribe to transactions matching specific patterns
  • Stream real-time mempool and block data
  • Build indexers or notification systems
  • Monitor addresses or script patterns
  • Track 1Sat Ordinals, MAP, BAP, and other protocols
  • 订阅符合特定模式的交易
  • 流式传输实时内存池和区块数据
  • 构建索引器或通知系统
  • 监控地址或脚本模式
  • 追踪1Sat Ordinals、MAP、BAP及其他协议

Creating a Subscription

创建订阅

Step-by-Step (Dashboard)

分步操作(控制台)

  1. Visit https://junglebus.gorillapool.io
  2. Sign in or create an account
  3. Navigate: Dashboard > Subscriptions > Create New
  4. Fill in subscription details:
    • ID: Auto-generated unique identifier
    • Name: Descriptive name for your subscription
    • Description: What this subscription monitors
  1. 访问 https://junglebus.gorillapool.io
  2. 登录或创建账户
  3. 导航至:控制台 > 订阅 > 新建订阅
  4. 填写订阅详情:
    • ID:自动生成的唯一标识符
    • 名称:订阅的描述性名称
    • 描述:此订阅监控的内容

Subscription Filters

订阅过滤器

Define what transactions to capture using AND logic (all conditions must match):
FilterDescriptionExamples
AddressesComma-separated Bitcoin addresses
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
Input typesInput script types
ordlock
,
sigil
Output typesOutput classifications
aip
,
bap
,
bitcom
,
map
,
ord
,
run
,
token_stas
,
pubkeyhash
,
nulldata
ContextsMain data from OP_RETURN outputsProtocol-specific identifiers
Sub contextsSecondary data from outputsDepends on output type
Data keysKey=value pairs from transactions
app=junglebus
,
type=post
Note: Multiple values in a single field use AND logic - all must be present in the transaction.
使用AND逻辑定义要捕获的交易(所有条件必须匹配):
过滤器说明示例
地址逗号分隔的比特币地址
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
输入类型输入脚本类型
ordlock
,
sigil
输出类型输出分类
aip
,
bap
,
bitcom
,
map
,
ord
,
run
,
token_stas
,
pubkeyhash
,
nulldata
上下文OP_RETURN输出中的主要数据协议特定标识符
子上下文输出中的次要数据取决于输出类型
数据键交易中的键值对
app=junglebus
,
type=post
注意:单个字段中的多个值使用AND逻辑——必须全部出现在交易中。

Common Subscription Patterns

常见订阅模式

Monitor 1Sat Ordinals:
  • Output types:
    ord
  • Contexts:
    image/png
    ,
    text/plain
    (content types)
Monitor BAP Identity:
  • Output types:
    bap
  • Contexts:
    1BAPSuaPnfGnSBM3GLV9yhxUdYe4vGbdMT
    (BAP address)
Monitor MAP Protocol:
  • Output types:
    map
  • Contexts:
    1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5
    (MAP prefix)
Monitor Specific Address:
  • Addresses:
    1YourAddressHere
监控1Sat Ordinals
  • 输出类型:
    ord
  • 上下文:
    image/png
    ,
    text/plain
    (内容类型)
监控BAP身份
  • 输出类型:
    bap
  • 上下文:
    1BAPSuaPnfGnSBM3GLV9yhxUdYe4vGbdMT
    (BAP地址)
监控MAP协议
  • 输出类型:
    map
  • 上下文:
    1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5
    (MAP前缀)
监控特定地址
  • 地址:
    1YourAddressHere

JavaScript Client

JavaScript客户端

Installation

安装

bash
npm install @gorillapool/js-junglebus
bash
npm install @gorillapool/js-junglebus

Basic Usage

基础用法

typescript
import { JungleBusClient, ControlMessageStatusCode } from '@gorillapool/js-junglebus';

const client = new JungleBusClient("junglebus.gorillapool.io", {
  useSSL: true,
  onConnected(ctx) { 
    console.log("Connected", ctx); 
  },
  onConnecting(ctx) { 
    console.log("Connecting", ctx); 
  },
  onDisconnected(ctx) { 
    console.log("Disconnected", ctx); 
  },
  onError(ctx) { 
    console.error("Error", ctx); 
  }
});

// Subscribe to a subscription ID
const subscriptionId = "your-subscription-id";
const fromBlock = 750000;

client.Subscribe(
  subscriptionId,
  fromBlock,
  (tx) => {
    // Confirmed transaction received
    console.log("TX:", tx.id, "at height", tx.block_height);
    console.log("Output types:", tx.output_types);
    console.log("Contexts:", tx.contexts);
  },
  (status) => {
    // Status updates
    if (status.statusCode === ControlMessageStatusCode.BLOCK_DONE) {
      console.log("Block done:", status.block);
    } else if (status.statusCode === ControlMessageStatusCode.WAITING) {
      console.log("Waiting for new block...");
    } else if (status.statusCode === ControlMessageStatusCode.REORG) {
      console.log("Reorg triggered:", status);
    }
  },
  (error) => {
    // Subscription errors
    console.error("Subscription error:", error);
  },
  (mempoolTx) => {
    // Unconfirmed mempool transaction
    console.log("Mempool TX:", mempoolTx.id);
  }
);
typescript
import { JungleBusClient, ControlMessageStatusCode } from '@gorillapool/js-junglebus';

const client = new JungleBusClient("junglebus.gorillapool.io", {
  useSSL: true,
  onConnected(ctx) { 
    console.log("Connected", ctx); 
  },
  onConnecting(ctx) { 
    console.log("Connecting", ctx); 
  },
  onDisconnected(ctx) { 
    console.log("Disconnected", ctx); 
  },
  onError(ctx) { 
    console.error("Error", ctx); 
  }
});

// Subscribe to a subscription ID
const subscriptionId = "your-subscription-id";
const fromBlock = 750000;

client.Subscribe(
  subscriptionId,
  fromBlock,
  (tx) => {
    // Confirmed transaction received
    console.log("TX:", tx.id, "at height", tx.block_height);
    console.log("Output types:", tx.output_types);
    console.log("Contexts:", tx.contexts);
  },
  (status) => {
    // Status updates
    if (status.statusCode === ControlMessageStatusCode.BLOCK_DONE) {
      console.log("Block done:", status.block);
    } else if (status.statusCode === ControlMessageStatusCode.WAITING) {
      console.log("Waiting for new block...");
    } else if (status.statusCode === ControlMessageStatusCode.REORG) {
      console.log("Reorg triggered:", status);
    }
  },
  (error) => {
    // Subscription errors
    console.error("Subscription error:", error);
  },
  (mempoolTx) => {
    // Unconfirmed mempool transaction
    console.log("Mempool TX:", mempoolTx.id);
  }
);

Lite Mode (Lower Bandwidth)

轻量模式(低带宽)

typescript
// Last parameter = true for lite mode
client.Subscribe(
  subscriptionId, 
  fromBlock, 
  onTx, 
  onStatus, 
  onError, 
  onMempool, 
  true // Lite mode - only txid and block height
);
typescript
// Last parameter = true for lite mode
client.Subscribe(
  subscriptionId, 
  fromBlock, 
  onTx, 
  onStatus, 
  onError, 
  onMempool, 
  true // Lite mode - only txid and block height
);

Transaction Data Format

交易数据格式

Full Transaction Object

完整交易对象

json
{
  "id": "e597af34eb78b599b7d458110a3cc602a40dedd020db684992b40926217612a4",
  "block_hash": "000000000000000006296f1e5437dd6c01b9b5471691a89a9c7d8e9f06920da5",
  "block_height": 750000,
  "block_time": 1658878267,
  "block_index": 3,
  "transaction": "0100000002...",
  "merkle_proof": "AAOkEnYhJgm0kklo2yDQ7Q2kAsY8ChFY1LeZtXjrNK+X...",
  "addresses": [
    "18FJd9tDLAC2S6PCzfnqNfUMXhZuPfsFUm",
    "1P7UWRLdL5pH2Si1GauwASYAA1LQHs2z45"
  ],
  "inputs": [],
  "outputs": [
    "76a9144f7d6a485e09770f947c0ba38d15050a5a80b6fa88ac",
    "76a914f28c3992dd6a43eccaed16f3f7fb6ac8da1bc3c288ac"
  ],
  "input_types": [],
  "output_types": ["nulldata", "pubkeyhash", "run"],
  "contexts": [
    "555aad1953bcfef8c7779d246fa03efae0412ed700b955435831814f5be3a82b_o1",
    "c2c4c971e85b499c29a8ab2148fd324fe12b550b8f4f57658a4686e011d8fd58_o1"
  ],
  "sub_contexts": [
    "2e729d39a9cd300f5100044a54204e6d8b43fe49555309361fdc3d8565323499"
  ],
  "data": []
}
json
{
  "id": "e597af34eb78b599b7d458110a3cc602a40dedd020db684992b40926217612a4",
  "block_hash": "000000000000000006296f1e5437dd6c01b9b5471691a89a9c7d8e9f06920da5",
  "block_height": 750000,
  "block_time": 1658878267,
  "block_index": 3,
  "transaction": "0100000002...",
  "merkle_proof": "AAOkEnYhJgm0kklo2yDQ7Q2kAsY8ChFY1LeZtXjrNK+X...",
  "addresses": [
    "18FJd9tDLAC2S6PCzfnqNfUMXhZuPfsFUm",
    "1P7UWRLdL5pH2Si1GauwASYAA1LQHs2z45"
  ],
  "inputs": [],
  "outputs": [
    "76a9144f7d6a485e09770f947c0ba38d15050a5a80b6fa88ac",
    "76a914f28c3992dd6a43eccaed16f3f7fb6ac8da1bc3c288ac"
  ],
  "input_types": [],
  "output_types": ["nulldata", "pubkeyhash", "run"],
  "contexts": [
    "555aad1953bcfef8c7779d246fa03efae0412ed700b955435831814f5be3a82b_o1",
    "c2c4c971e85b499c29a8ab2148fd324fe12b550b8f4f57658a4686e011d8fd58_o1"
  ],
  "sub_contexts": [
    "2e729d39a9cd300f5100044a54204e6d8b43fe49555309361fdc3d8565323499"
  ],
  "data": []
}

Field Descriptions

字段说明

FieldTypeDescription
id
stringTransaction ID (txid)
block_hash
stringBlock hash where transaction was mined
block_height
numberBlock height
block_time
numberUnix timestamp
block_index
numberPosition of transaction in block
transaction
stringFull transaction in hex
merkle_proof
stringTSC-compatible binary merkle proof
addresses
string[]All addresses found in transaction
outputs
string[]Output scripts (capped to 1024 chars)
output_types
string[]Classifications (aip, bap, map, ord, etc.)
contexts
string[]Main data from OP_RETURN outputs
sub_contexts
string[]Secondary data from outputs
data
string[]Other key=value attributes
字段类型说明
id
string交易ID(txid)
block_hash
string交易所在区块的哈希
block_height
number区块高度
block_time
numberUnix时间戳
block_index
number交易在区块中的位置
transaction
string完整的十六进制交易数据
merkle_proof
string兼容TSC的二进制默克尔证明
addresses
string[]交易中包含的所有地址
outputs
string[]输出脚本(限制为1024字符)
output_types
string[]分类(aip、bap、map、ord等)
contexts
string[]OP_RETURN输出中的主要数据
sub_contexts
string[]输出中的次要数据
data
string[]其他键值对属性

Supported Protocols

支持的协议

JungleBus automatically recognizes and indexes these protocols:
ProtocolOutput TypeContextDescription
1Sat Outputs
1sat
none1 satoshi outputs
1Sat Ordinals
ord
content-typeInscriptions with content type
AIP
aip
protocol dataBitcoin Attestation Protocol
B Protocol
b
protocol dataB:// file storage
BAP
bap
1BAPSuaPnfGnSBM3GLV9yhxUdYe4vGbdMT
BAP identity
Bitcom
bitcom
protocol dataBitcom protocol
Boost
boost
protocol dataBoost POW
MAP
map
1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5
MAP protocol
Run
run
protocol dataRun tokens
STAS
token_stas
protocol dataSTAS tokens
JungleBus会自动识别并为以下协议建立索引:
协议输出类型上下文说明
1Sat Outputs
1sat
1聪输出
1Sat Ordinals
ord
内容类型带内容类型的铭文
AIP
aip
协议数据比特币证明协议
B Protocol
b
协议数据B://文件存储
BAP
bap
1BAPSuaPnfGnSBM3GLV9yhxUdYe4vGbdMT
BAP身份
Bitcom
bitcom
协议数据Bitcom协议
Boost
boost
协议数据Boost工作量证明
MAP
map
1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5
MAP协议
Run
run
协议数据Run代币
STAS
token_stas
协议数据STAS代币

REST API Endpoints

REST API 端点

Get Transaction

获取交易

bash
curl https://junglebus.gorillapool.io/v1/transaction/get/{txid}
Returns full transaction with parsed data.
bash
curl https://junglebus.gorillapool.io/v1/transaction/get/{txid}
返回包含解析后数据的完整交易。

Get Address History

获取地址历史

bash
curl https://junglebus.gorillapool.io/v1/address/get/{address}
Returns:
json
[
  {
    "id": "8859250950ecbb7025731c1206e277e344a6db5f285274b7a1d2817980ab8e64",
    "address": "13qRymPwRxAr7oRdAoFdo5Wp8815sstHE5",
    "transaction_id": "eb197a43a7c4ed230a7125d7e7bf5990cd60be8ff0f59b8fffdfd91d52dfce82",
    "block_hash": "0000000000000000002be95240df5e4215e6878259dce8b9df08650641fdd40a",
    "block_index": 50545
  }
]
bash
curl https://junglebus.gorillapool.io/v1/address/get/{address}
返回:
json
[
  {
    "id": "8859250950ecbb7025731c1206e277e344a6db5f285274b7a1d2817980ab8e64",
    "address": "13qRymPwRxAr7oRdAoFdo5Wp8815sstHE5",
    "transaction_id": "eb197a43a7c4ed230a7125d7e7bf5990cd60be8ff0f59b8fffdfd91d52dfce82",
    "block_hash": "0000000000000000002be95240df5e4215e6878259dce8b9df08650641fdd40a",
    "block_index": 50545
  }
]

Get Block Header

获取区块头

bash
curl https://junglebus.gorillapool.io/v1/block_header/get/{block_hash}
Returns:
json
{
  "hash": "000000000000000006296f1e5437dd6c01b9b5471691a89a9c7d8e9f06920da5",
  "coin": 1,
  "height": 750000,
  "time": 1658878267,
  "nonce": 4188280238,
  "version": 671080448,
  "merkleroot": "e88b40ac9367eb11dd918416b668e67f09bf24550eac93de7f2d68a0ca0c6eae",
  "bits": "180f4e90",
  "synced": 8971
}
bash
curl https://junglebus.gorillapool.io/v1/block_header/get/{block_hash}
返回:
json
{
  "hash": "000000000000000006296f1e5437dd6c01b9b5471691a89a9c7d8e9f06920da5",
  "coin": 1,
  "height": 750000,
  "time": 1658878267,
  "nonce": 4188280238,
  "version": 671080448,
  "merkleroot": "e88b40ac9367eb11dd918416b668e67f09bf24550eac93de7f2d68a0ca0c6eae",
  "bits": "180f4e90",
  "synced": 8971
}

Control Message Status Codes

控制消息状态码

typescript
import { ControlMessageStatusCode } from '@gorillapool/js-junglebus';

// Available codes:
ControlMessageStatusCode.BLOCK_DONE    // Block processing complete
ControlMessageStatusCode.WAITING       // Waiting for new block
ControlMessageStatusCode.REORG         // Blockchain reorganization
ControlMessageStatusCode.ERROR         // Error occurred
typescript
import { ControlMessageStatusCode } from '@gorillapool/js-junglebus';

// Available codes:
ControlMessageStatusCode.BLOCK_DONE    // Block processing complete
ControlMessageStatusCode.WAITING       // Waiting for new block
ControlMessageStatusCode.REORG         // Blockchain reorganization
ControlMessageStatusCode.ERROR         // Error occurred

Go Client

Go客户端

bash
go get github.com/GorillaPool/go-junglebus
go
package main

import (
    "github.com/GorillaPool/go-junglebus"
)

func main() {
    client, _ := junglebus.New(
        junglebus.WithHTTP("https://junglebus.gorillapool.io"),
    )

    client.Subscribe("subscription-id", 750000, func(tx *junglebus.Transaction) {
        fmt.Printf("TX: %s at height %d\n", tx.Id, tx.BlockHeight)
        fmt.Printf("Types: %v\n", tx.OutputTypes)
    })
}
bash
go get github.com/GorillaPool/go-junglebus
go
package main

import (
    "github.com/GorillaPool/go-junglebus"
)

func main() {
    client, _ := junglebus.New(
        junglebus.WithHTTP("https://junglebus.gorillapool.io"),
    )

    client.Subscribe("subscription-id", 750000, func(tx *junglebus.Transaction) {
        fmt.Printf("TX: %s at height %d\n", tx.Id, tx.BlockHeight)
        fmt.Printf("Types: %v\n", tx.OutputTypes)
    })
}

JungleBus vs WhatsOnChain

JungleBus 与 WhatsOnChain 对比

FeatureJungleBusWhatsOnChain
Real-time streaming✅ Yes❌ No
Transaction history✅ Yes✅ Yes
Address balance❌ No✅ Yes
UTXOs❌ No✅ Yes
Price data❌ No✅ Yes
Parsed tx data✅ Yes⚠️ Limited
Protocol indexing✅ Yes❌ No
Use JungleBus for: Streaming, protocol monitoring, real-time indexing Use WhatsOnChain for: Balances, UTXOs, price data
功能JungleBusWhatsOnChain
实时数据流✅ 是❌ 否
交易历史✅ 是✅ 是
地址余额❌ 否✅ 是
UTXO❌ 否✅ 是
价格数据❌ 否✅ 是
解析后的交易数据✅ 是⚠️ 有限
协议索引✅ 是❌ 否
使用JungleBus的场景:数据流、协议监控、实时索引 使用WhatsOnChain的场景:余额、UTXO、价格数据

Dashboard Workflow

控制台工作流

junglebus.gorillapool.io
Dashboard → Subscriptions → Create New
Configure filters:
  - Addresses (optional)
  - Input types (optional)
  - Output types (required for protocol filtering)
  - Contexts (required for specific protocols)
  - Sub contexts (optional)
  - Data keys (optional)
Save subscription
Copy subscription ID
Use in your code
junglebus.gorillapool.io
控制台 → 订阅 → 新建订阅
配置过滤器:
  - 地址(可选)
  - 输入类型(可选)
  - 输出类型(协议过滤必填)
  - 上下文(特定协议必填)
  - 子上下文(可选)
  - 数据键(可选)
保存订阅
复制订阅ID
在代码中使用

Links

链接