Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

feat: rpc client implementation #6

Merged
merged 10 commits into from
Jul 22, 2024
135 changes: 99 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fork Code Conventions !!IMPORTANT!!
# Fork Code Conventions !!IMPORTANT

The original repository of this fork is still in Alpha, so many breaking changes are expected. With that in mind, we've
developed a strategy to minimize synchronization conflicts as much as possible, employing the following heuristics:
Expand Down
5 changes: 4 additions & 1 deletion core/lib/via_btc_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jsonrpsee = { workspace = true, features = [
"client",
"macros",
] }
tokio.workspace = true
bitcoin = "0.32.2"
bitcoincore-rpc = "0.19.0"


[dev-dependencies]
bitcoincore-rpc = "0.16.0"
rand = "0.8"
tempfile = "3.3"
26 changes: 13 additions & 13 deletions core/lib/via_btc_client/dev.md → core/lib/via_btc_client/DEV.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
this library contains multiple modules that provide different functionalities for the sequencer/verifier node.
This library contains multiple modules that provide different functionalities for the sequencer/verifier node.

## Modules:
## Modules

1. **client**: provides communication tools with the Bitcoin network. (broadcast, get block, get transaction
confirmation, etc.)
Expand All @@ -10,7 +10,7 @@ this library contains multiple modules that provide different functionalities fo
4. **transaction_builder**: provides tools for creating unsigned transaction for withdrawal (UTXO selection).
5. **signer**: provides tools for signing transactions.

## responsibilities of shared files:
## Responsibilities of shared files

- **traits.rs**:
- contains traits.
Expand Down Expand Up @@ -41,31 +41,31 @@ this library contains multiple modules that provide different functionalities fo

## Usage

check [readme.md](./readme.md) for usage examples.
Check [README.md](./README.md) for usage examples.

## Testing

unit tests should be implemented for each module in their own file.
Unit tests should be implemented for each module in their own file.

for checking the integration and seeing the result of the whole system, we can use the `tests` directory. this directory
For checking the integration and seeing the result of the whole system, we can use the `tests` directory. This directory
is binary and we can import the library and use it in the main function to see the result of the functions.

for running the example, use the following command:
For running the example, use the following command:

`cargo run --bin via_btc_test`

## Development

before starting implementation of every module, we should define or modify the module's trait in the `traits.rs` file.
and also define or modify the types that are shared between modules in the `types.rs` file.
Before starting implementation of every module, we should define or modify the module's trait in the `traits.rs` file.
And also define or modify the types that are shared between modules in the `types.rs` file.

it's possible that these two file contain trait or type that they are not accurate or needed, don't hesitate to modify
It's possible that these two file contain trait or type that they are not accurate or needed, don't hesitate to modify
or remove them.

write unit tests for each module in their own file.
Write unit tests for each module in their own file.

write integration tests in the `examples` directory.
Write integration tests in the `examples` directory.

**Note:**

- only make methods public that are needed by external users.
- Only make methods public that are needed by external users.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Via Network Bitcoin Client Library

this library is responsible for the communication between the sequencer/verifier and the bitcoin network.
This library is responsible for the communication between the sequencer/verifier and the bitcoin network.

this library doesn't contain any logic for the sequencer/verifier, it only provides the communication tools with the
This library doesn't contain any logic for the sequencer/verifier, it only provides the communication tools with the
bitcoin network.

**features:**

- create different type of inscriptions transactions
- sign inscriptions transactions
- broadcast inscriptions transactions
- check for inscriptions transactions confirmation
- fetch and parse Bitcoin blocks
- filter Inscriptions transactions from Bitcoin blocks
- help verifier network participants to create unsigned transaction for withdrawal (UTXO selection)
- provide helper functions for syncing sequencer/verifier node with the Bitcoin network
- Create different type of inscriptions transactions
- Sign inscriptions transactions
- Broadcast inscriptions transactions
- Check for inscriptions transactions confirmation
- Fetch and parse Bitcoin blocks
- Filter Inscriptions transactions from Bitcoin blocks
- Help verifier network participants to create unsigned transaction for withdrawal (UTXO selection)
- Provide helper functions for syncing sequencer/verifier node with the Bitcoin network
(`indexer::get_inscription_messages`)

## Usage
Expand Down
Loading