Tool to create list of Transactions for Linux Farmer

Hi. I made couple bash scripts to create a list of Chia transactions and write to a CSV file if anyone is interested.

More details here:
https://github.com/steppsr/taxtran

1 Like

New version. Also renamed. GitHub - steppsr/getxchtx: Generate a list of transactions for Chia (XCH) into a CSV file.

1 Like

I tried this, but it has the wrong value for at least one transaction. I know I sent 2XCH, but this is saying it’s 1.75

There should be a file called alltxs.json that is a straight extract from your wallet db. Can you find the transaction in that wallet, and did it have any removals? I had one other user ask a similar question and I’m reviewing the alltxs.json file and his CSV to see if there is an issue.

In theory this is what the script is doing at the moment, and maybe I’m wrong on this… pull all transactions from the wallet db, loop through each transaction. If the transaction type is Outgoing TX then total up any removals and use that as the amount of the transactions. I do this because I am thinking that each of those coins are ‘spent’ and you will receive another coin with the difference. And any other Transaction Type is just uses the amount.

So if I am sending 0.5 XCH to somewhere but I only had 1 coin that was 1.75 XCH. Then I would ‘spend’ the 1.75 XCH, and create 2 coins out of it, one for the 0.5 I am sending, and one for 1.25 that will come back to me (in another transaction).

Again, I am investigating some real data samples now to see if I have this logic wrong.

1 Like

My node is running on Win 11, and I am trying to use your script from a linux box on the same local network. I cannot connect to port 9256, though. I have tried to run “telnet localhost 9256” on that Win box, but it looks like that port is not open even on a loopback adapter.

Do I need to do anything special to get that port open? Is it open by default on Linux?

On Linux the wallet listens locally on 127.0.0.1:9256 so this utility can only be run on the wallet host. I don’t have a Windows box to confirm on, but presume it also listens locally.

2 Likes

Hi Jacek,

So the script needs to run from the Farmer. There is a Powershell version too, so if you’re on Windows you can use that one instead of the Bash script.

XCH Transaction Exporter [PowerShell Edition] - GitHub - steppsr/getxchtxPS: XCH Transaction Exporter : getxchtxPS [Powershell Edition]

Steve

2 Likes

I couldn’t do the local telnet as well. Either I missed something, or after I run chia wallet show the port got opened. However, as @chiameh mentioned bound to localhost. So, no go from the remote box.

@steppsr I didn’t know that PS will also run it! So, I don’t need to struggle with that linux box!

Thank you guys!!!

As a thought experiment though, it might actually be possible to do with some modifications to the script. It is using the RPC API to connect to localhosl (which when you run on the Linux box, is that box) but you could change localhost to the IP Address of your Windows 11 node. Then you would also need to have your wallet .crt and .key files on the Linux box and update the script to point to those files.

I’ve never tried to do it that way. And I’d recommend just using the Powershell, but it is interesting to think about.

1 Like

I can say that I absolutely LOVE bash over Powershell! lol

1 Like

Yeah, that was what I was trying to do. In that curl command, I modified the URL to point to my Win box, and copied certs to that box, but that is no go. I have tried to run openssl s_client from that linux box, but that also cannot access it.

Well, first thought was that Win firewall is blocking it, so I was trying to enable that, but was going nowhere. Then I installed telnet on that Win box, but that couldn’t bite that port as well.

I am not sure, but it looks to me that it only got open after that “chia wallet show” command.

So far, I was trying to avoid PS, but if it can run bash scripts, that is really nice. How would you install additional packages like jq, though?

I might try this tomorrow just as a experiment.

You threw me a little bit with the telnet comment… telnet isn’t a part of this. Curl is the command and it would do the API call to your windows box. No need to telnet at all.

Curious, did you update the script to point to your .crt and .key file on Linux?

telnet is not the best tool, but you can specify IP PORT (no colon between), and it will try to connect. If the port is closed, it will show it, if it is open (even SSL), it will linger there, unless it will get booted.

Although, for SSL, openssl s_client is a better tool, as it will show certs (@chiameh taught me that :slight_smile:

Yes, I copied those certs to the linux box, and modified curl accordingly.

1 Like

I know what Telnet is, but you don’t need to use it in this situation. Are you trying to remote TO the linux box with Telnet? Maybe I’m confused.

It is just faster to use for testing whether a given port is open, that’s it :slight_smile: Otherwise, as you stated, no use.

I still don’t understand. Are you using Telnet to connect to the Linux box from your Windows 11 machine?

Just used it to see whether the port was open, as curl got stuck and was giving no errors.

Also, on that Win box, I don’t have curl installed (unless PS has it).

Oh… so for debugging. I got ya. Yeah, I’d recommend using PuTTY. It can do SSH (or Telnet).

No, I had to do it a different way in Powershell… basically running the CLI commands and capturing their response. I didn’t want to require the user to install other software and to use the RPC API, I would have had to get the user to run OpenSSL and merge the CRT and KEY files into another combined file and give to Powershell. Just wasn’t worth it.

1 Like