Geth v1.8.0 supports new way of fetching transactions via IPC or WebSockets (debug_subscribe). There is an example in release notes which works almost perfectly:
$ nc -U /work/temp/rinkeby/geth.ipc
{"id": 1, "method": "debug_subscribe", "params": ["traceChain", "0x0", "0xfff", {"tracer": "callTracer"}]}
Response:
{"jsonrpc":"2.0","id":1,"result":"0xe1deecc4b399e5fd2b2a8abbbc4624e2"}
{"jsonrpc":"2.0","method":"debug_subscription","params": {"subscription":"0xe1deecc4b399e5fd2b2a8abbbc4624e2","result":{"block":"0x37","hash":"0xdb16f0d4465f2fd79f10ba539b169404a3e026db1be082e7fd6071b4c5f37db7","traces":[{"from":"0x31b98d14007bdee637298086988a0bbd31184523","gas":"0x0","gasUsed":"0x0","input":"0x","output":"0x","time":"1.077µs","to":"0x2ed530faddb7349c1efdbf4410db2de835a004e4","type":"CALL","value":"0xde0b6b3a7640000"}]}}}
{"jsonrpc":"2.0","method":"debug_subscription","params": {"subscription":"0xe1deecc4b399e5fd2b2a8abbbc4624e2","result":{"block":"0xf43","hash":"0xacb74aa08838896ad60319bce6e07c92edb2f5253080eb3883549ed8f57ea679","traces":[{"from":"0x31b98d14007bdee637298086988a0bbd31184523","gas":"0x0","gasUsed":"0x0","input":"0x","output":"0x","time":"1.568µs","to":"0xbedcf417ff2752d996d2ade98b97a6f0bef4beb9","type":"CALL","value":"0xde0b6b3a7640000"}]}}}
...
However even though block hashes are included, the transaction hashes are not.
I wanted to adapt the sources as the release notes suggest, but I don't know how I can use them... Do I need to recompile geth or is there a way I can install my tracer via JS interface?
"params": [..., {"tracer": "<javascript code goes here>"}]. From this https://github.com/ethereum/go-ethereum/blob/master/eth/tracers/tracer.go#L311-L313 it appears it is used as code if the name doesn't match one of the internal tracers. – Ismael Feb 19 '18 at 21:48debug_subscribeso it will benefit others (and myself when I catch up my TODO list). – Ismael Feb 20 '18 at 16:05