From 8ee98e7f0000611318b813ffde50f27e600ebbad Mon Sep 17 00:00:00 2001 From: realuncle Date: Tue, 28 Dec 2021 10:50:44 +0800 Subject: [PATCH] add testnet config --- example/example.go | 13 +++++++++++++ readme.md | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/example/example.go b/example/example.go index bd830ae..e731f61 100644 --- a/example/example.go +++ b/example/example.go @@ -21,8 +21,15 @@ import ( ) var rpcEndPoint = "https://bsc-dataseed.binance.org" + +// Testnet endpoint +//var rpcEndPoint = "https://data-seed-prebsc-1-s1.binance.org:8545" + var directRouteEndPoint = "https://api.nodereal.io/direct-route" +// Testnet endpoint +//var directRouteEndPoint = "https://testnet-api.nodereal.io/direct-route" + var account1, _ = utils.FromHexKey("input your private key1 here") var account2, _ = utils.FromHexKey("input your private key2 here") @@ -61,6 +68,9 @@ func sendBNBByBundleDemo() { n1, _ := rpcClient.PendingNonceAt(context.Background(), account1.Addr) chainId := big.NewInt(56) + + // testnet chain id + //chainId := big.NewInt(97) valueToTransfer := big.NewInt(100 * params.GWei) gasLimit := uint64(23000) @@ -120,6 +130,9 @@ func sendBUSDByBundleDemo() { n1, _ := rpcClient.PendingNonceAt(context.Background(), account1.Addr) chainId := big.NewInt(56) + + // testnet chain id + //chainId := big.NewInt(97) valueToTransfer := big.NewInt(0) gasLimit := uint64(70000) diff --git a/readme.md b/readme.md index 0f37fdb..2ab34f1 100644 --- a/readme.md +++ b/readme.md @@ -79,6 +79,11 @@ Note that only one tx sender is allowed with one bundle. bundle, _ := directClient.GetBundleByHash(context.Background(), bundleHash) ``` +### Direct-Route on Testnet + +You can try Direct-Route Testnet by changing the endpoint to: `https://testnet-api.nodereal.io/direct-route` + +Please note you should use the BSC testnet RPC and use testnet chainId(97) when sign the transaction. ### SDK Example