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
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
New version. Also renamed. GitHub - steppsr/getxchtx: Generate a list of transactions for Chia (XCH) into a CSV file.
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.
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.
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
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.
I can say that I absolutely LOVE bash over Powershell! lol
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
Yes, I copied those certs to the linux box, and modified curl accordingly.
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 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.