-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rebroadcast via infura public node
- Loading branch information
1 parent
914a99e
commit 6a2184a
Showing
2 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package geth | ||
|
||
import ( | ||
"fmt" | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/rpc" | ||
) | ||
|
||
func SendRawTransaction(data []byte) error { | ||
client, err := rpc.DialHTTP("https://mainnet.infura.io/0BRKxQ0SFvAxGL72cbXi") | ||
// client, err := rpc.DialHTTP("https://ropsten.infura.io/0BRKxQ0SFvAxGL72cbXi") | ||
if err != nil { | ||
return err | ||
} | ||
return client.Call(nil, "eth_sendRawTransaction", | ||
fmt.Sprintf("0x%s", common.Bytes2Hex(data))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6a2184a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolve #13