Skip to content

Commit

Permalink
Adding Bnb-Beacon
Browse files Browse the repository at this point in the history
  • Loading branch information
productshiv committed Apr 8, 2024
1 parent 52f460a commit 2e4d69f
Show file tree
Hide file tree
Showing 19 changed files with 1,047 additions and 0 deletions.
8 changes: 8 additions & 0 deletions v1.0/RPC Nodes/rpc-others/rpc-bnb-beacon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Bnb Beacon"
slug: "rpc-bnb-beacon"
excerpt: ""
hidden: false
createdAt: "Wed Mar 06 2024 10:35:18 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 13:27:55 GMT+0000 (Coordinated Universal Time)"
---
51 changes: 51 additions & 0 deletions v1.0/RPC Nodes/rpc-others/rpc-bnb-beacon/rpc-bnb-beacon-abcinfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "abcInfo"
slug: "rpc-bnb-beacon-abcinfo"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Using the 'abciInfo' method to get information about the ABCI (Application Blockchain Interface) application
const abciInfoData = await tatum.rpc.abciInfo();

console.log(abciInfoData);

// Destroying the Tatum SDK instance. This is necessary to stop any background jobs that the SDK may have started.
await tatum.destroy();
```

### Overview

The `abciInfo` method is utilized to retrieve information about the BNB Beacon Chain application.

### Return Object

The `abciInfo` method typically returns an object containing the details about the application. While the exact structure might vary, the return object may include the following fields:

- `version` (string): The version of the application.
- `lastBlockHeight` (string number): The height of the last block processed.
- `lastBlockAppHash` (string number): The hash of the last block processed.

(Note: The exact fields in the return object might vary based on the BNB Beacon Chain's implementation and version.)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "abciQuerry"
slug: "rpc-bnb-beacon-abciquerry"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
/// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Defining query parameters for the 'abciQuery' method
const queryParams = {
path: 'YOUR_PATH_HERE',
data: 'YOUR_DATA_HERE',
height: 'YOUR_HEIGHT_VALUE',
prove: YOUR_PROVE_BOOLEAN
};

// Using the 'abciQuery' method to query data from the ABCI application
const abciQueryData = await tatum.rpc.abciQuery(queryParams);

console.log(abciQueryData);

// Destroying the Tatum SDK instance. This is necessary to stop any background jobs that the SDK may have started.
await tatum.destroy();
```

### Overview

The `abciQuery` method is used to query the BNB Beacon Chain application directly via ABCI. This provides a direct interface to the application layer, enabling specific data retrieval from the chain.

### Parameters

- `path` (string, required): The query path which corresponds to the type of data or information you want to retrieve. This is a required parameter and should follow a format like `"/a/b/c"`.
- `data` (string, required): The data associated with the query. This is also a required parameter and is used to provide additional context or filters for the query.
- `height` (string number, optional): The height at which to perform the query. If set to 0, it queries the latest data. This is an optional parameter.
- `prove` (boolean, optional): If set to `true`, the response will include proofs of the transactions' inclusion in the block. This is also an optional parameter.

### Return Object

The `abciQuery` method returns an object with details about the queried data from the application layer. The exact structure and content depend on the query path and data, but the return object might typically include:

- `response` (object): The response data from the ABCI query. It may contain fields like `key`, `value`, `height`, and `index`.

