From ab0f772dbeefccb14910d6537a1473b38e577be6 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 4 Nov 2022 13:00:34 +0000 Subject: [PATCH] small amend to custom tracer page --- .../developers/dapp-developer/evm-tracing/custom-tracer.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/docs/developers/dapp-developer/evm-tracing/custom-tracer.md b/src/pages/docs/developers/dapp-developer/evm-tracing/custom-tracer.md index a025c87dcd..a6ca62d247 100644 --- a/src/pages/docs/developers/dapp-developer/evm-tracing/custom-tracer.md +++ b/src/pages/docs/developers/dapp-developer/evm-tracing/custom-tracer.md @@ -397,7 +397,7 @@ func (t *opcounter) Stop(err error) { } ``` -As can be seen every method of the [EVMLogger interface](https://pkg.go.dev/github.com/ethereum/go-ethereum/core/vm#EVMLogger) needs to be implemented (even if empty). Key parts to notice are the `init()` function which registers the tracer in Geth, the `CaptureState` hook where the opcode counts are incremented and `GetResult` where the result is serialized and delivered. To test this out the source is first compiled with `make geth`. Then in the console it can be invoked through the usual API methods by passing in the name it was registered under: +Every method of the [EVMLogger interface](https://pkg.go.dev/github.com/ethereum/go-ethereum/core/vm#EVMLogger) needs to be implemented (even if empty). Key parts to notice are the `init()` function which registers the tracer in Geth, the `CaptureState` hook where the opcode counts are incremented and `GetResult` where the result is serialized and delivered. To test this, the source is first compiled with `make geth`. Then in the console it can be invoked through the usual API methods by passing in the name it was registered under: ```console > debug.traceTransaction('0x7ae446a7897c056023a8104d254237a8d97783a92900a7b0f7db668a9432f384', { tracer: 'opcounter' }) @@ -408,3 +408,7 @@ As can be seen every method of the [EVMLogger interface](https://pkg.go.dev/gith ... } ``` + +## Summary + +This page described how to write custom tracers for Geth. Custom tracers can be written in Javascript or Go. \ No newline at end of file