go-eth-proxy

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs

commit 6900aaae1de2543730432f1330ac07b0d93f8805
Author: lash <dev@holbrook.no>
Date:   Wed, 26 Jun 2024 18:50:08 +0100

Initial commit

Diffstat:
Ago.mod | 31+++++++++++++++++++++++++++++++
Aproxy/service.go | 15+++++++++++++++
Aproxy/service_test.go | 30++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/go.mod b/go.mod @@ -0,0 +1,31 @@ +module defalsify.org/go-eth-proxy + +go 1.22.4 + +require github.com/ethereum/go-ethereum v1.14.5 + +require ( + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/holiman/uint256 v1.2.4 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/supranational/blst v0.3.11 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect +) diff --git a/proxy/service.go b/proxy/service.go @@ -0,0 +1,15 @@ +package proxy + +import ( + "context" + + "github.com/ethereum/go-ethereum/core/types" +) + +type ProxyService struct { +} + +func (p *ProxyService) GetTransaction(ctx context.Context, hsh string) (*types.Transaction, error) { + return nil, nil +} + diff --git a/proxy/service_test.go b/proxy/service_test.go @@ -0,0 +1,30 @@ +package proxy + +import ( + "testing" + + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/core/types" +) + +func TestProxyServerStart(t *testing.T) { + var err error + var tx types.Transaction + + srv := rpc.NewServer() + svc := ProxyService{} + err = srv.RegisterName("eth", &svc) + if err != nil { + t.Error(err) + } + client := rpc.DialInProc(srv) + mods, err := client.SupportedModules() + if err != nil { + t.Error(err) + } + t.Logf("mods %s", mods) + err = client.Call(&tx, "eth_getTransaction", "foo") + if err != nil { + t.Error(err) + } +}