(Note: The exact fields in the return object might vary based on the BNB Beacon Chain's implementation and version.)
62 changes: 62 additions & 0 deletions v1.0/RPC Nodes/rpc-others/rpc-bnb-beacon/rpc-bnb-beacon-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: "block"
slug: "rpc-bnb-beacon-block"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Defining the parameters for fetching a specific block from the blockchain
const blockParams = {
height: YOUR_HEIGHT_VALUE
};

// Fetching the block data using the 'block' method and the defined parameters
const blockData = await tatum.rpc.block(blockParams);

console.log(blockData);

// Destroying the Tatum SDK instance to stop any background jobs and free up resources
await tatum.destroy();

```

### Overview

The `block` method is utilized to fetch block details for a specific height from the BNB Beacon Chain. Without specific block `height`, method returns last known block.

### Parameters

- `height` (string number, optional): The height of the block to be fetched. This is a optional parameter.

### Return Object

The `block` method returns an object containing the details of the block at the specified height. While the exact structure might vary, the return object may include fields like:

- `header` (object): Information about the block header.
- `transactions` (array): List of transactions within the block.
- `blockHash` (string): Hash of the block.
- ... and other details depending on the BNB Beacon Chain's implementation and version.

(Note: The exact fields in the return object might vary based on the BNB Beacon Chain's implementation and version.)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "blockchain"
slug: "rpc-bnb-beacon-blockchain"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Defining the block height range parameters for the query (optional)
const blockchainParams = {
minHeight: 'YOUR_MIN_HEIGHT_VALUE', // Optional: e.g., "12345"
maxHeight: 'YOUR_MAX_HEIGHT_VALUE' // Optional: e.g., "67890"
};

// Fetching blockchain data within the specified block height range
const blockchainData = await tatum.rpc.blockchain(blockchainParams);
console.log(blockchainData);

// Destroy Tatum SDK - needed for stopping background jobs
await tatum.destroy();
```

### Overview

The `blockchain` method is utilized to fetch blockchain data from the BNB Beacon Chain. Users can optionally specify a block height range to filter the results.

### Parameters

- `minHeight` (string, optional): The minimum block height from which to fetch the data. If not provided, there is no lower limit.
- `maxHeight` (string, optional): The maximum block height up to which to fetch the data. If not provided, there is no upper limit.

### Return Object

The `blockchain` method returns an object that provides a snapshot of the blockchain data within the specified block height range. The exact structure of the return object can vary, but it generally includes information related to blocks, transactions, and possibly other blockchain-specific details.

(Note: The exact fields in the return object can differ based on the BNB Beacon Chain's implementation and version.)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "blockResults"
slug: "rpc-bnb-beacon-blockresults"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Defining the block height parameter for the query
const blockParams = {
height: YOUR_HEIGHT_VALUE
};

// Fetching and logging the block result data from the BNB Beacon Chain
const blockResultData = await tatum.rpc.blockResult(blockParams);
console.log(blockResultData);

// Cleaning up resources used by Tatum SDK
await tatum.destroy();
```

### Overview

The `blockResult` method is used to fetch the results of transactions in a specified block on the BNB Beacon Chain.

### Parameters

- `height`: (string number, optional) The height of the block you are interested in. If not specified, it will default to the latest block.

### Return Object

The method returns an object containing detailed information about the transactions in the specified block. The exact structure of the returned object can depend on the BNB Beacon Chain's implementation and version. Some of the fields you might see include:

- `block_meta` (object): Metadata about the block.
- `block` (object): Detailed information about the block itself.
- `results` (object): Results of transactions included in the block.
- `validator_updates` (array): Information about any validator updates.
- `consensus_param_updates` (object): Information about any updates to consensus parameters.

(Note: The exact fields in the return object can differ based on the BNB Beacon Chain's implementation and version.)
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: "broadcastTxAsync"
slug: "rpc-bnb-beacon-broadcasttxasync"
excerpt: "Bnb Beacon RPC"
hidden: false
metadata:
description: "Bnb Beacon RPC"
image: []
keywords: "bnb-beacon, rpc"
robots: "index"
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)"
updatedAt: "Sat Apr 06 2024 15:00:05 GMT+0000 (Coordinated Universal Time)"
---
[block:html]
{
"html": "<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"
}
[/block]


### How to use it

```typescript
// Importing Tatum SDK for Beacon Chain
import { TatumSDK, Network, Bnb } from '@tatumio/tatum';

// Initializing SDK for Beacon Chain network
const tatum = await TatumSDK.init<Bnb>({ network: Network.BNB });

// Defining the transaction to broadcast
const signedTx = 'SIGNED_TRANSACTION_STRING'; // Replace with your signed transaction string

// Broadcasting the transaction asynchronously
const txResponse = await tatum.rpc.broadcastTxAsync({ tx: signedTx });
console.log(txResponse);

// Destroy Tatum SDK - needed for stopping background jobs
await tatum.destroy();
```

### Overview

The `broadcastTxAsync` method is used to broadcast a signed transaction to the BNB Beacon Chain asynchronously.

### Parameters

- `tx` (string, required): The signed transaction string that you want to broadcast.

### Return Object

The method returns a promise that resolves to a JSON-RPC response containing information about the broadcasted transaction. The response includes the following fields:

- `code` (string): The status code of the transaction.
- Example: `0`

- `data` (string): Additional data related to the transaction.
- Example: `7B226F726465725F6964223A22383133453439333946313536374232313937303446464332414434444635384244453031303837392D3438227D`

- `hash` (string): The hash of the broadcasted transaction.
- Example: `008EA3C57B15E34B045F69DCEB2A5589B979B2B58BA282C15DF2AEA8B441AB6B`

- `log` (string): Transaction log information.
- Example: `Msg 0:`

(Note: The exact response structure may vary depending on the BNB Beacon Chain's implementation and version.)
Loading

0 comments on commit 2e4d69f

Please sign in to comment.