Pages:
Author

Topic: [C#][Github] SharpPusher, broadcast BTC, BCC(BCH) transactions to the network (Read 1406 times)

legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Version 0.12.0 released
Added the P2P option which allows user to directly connect to bitcoin nodes and broadcast their transaction on both MainNet and TestNet.
This uses the new MinimalClient introduced in Bitcoin.Net 0.17.0.0 which is in beta and may contain bugs.
https://github.com/Coding-Enthusiast/SharpPusher/releases/tag/0.12.0.0
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Compiled binaries for version 0.11.0 was released and can be found here: https://github.com/Coding-Enthusiast/SharpPusher/releases/tag/0.11.0.0
They are available for Linux, OSX and windows all x64. If you need any other OS you'll have to compile the code yourself.
All of these releases are published as a self contained app which means you won't need to download anything extra including the .net framework since it is already included in the package. That also makes them portable too.

PS. There is a small change where a new checkbox is added to allow users to locally evaluate the transaction without broadcasting it. It will deserialize the transaction hex and evaluates all its scripts without executing them.
legendary
Activity: 3696
Merit: 2219
💲🏎️💨🚓
If you're making executables in the near future, can I just let you know about the "Portable Apps" platform?  Basically, you can carry all the programs you use on a thumb drive or external HD using a program with your own settings saved etc - which is idea when working between say a home PC / Work PC / or laptop etc.

They even provide tools to convert your program into a paf file extension file which can then be installed on your thumb drive/exHD.  (You can also just drop the program in a directory as long as it doesn't require other directories)
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Does it really make your project runnable on every operating system?
Yes. Unlike .net framework the .net is no longer windows specific and can be used for any operating system. The UI is also designed that way to render everything based on the platform that is used.

Does it require .NET 5 or it has it already installed? I've noticed an annoying bug on .NET 5's installation. For example, I had to install .NET 5 on another machine (because it required it) and once I did, it showed me the same message again ("You need to install .NET 5 to run this"). This sours some people and they'll give up the software before they even try it.
There are two ways we can publish a .net application framework-dependent and self-contained, the former requires installing .net and the later doesn't but it is slightly bigger.
I have been releasing my other project (FinderOuter) as a self-contained executable for 64-bit Linux OS. It doesn't need any additional download or install, you just get the binaries and run them. The screenshot is from it running on Ubuntu 20.04.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I submitted my pull request. I imported the project once you updated it to AvaloniaUI and redid the changes. I set the program's height = 650, because of the many radio buttons. You can add a scrolling button to avoid that height if you want. Here's a screenshot:

(Updated the README.md too)


As for avalonia, I have some questions to make:
  • Does it really make your project runnable on every operating system?
  • Does it require .NET 5 or it has it already installed? I've noticed an annoying bug on .NET 5's installation. For example, I had to install .NET 5 on another machine (because it required it) and once I did, it showed me the same message again ("You need to install .NET 5 to run this"). This sours some people and they'll give up the software before they even try it.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
I haven't ever done this. Shouldn't this button be enabled?
You are comparing master with master on the same repository, so there is nothing to create a PR with. You have to change the branch. There is a button on top saying "compare across forks".
An easier way is to just fork the project and push changes to your own repository then inside that repository you will see a PR button that you can use.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I think that it'll work on all available cryptocurrencies of Blockchair. Specifically, I have added:

  • Bitcoin's testnet
  • Dogecoin
  • Litecoin
  • Monero
  • Cardano
  • Bitcoin SV
  • EOS
  • Ethereum
  • Ethereum's testnet
  • Mixin
  • Stellar
  • Ripple
  • Tezos
  • Dash
  • Groestlcoin
  • Bitcoin ABC

To do that I replaced the 35th line of Blockchair.cs with a bunch of else ifs. I can confirm that broadcasting transactions on the bitcoin testnet works properly:


Feel free to open a new pull request so I can check and merge the changes.
I haven't ever done this. Shouldn't this button be enabled?


legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
So it probably works. These are the lines that I changed from MainWindowViewModel.cs:
Feel free to open a new pull request so I can check and merge the changes.

What type of windows application is SharpPusher? It is definitely not WinForms. It seems an old project and since it's not built in .NET 5, I doubt that it uses the AvaloniaUI you tend to build your C# apps.
It is Windows Presentation Framework (or WPF) and yes it is a very old project that only runs on Windows.
Due to lack of interest in the project I never spent more time on it but I could migrate it to .net 5 and use AvaloniaUI (so that it would run on any OS) if there is any interest.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
It seems easier than I thought, except if it doesn't work the way I did it. I haven't tested it, since I don't have any dogecoins, litecoins or xmr, but I guess that it should work. Once I click "Broadcast" with Dogecoin selected and with a bitcoin raw transaction pasted I get:


So it probably works. These are the lines that I changed from MainWindowViewModel.cs:

Code:
public enum Networks
        {
            Bitcoin,
            BitcoinCash,
            Dogecoin,
            Litecoin,
            Monero
        }

Code:
private void SetApiList()
        {
            switch (SelectedNetwork)
            {
                case Networks.Bitcoin:
                    ApiList = new ObservableCollection()
                    {
                        new Blockchair(Blockchair.Chain.BTC),
                        new Smartbit(),
                        new BlockCypher(),
                    };
                    break;
                case Networks.BitcoinCash:
                    ApiList = new ObservableCollection()
                    {
                        new Blockchair(Blockchair.Chain.BCH),
                    };
                    break;
                case Networks.Dogecoin:
                    ApiList = new ObservableCollection()
                    {
                        new Blockchair(Blockchair.Chain.DOGE),
                    };
                    break;
                case Networks.Litecoin:
                    ApiList = new ObservableCollection()
                    {
                        new Blockchair(Blockchair.Chain.LTC),
                    };
                    break;
                case Networks.Monero:
                    ApiList = new ObservableCollection()
                    {
                        new Blockchair(Blockchair.Chain.XMR),
                    };
                    break;
            }
        }


What is now needed is selecting an IP to broadcast, which means, broadcasting it directly to a node. Unfortunately, I can't work on MinimalClient neither, since I don't know much about the way nodes communicate. Not that I don't like experimenting on others' code. Especially your well-structured and understandable code. I may take a look on Denovo.

What type of windows application is SharpPusher? It is definitely not WinForms. It seems an old project and since it's not built in .NET 5, I doubt that it uses the AvaloniaUI you tend to build your C# apps.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
I'd like to help this project by adding more options and different cryptocurrencies like litecoin, dogecoin but other networks too such as the testnet, which doesn't exist at the moment if I'm not mistaken.
You can do all using blockchair and the new API class I just added. Add their names to the enum and set their names correctly based on the blockchair API docs.

As you've written in the "To Do List", it'd be much cooler to write/choose a node's IP address instead of using a third party API. Combined with your Bitcoin.net, it could work, right?
Yes and no.
The problem is that I still haven't had the chance to write a MinimalClient so you'll have to write a lot of code to make it work using the existing Node class.
Also this project is rather ancient so it is using .net framework 4.5 which is not compatible with .net standard 2.1 you'll also have to do some updates and move SharpPusher to .net 5.

Related: https://github.com/Autarkysoft/Denovo/issues/1

I imported your project on my Visual Studio 2019, but I don't see the user interface. I can build it and execute it successfully, but I'm not able to see it in the VS. Will I have to install any plug-ins/libraries? I'm just doing this for exercise, but it'll also be fun. (and helpful)
Double click the MainWindow.xaml file in your solution explorer, that's the UI.
The default startup project should also be SharpPusher project which means if you press f5 you should build and run and see the UI.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I'd like to help this project by adding more options and different cryptocurrencies like litecoin, dogecoin but other networks too such as the testnet, which doesn't exist at the moment if I'm not mistaken. As you've written in the "To Do List", it'd be much cooler to write/choose a node's IP address instead of using a third party API. Combined with your Bitcoin.net, it could work, right?

I imported your project on my Visual Studio 2019, but I don't see the user interface. I can build it and execute it successfully, but I'm not able to see it in the VS. Will I have to install any plug-ins/libraries? I'm just doing this for exercise, but it'll also be fun. (and helpful)
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Hello again, I'm just going through my lists on the [Guide] Broadcast Your RAW Transaction (Push TX) BTC & Alts coins thread and was just checking if your program is still active? 

The list above has a couple of broken links to site that are no longer available.
Thanks for the report.
Removed the broken APIs and added a new one (Blockchair) to be used for both bitcoin and BCH.
Here is version 0.11.0
https://github.com/Coding-Enthusiast/SharpPusher/commit/013a7934ad122f04fe6a47044f8f6eaccc499c76
legendary
Activity: 3696
Merit: 2219
💲🏎️💨🚓
Features

?

Hello again, I'm just going through my lists on the [Guide] Broadcast Your RAW Transaction (Push TX) BTC & Alts coins thread and was just checking if your program is still active? 

The list above has a couple of broken links to site that are no longer available.

Thanks.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
ShartPusher
LOL!

can be really helpful if you combine it with the transaction tool. The user will sign the transaction within the program and then he'll broadcast it to the network without any wallet.
I've been trying to absorb all my old projects into two new projects which I started in 2020 but it's been a lot slower than I anticipated, mostly because I keep working on other parts and keep postponing it.
There is an open issue about it on both projects: https://github.com/Coding-Enthusiast/SharpPusher/issues/3

How can this be done? Will you have a list of nodes saved on a drop down? Also, what are the steps of broadcasting a transaction to the bitcoin network? I never found out, but I now want to. Do you firstly create a handshake with a node, send information and then it repeats with the rest of the nodes?
I believe I told you about the "MinimalClient" in Bitcoin.Net. It will be used for doing stuff like this. It will connect to a random full node the same way any other full node finds and connects to other nodes (DNS seeds or the local database it creates for subsequent connections) then it will perform the handshake and sends the tx message. There is no need to do it with more than one node but it is possible.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
This ShartPusher can be really helpful if you combine it with the transaction tool. The user will sign the transaction within the program and then he'll broadcast it to the network without any wallet.

  • [ ] Add ability to push transactions to network directly through nodes not third parties.
How can this be done? Will you have a list of nodes saved on a drop down? Also, what are the steps of broadcasting a transaction to the bitcoin network? I never found out, but I now want to. Do you firstly create a handshake with a node, send information and then it repeats with the rest of the nodes?
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
This is looking very interesting. I suppose those files at Github have to be compiled? Is there a way to obtain the actual .exe?

Yes, this is just source code. You need to use a compiler to do the rest.
I can add binaries to the Releases part of the repository if there were enough interest. Although I prefer not to...
newbie
Activity: 14
Merit: 0
This is looking very interesting. I suppose those files at Github have to be compiled? Is there a way to obtain the actual .exe?
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
 [2017-08-06] version 0.10.0:
  • Added support for bitcoin cash. Added networks in GUI to switch between them.
  • Improved the Blockr.io error message response.
  • Temporarily removed blockchain.info because it does not work!
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Made some code improvements.
Special thanks to https://github.com/dbremner
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
push {tx} -1 (where 1-n will be a list of services)

If you mean something like a loop to push to multiple services one after another, then it is pointless because if you successfully push your transaction to the network it propagates fast within seconds.
Which means by the time the app goes to the next service, it already has your transaction and will most probably rejects it because it exists in its mempool.
Pages:
Jump to: