Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
onrik authored Jun 27, 2023
1 parent 5bb32a7 commit c02e7c0
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,45 @@

Golang client for ethereum [JSON RPC API](https://github.com/ethereum/wiki/wiki/JSON-RPC).

Beer for author by Ethereum: 0xf4144308d6D67A1F00a61A596c0eB7B08411344a


#### Usage:
```go
package main

import (
"log"

"github.com/onrik/ethrpc"
)

func main() {
client := ethrpc.New("http://127.0.0.1:8545")

version, err := client.Web3ClientVersion()
if err != nil {
log.Println(err)
return
}
log.Println(version)

// Send 1 eth
txid, err := client.EthSendTransaction(ethrpc.T{
From: "0x6247cf0412c6462da2a51d05139e2a3c6c630f0a",
To: "0xcfa202c4268749fbb5136f2b68f7402984ed444b",
Value: ethrpc.Eth1(),
})
if err != nil {
log.Println(err)
return
}
log.Println(txid)
}
```

#### Methods:

- [x] web3_clientVersion
- [x] web3_sha3
- [x] net_version
Expand Down Expand Up @@ -70,39 +109,3 @@ Golang client for ethereum [JSON RPC API](https://github.com/ethereum/wiki/wiki/
- [ ] shh_uninstallFilter
- [ ] shh_getFilterChanges
- [ ] shh_getMessages

##### Usage:
```go
package main

import (
"log"

"github.com/onrik/ethrpc"
)

func main() {
client := ethrpc.New("http://127.0.0.1:8545")

version, err := client.Web3ClientVersion()
if err != nil {
log.Println(err)
return
}
log.Println(version)

// Send 1 eth
txid, err := client.EthSendTransaction(ethrpc.T{
From: "0x6247cf0412c6462da2a51d05139e2a3c6c630f0a",
To: "0xcfa202c4268749fbb5136f2b68f7402984ed444b",
Value: ethrpc.Eth1(),
})
if err != nil {
log.Println(err)
return
}
log.Println(txid)
}
```

Donate Ethereum: 0xf4144308d6D67A1F00a61A596c0eB7B08411344a

0 comments on commit c02e7c0

Please sign in to comment.