Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'rusty-blockparser'",
"cargo": {
"args": [
"build",
"--bin=rusty-blockparser",
"--package=rusty-blockparser"
],
"filter": {
"name": "rusty-blockparser",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'rusty-blockparser'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=rusty-blockparser",
"--package=rusty-blockparser"
],
"filter": {
"name": "rusty-blockparser",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
4 changes: 3 additions & 1 deletion 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
Expand Up @@ -10,7 +10,7 @@ It allows extraction of various data types (blocks, transactions, scripts, publi

##### **Currently Supported Blockchains:**

`Bitcoin`, `Namecoin`, `Litecoin`, `Dogecoin`, `Myriadcoin`, `Unobtanium` and `NoteBlockchain`.
`Bitcoin`, `Namecoin`, `Litecoin`, `Dogecoin`, `Myriadcoin`, `Unobtanium`, `NoteBlockchain` and `UfoCoin`.

It assumes a local unpruned copy of the blockchain with intact block index, downloaded with [Bitcoin Core](https://github.com/bitcoin/bitcoin) 0.15.1+. If you are not sure whether your local copy is valid you can apply `--verify` to validate the chain and block merkle trees. If something doesn't match the parser exits.

Expand Down
22 changes: 22 additions & 0 deletions src/blockchain/parser/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Dogecoin;
pub struct Myriadcoin;
pub struct Unobtanium;
pub struct NoteBlockchain;
pub struct UfoCoin;
//pub struct Dash;

impl Coin for Bitcoin {
Expand All @@ -48,6 +49,26 @@ impl Coin for Bitcoin {
}
}

impl Coin for UfoCoin {
fn name(&self) -> String {
String::from("ufocoin")
}
fn magic(&self) -> u32 {
0xfcd9b7dd
}
fn version_id(&self) -> u8 {
0x1b
}
fn genesis(&self) -> [u8; 32] {
utils::hex_to_arr32_swapped(
"ba1d39b4928ab03d813d952daf65fb7797fcf538a9c1b8274f4edc8557722d13",
)
}
fn default_folder(&self) -> PathBuf {
Path::new(".ufo").join("blocks")
}
}

/// Bitcoin testnet3
impl Coin for TestNet3 {
fn name(&self) -> String {
Expand Down Expand Up @@ -231,6 +252,7 @@ impl FromStr for CoinType {
fn from_str(coin_name: &str) -> OpResult<Self> {
match coin_name {
"bitcoin" => Ok(CoinType::from(Bitcoin)),
"ufocoin" => Ok(CoinType::from(UfoCoin)),
"testnet3" => Ok(CoinType::from(TestNet3)),
"namecoin" => Ok(CoinType::from(Namecoin)),
"litecoin" => Ok(CoinType::from(Litecoin)),
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ fn parse_args() -> OpResult<RefCell<ParserOptions>> {
"dogecoin",
"myriadcoin",
"unobtanium",
"noteblockchain"
"noteblockchain",
"ufocoin"
];
let matches = App::new("Multithreaded Blockchain Parser written in Rust")
.version(crate_version!())
Expand Down