aboutsummaryrefslogtreecommitdiff
path: root/examples/payments/main.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-08-12 13:04:52 -0400
committerDeterminant <[email protected]>2019-08-12 13:04:52 -0400
commitce505015e5f973c8f5d605aa468ad75fceeeb169 (patch)
treee1417b83881024c9dc4960dd304805327f64d615 /examples/payments/main.go
parent068cb794976da713fb4671e1bb4e4657d3dcc2b3 (diff)
...
Diffstat (limited to 'examples/payments/main.go')
-rw-r--r--examples/payments/main.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/payments/main.go b/examples/payments/main.go
index 9a0298d..24ba962 100644
--- a/examples/payments/main.go
+++ b/examples/payments/main.go
@@ -5,14 +5,29 @@ import (
"encoding/hex"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/core"
+ "github.com/Determinant/coreth/eth"
"github.com/Determinant/coreth"
"github.com/ethereum/go-ethereum/log"
+ "github.com/ethereum/go-ethereum/params"
"time"
)
func main() {
log.Root().SetHandler(log.StdoutHandler)
- chain := coreth.NewETHChain(nil, nil, nil)
+ config := eth.DefaultConfig
+ genAddr := common.Address{}
+ genBalance := big.NewInt(1000000000000000000)
+ config.Genesis = &core.Genesis{
+ Config: params.MainnetChainConfig,
+ Nonce: 66,
+ ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"),
+ GasLimit: 5000,
+ Difficulty: big.NewInt(0),
+ Alloc: core.GenesisAlloc{genAddr: {Balance: genBalance }},
+ }
+ chain := coreth.NewETHChain(&config, nil, nil)
to := common.Address{}
nouce := 0
amount := big.NewInt(0)