mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-10 14:19:10 -07:00
mcp: readme
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use brk_core::{P2AAddressIndex, P2MSOutputIndex, Version};
|
use brk_core::{
|
||||||
|
OutputIndex, P2AAddressIndex, P2MSOutputIndex, P2PK33AddressIndex, P2PK65AddressIndex,
|
||||||
|
P2PKHAddressIndex, P2SHAddressIndex, P2TRAddressIndex, P2WPKHAddressIndex, P2WSHAddressIndex,
|
||||||
|
Version,
|
||||||
|
};
|
||||||
use brk_store::Store;
|
use brk_store::Store;
|
||||||
use fjall::TransactionalKeyspace;
|
use fjall::TransactionalKeyspace;
|
||||||
use jiff::Unit;
|
use jiff::Unit;
|
||||||
@@ -9,24 +13,50 @@ const _VERSION: Version = Version::ZERO;
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Stores {
|
pub struct Stores {
|
||||||
// pub p2aaddressindex_to_utxos_received: Store<P2AAddressIndex, Unit>,
|
pub p2aaddressindex_to_addressdata: Store<(P2AAddressIndex, OutputIndex), Unit>,
|
||||||
// pub p2aaddressindex_to_utxos_sent: Store<P2AAddressIndex, Unit>,
|
pub p2aaddressindex_to_emptyaddressdata: Store<(P2AAddressIndex, OutputIndex), Unit>,
|
||||||
// pub p2msoutputindex_to_utxos_received: Store<P2MSOutputIndex, Unit>,
|
pub p2aaddressindex_to_utxos_received: Store<(P2AAddressIndex, OutputIndex), Unit>,
|
||||||
// pub p2msoutputindex_to_utxos_sent: Store<P2MSOutputIndex, Unit>,
|
pub p2aaddressindex_to_utxos_sent: Store<P2AAddressIndex, Unit>,
|
||||||
// pub p2pk33addressindex_to_utxos_received: Store<P2PK33AddressIndex, Unit>,
|
|
||||||
// pub p2pk33addressindex_to_utxos_sent: Store<P2PK33AddressIndex, Unit>,
|
pub p2msoutputindex_to_addressdata: Store<P2MSOutputIndex, Unit>,
|
||||||
// pub p2pk65addressindex_to_utxos_received: Store<P2PK65AddressIndex, Unit>,
|
pub p2msoutputindex_to_emptyaddressdata: Store<P2MSOutputIndex, Unit>,
|
||||||
// pub p2pk65addressindex_to_utxos_sent: Store<P2PK65AddressIndex, Unit>,
|
pub p2msoutputindex_to_utxos_received: Store<P2MSOutputIndex, Unit>,
|
||||||
// pub p2pkhaddressindex_to_utxos_received: Store<P2PKHAddressIndex, Unit>,
|
pub p2msoutputindex_to_utxos_sent: Store<P2MSOutputIndex, Unit>,
|
||||||
// pub p2pkhaddressindex_to_utxos_sent: Store<P2PKHAddressIndex, Unit>,
|
|
||||||
// pub p2shaddressindex_to_utxos_received: Store<P2SHAddressIndex, Unit>,
|
pub p2pk33addressindex_to_addressdata: Store<P2PK33AddressIndex, Unit>,
|
||||||
// pub p2shaddressindex_to_utxos_sent: Store<P2SHAddressIndex, Unit>,
|
pub p2pk33addressindex_to_emptyaddressdata: Store<P2PK33AddressIndex, Unit>,
|
||||||
// pub p2traddressindex_to_utxos_received: Store<P2TRAddressIndex, Unit>,
|
pub p2pk33addressindex_to_utxos_received: Store<P2PK33AddressIndex, Unit>,
|
||||||
// pub p2traddressindex_to_utxos_sent: Store<P2TRAddressIndex, Unit>,
|
pub p2pk33addressindex_to_utxos_sent: Store<P2PK33AddressIndex, Unit>,
|
||||||
// pub p2wpkhaddressindex_to_utxos_received: Store<P2WPKHAddressIndex, Unit>,
|
|
||||||
// pub p2wpkhaddressindex_to_utxos_sent: Store<P2WPKHAddressIndex, Unit>,
|
pub p2pk65addressindex_to_addressdata: Store<P2PK65AddressIndex, Unit>,
|
||||||
// pub p2wshaddressindex_to_utxos_received: Store<P2WSHAddressIndex, Unit>,
|
pub p2pk65addressindex_to_emptyaddressdata: Store<P2PK65AddressIndex, Unit>,
|
||||||
// pub p2wshaddressindex_to_utxos_sent: Store<P2WSHAddressIndex, Unit>,
|
pub p2pk65addressindex_to_utxos_received: Store<P2PK65AddressIndex, Unit>,
|
||||||
|
pub p2pk65addressindex_to_utxos_sent: Store<P2PK65AddressIndex, Unit>,
|
||||||
|
|
||||||
|
pub p2pkhaddressindex_to_addressdata: Store<P2PKHAddressIndex, Unit>,
|
||||||
|
pub p2pkhaddressindex_to_emptyaddressdata: Store<P2PKHAddressIndex, Unit>,
|
||||||
|
pub p2pkhaddressindex_to_utxos_received: Store<P2PKHAddressIndex, Unit>,
|
||||||
|
pub p2pkhaddressindex_to_utxos_sent: Store<P2PKHAddressIndex, Unit>,
|
||||||
|
|
||||||
|
pub p2shaddressindex_to_addressdata: Store<P2SHAddressIndex, Unit>,
|
||||||
|
pub p2shaddressindex_to_emptyaddressdata: Store<P2SHAddressIndex, Unit>,
|
||||||
|
pub p2shaddressindex_to_utxos_received: Store<P2SHAddressIndex, Unit>,
|
||||||
|
pub p2shaddressindex_to_utxos_sent: Store<P2SHAddressIndex, Unit>,
|
||||||
|
|
||||||
|
pub p2traddressindex_to_addressdata: Store<P2TRAddressIndex, Unit>,
|
||||||
|
pub p2traddressindex_to_emptyaddressdata: Store<P2TRAddressIndex, Unit>,
|
||||||
|
pub p2traddressindex_to_utxos_received: Store<P2TRAddressIndex, Unit>,
|
||||||
|
pub p2traddressindex_to_utxos_sent: Store<P2TRAddressIndex, Unit>,
|
||||||
|
|
||||||
|
pub p2wpkhaddressindex_to_addressdata: Store<P2WPKHAddressIndex, Unit>,
|
||||||
|
pub p2wpkhaddressindex_to_emptyaddressdata: Store<P2WPKHAddressIndex, Unit>,
|
||||||
|
pub p2wpkhaddressindex_to_utxos_received: Store<P2WPKHAddressIndex, Unit>,
|
||||||
|
pub p2wpkhaddressindex_to_utxos_sent: Store<P2WPKHAddressIndex, Unit>,
|
||||||
|
|
||||||
|
pub p2wshaddressindex_to_addressdata: Store<P2WSHAddressIndex, Unit>,
|
||||||
|
pub p2wshaddressindex_to_emptyaddressdata: Store<P2WSHAddressIndex, Unit>,
|
||||||
|
pub p2wshaddressindex_to_utxos_received: Store<P2WSHAddressIndex, Unit>,
|
||||||
|
pub p2wshaddressindex_to_utxos_sent: Store<P2WSHAddressIndex, Unit>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Stores {
|
impl Stores {
|
||||||
@@ -44,9 +74,16 @@ impl Stores {
|
|||||||
// version + VERSION + Version::ZERO,
|
// version + VERSION + Version::ZERO,
|
||||||
// )?;
|
// )?;
|
||||||
|
|
||||||
Ok(Self {
|
todo!();
|
||||||
// address_to_utxos_received,
|
// Ok(Self {
|
||||||
// address_to_utxos_spent,
|
// p2aaddressindex_to_utxos_received: Store::import(
|
||||||
})
|
// keyspace,
|
||||||
|
// path,
|
||||||
|
// name,
|
||||||
|
// version,
|
||||||
|
// bloom_filter_bits,
|
||||||
|
// ), // address_to_utxos_received,
|
||||||
|
// // address_to_utxos_spent,
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
crates/brk_core/src/structs/addressdata.rs
Normal file
15
crates/brk_core/src/structs/addressdata.rs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
use crate::{Dollars, Sats};
|
||||||
|
|
||||||
|
#[derive(Debug, Default)]
|
||||||
|
pub struct AddressData {
|
||||||
|
pub sent: Sats,
|
||||||
|
pub received: Sats,
|
||||||
|
pub realized_cap: Dollars,
|
||||||
|
pub outputs_len: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AddressData {
|
||||||
|
pub fn amount(&self) -> Sats {
|
||||||
|
(u64::from(self.received) - u64::from(self.sent)).into()
|
||||||
|
}
|
||||||
|
}
|
||||||
8
crates/brk_core/src/structs/emptyaddressdata.rs
Normal file
8
crates/brk_core/src/structs/emptyaddressdata.rs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
use crate::Sats;
|
||||||
|
|
||||||
|
#[derive(Debug, Default)]
|
||||||
|
pub struct EmptyAddressData {
|
||||||
|
pub transfered: Sats,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EmptyAddressData {}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
mod addressbytes;
|
mod addressbytes;
|
||||||
mod addressbyteshash;
|
mod addressbyteshash;
|
||||||
|
mod addressdata;
|
||||||
mod bitcoin;
|
mod bitcoin;
|
||||||
mod blockhash;
|
mod blockhash;
|
||||||
mod blockhashprefix;
|
mod blockhashprefix;
|
||||||
@@ -9,6 +10,7 @@ mod dateindex;
|
|||||||
mod decadeindex;
|
mod decadeindex;
|
||||||
mod difficultyepoch;
|
mod difficultyepoch;
|
||||||
mod dollars;
|
mod dollars;
|
||||||
|
mod emptyaddressdata;
|
||||||
mod emptyoutputindex;
|
mod emptyoutputindex;
|
||||||
mod feerate;
|
mod feerate;
|
||||||
mod halvingepoch;
|
mod halvingepoch;
|
||||||
@@ -54,6 +56,7 @@ mod yearindex;
|
|||||||
|
|
||||||
pub use addressbytes::*;
|
pub use addressbytes::*;
|
||||||
pub use addressbyteshash::*;
|
pub use addressbyteshash::*;
|
||||||
|
pub use addressdata::*;
|
||||||
pub use bitcoin::*;
|
pub use bitcoin::*;
|
||||||
pub use blockhash::*;
|
pub use blockhash::*;
|
||||||
pub use blockhashprefix::*;
|
pub use blockhashprefix::*;
|
||||||
@@ -63,6 +66,7 @@ pub use dateindex::*;
|
|||||||
pub use decadeindex::*;
|
pub use decadeindex::*;
|
||||||
pub use difficultyepoch::*;
|
pub use difficultyepoch::*;
|
||||||
pub use dollars::*;
|
pub use dollars::*;
|
||||||
|
pub use emptyaddressdata::*;
|
||||||
pub use emptyoutputindex::*;
|
pub use emptyoutputindex::*;
|
||||||
pub use feerate::*;
|
pub use feerate::*;
|
||||||
pub use halvingepoch::*;
|
pub use halvingepoch::*;
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
A Model Context Protocol (MCP) which gives LLMs access to all available tools in BRK
|
A Model Context Protocol (MCP) which gives LLMs access to all available tools in BRK
|
||||||
|
|
||||||
|
## URLs
|
||||||
|
|
||||||
|
- https://eu1.bitcoinresearchkit.org/mcp
|
||||||
|
- https://eu2.bitcoinresearchkit.org/mcp
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To connect to the MCP you only need the correct URL ([https://bitcoinresearchkit.org/mcp](https://bitcoinresearchkit.org/mcp)) no token or auth is needed.
|
To connect to the MCP you only need the correct URL, no token or auth is needed.
|
||||||
|
|
||||||
This implementation has only been tested with Claude and the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector).
|
This implementation has only been tested with Claude and the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector).
|
||||||
|
|
||||||
Please be aware thtat the technology is very rapidly evolving, thus having issues if probably expected.
|
Please be aware that the technology is evolving very rapidly, thus having issues is probably expected. If you, you can join the discord see if there is a solution.
|
||||||
|
|
||||||
### Claude
|
### Claude
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user