diff --git a/ethereum/ethereum-genesis.json b/ethereum/ethereum-genesis.json index 261f90455f..f6b8c16e4e 100644 --- a/ethereum/ethereum-genesis.json +++ b/ethereum/ethereum-genesis.json @@ -1,13 +1,12 @@ { "config": { - "chainId": 0, + "chainId": 1, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "alloc": { - "0x0000000000000000000000000000000000000001": { "balance": "111111111" }, - "0x0000000000000000000000000000000000000002": { "balance": "222222222" } + "0x@account@": { "balance": "1000000" } }, "coinbase": "0x0000000000000000000000000000000000000000", "difficulty": "0x20000", diff --git a/ethereum/ethereum.patch b/ethereum/ethereum.patch index 202d46d848..3122a2fe5b 100644 --- a/ethereum/ethereum.patch +++ b/ethereum/ethereum.patch @@ -1,6 +1,6 @@ Index: build/ci.go --- build/ci.go.orig 2017-11-21 10:54:19.000000000 +0100 -+++ build/ci.go 2017-12-16 21:11:00.381343000 +0100 ++++ build/ci.go 2017-12-17 10:42:50.358030000 +0100 @@ -194,6 +194,7 @@ if *arch == "" || *arch == runtime.GOARCH { @@ -25,3 +25,22 @@ Index: build/ci.go gobuild.Args = append(gobuild.Args, "-v") gobuild.Args = append(gobuild.Args, []string{"-o", executablePath(cmd.Name())}...) gobuild.Args = append(gobuild.Args, "."+string(filepath.Separator)+filepath.Join("cmd", cmd.Name())) +Index: node/config.go +--- node/config.go.orig 2017-11-21 10:54:19.000000000 +0100 ++++ node/config.go 2017-12-17 10:46:32.962354000 +0100 +@@ -410,13 +410,13 @@ + if !conf.NoUSB { + // Start a USB hub for Ledger hardware wallets + if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil { +- log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err)) ++ log.Debug(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err)) + } else { + backends = append(backends, ledgerhub) + } + // Start a USB hub for Trezor hardware wallets + if trezorhub, err := usbwallet.NewTrezorHub(); err != nil { +- log.Warn(fmt.Sprintf("Failed to start Trezor hub, disabling: %v", err)) ++ log.Debug(fmt.Sprintf("Failed to start Trezor hub, disabling: %v", err)) + } else { + backends = append(backends, trezorhub) + } diff --git a/ethereum/ethereum.spec b/ethereum/ethereum.spec index 41525c2da8..b23064360b 100644 --- a/ethereum/ethereum.spec +++ b/ethereum/ethereum.spec @@ -47,7 +47,7 @@ Patch0: ethereum.patch # build information BuildPreReq: OpenPKG, openpkg >= 20160101, go -PreReq: OpenPKG, openpkg >= 20160101 +PreReq: OpenPKG, openpkg >= 20160101, apg %if "%{with_private}" == "yes" && "%{with_bootnode}" == "yes" PreReq: ethereum-bootnode %endif @@ -138,26 +138,28 @@ PreReq: ethereum-bootnode $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-geth.conf %if "%{with_private}" == "yes" - # generate genesis block - echo "Generating Private Ethereum Blockchain Genesis Block" | \ + # generate local account + echo "Generating Private Ethereum Blockchain Local Account" | \ %{l_rpmtool} msg -b -t notice su - %{l_rusr} -c \ + "umask 0077; $RPM_INSTALL_PREFIX/bin/apg -n1 -a1 -m32 -x32 -M NCL \ + >$RPM_INSTALL_PREFIX/etc/ethereum/ethereum-account.passwd" + account=`su - %{l_rusr} -c \ "$RPM_INSTALL_PREFIX/bin/ethereum-geth \ --config $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-geth.conf \ - init $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-genesis.json \ - >>$RPM_INSTALL_PREFIX/var/ethereum/log/ethereum-geth.log 2>&1" + account new \ + --password $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-account.passwd" 2>&1 | \ + egrep "^Address:" | sed -e 's;^Address: {\(.*\)}.*;\1;'` - # generate local account - echo "Generating Private Ethereum Blockchain Local Account" | \ + # generate genesis block + echo "Generating Private Ethereum Blockchain Genesis Block" | \ %{l_rpmtool} msg -b -t notice - su - %{l_rusr} -c \ - "$RPM_INSTALL_PREFIX/bin/apg -n1 -a1 -m32 -x32 -M NCL \ - >$RPM_INSTALL_PREFIX/etc/ethereum/ethereum-account.passwd" + %{l_shtool} subst -e "s;@account@;$account;" \ + $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-genesis.json su - %{l_rusr} -c \ "$RPM_INSTALL_PREFIX/bin/ethereum-geth \ --config $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-geth.conf \ - account new \ - --password $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-account.passwd \ + init $RPM_INSTALL_PREFIX/etc/ethereum/ethereum-genesis.json \ >>$RPM_INSTALL_PREFIX/var/ethereum/log/ethereum-geth.log 2>&1" %endif elif [ $1 -eq 2 ]; then