From 01fb1eeff1167daf1cce8654cade6047a34a8b1a Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Mon, 19 Nov 2018 14:55:53 +0900 Subject: [PATCH 1/3] Using solc docker image 0.4.24 for now as stable version is causing problems --- metadium/scripts/solc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadium/scripts/solc.sh b/metadium/scripts/solc.sh index 448c14ec274f..44cd7e0d5ed0 100755 --- a/metadium/scripts/solc.sh +++ b/metadium/scripts/solc.sh @@ -7,7 +7,8 @@ solc --version > /dev/null 2>&1 if [ $? = 0 ]; then SOLC=solc else - docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:stable" +# docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:stable" + docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:0.4.24" fi if [ "$SOLC" = "" ]; then From 071cc62a41fef8073a79a018eb43beff66b9c03c Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Wed, 28 Nov 2018 14:10:11 -0500 Subject: [PATCH 2/3] made rocksdb build multi-threaded --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 907255d1215d..62796c111883 100644 --- a/Makefile +++ b/Makefile @@ -211,7 +211,7 @@ rocksdb: $${GOPATH}/bin/govendor sync -v; \ fi @cd $(shell pwd)/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/facebook/rocksdb; \ - make static_lib; + make -j24 static_lib; endif AWK_CODE=' \ From 43602594729ecd16321c68b16fb56557b3db4a25 Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Wed, 28 Nov 2018 14:10:34 -0500 Subject: [PATCH 3/3] added SendValue utility function to metclient --- metadium/metclient/util.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/metadium/metclient/util.go b/metadium/metclient/util.go index 33e18d097ef9..c40cac6b9123 100644 --- a/metadium/metclient/util.go +++ b/metadium/metclient/util.go @@ -383,4 +383,33 @@ func SendContract(ctx context.Context, contract *RemoteContract, method string, return } +func SendValue(ctx context.Context, cli *ethclient.Client, from *keystore.Key, to common.Address, amount, gas, _gasPrice int) (hash common.Hash, err error) { + chainId, gasPrice, nonce, err := GetOpportunisticTxParams( + ctx, cli, from.Address, false, true) + if err != nil { + return + } + if _gasPrice > 0 { + gasPrice = big.NewInt(int64(_gasPrice)) + } + + var tx, stx *types.Transaction + tx = types.NewTransaction(nonce.Uint64(), to, big.NewInt(int64(amount)), + uint64(gas), gasPrice, nil) + + signer := types.NewEIP155Signer(chainId) + stx, err = types.SignTx(tx, signer, from.PrivateKey) + if err != nil { + return + } + + err = cli.SendTransaction(ctx, stx) + if err != nil { + return + } + + hash = stx.Hash() + return +} + // EOF