From 6e7466180eed5b7a6b6f14f2d6b6f49dc66c6b92 Mon Sep 17 00:00:00 2001 From: jongwhan Date: Sun, 14 Nov 2021 22:32:06 +0900 Subject: [PATCH] add my cli ok fix mac flow control reduce time --- my/apple/addkey.sh | 4 +++ my/apple/i1.sh | 2 ++ my/apple/init.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++ my/apple/initmac.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++ my/apple/run.sh | 2 ++ my/apple/s1.sh | 2 ++ my/apple/s2.sh | 2 ++ my/apple/send.sh | 8 ++++++ my/apple/send0.sh | 8 ++++++ my/apple/setup.sh | 43 ++++++++++++++++++++++++++++++++ my/pear/addkey.sh | 4 +++ my/pear/init.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++ my/pear/run.sh | 2 ++ my/pear/s1.sh | 2 ++ my/pear/s2.sh | 2 ++ my/pear/send.sh | 8 ++++++ my/pear/send0.sh | 8 ++++++ my/pear/setup.sh | 43 ++++++++++++++++++++++++++++++++ server/json_rpc.go | 13 ++++++++-- 19 files changed, 334 insertions(+), 2 deletions(-) create mode 100755 my/apple/addkey.sh create mode 100755 my/apple/i1.sh create mode 100755 my/apple/init.sh create mode 100755 my/apple/initmac.sh create mode 100755 my/apple/run.sh create mode 100755 my/apple/s1.sh create mode 100755 my/apple/s2.sh create mode 100755 my/apple/send.sh create mode 100755 my/apple/send0.sh create mode 100755 my/apple/setup.sh create mode 100755 my/pear/addkey.sh create mode 100755 my/pear/init.sh create mode 100755 my/pear/run.sh create mode 100755 my/pear/s1.sh create mode 100755 my/pear/s2.sh create mode 100755 my/pear/send.sh create mode 100755 my/pear/send0.sh create mode 100755 my/pear/setup.sh diff --git a/my/apple/addkey.sh b/my/apple/addkey.sh new file mode 100755 index 0000000000..e984757466 --- /dev/null +++ b/my/apple/addkey.sh @@ -0,0 +1,4 @@ +. ./setup.sh + + + diff --git a/my/apple/i1.sh b/my/apple/i1.sh new file mode 100755 index 0000000000..d8e92ab999 --- /dev/null +++ b/my/apple/i1.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI query bank balances ethm1fzep9fc7hweq9a706x4vacardl0zl0z3zquzd4 --node $NODE diff --git a/my/apple/init.sh b/my/apple/init.sh new file mode 100755 index 0000000000..0ec5c81e3d --- /dev/null +++ b/my/apple/init.sh @@ -0,0 +1,61 @@ +. ./setup.sh + +# validate dependencies are installed +command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } + +# remove existing daemon and client +rm -rf $CHAINHOME + + +$CLI config keyring-backend $KEYRING --home $CHAINHOME +$CLI config chain-id $CHAINID --home $CHAINHOME + +# if $KEY exists it should be deleted +echo $MYMNEMONICS | $CLI keys add "$KEY" --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 5 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"1 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 0 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"2 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 1 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"3 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 2 --home $CHAINHOME + +# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) +$CLI init $MONIKER --chain-id $CHAINID --home $CHAINHOME + +# Change parameter token denominations to $DENOM +cat $GENESIS | jq '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["crisis"]["constant_fee"]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# increase block time (?) +cat $GENESIS | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# Set gas limit in genesis +cat $GENESIS | jq '.consensus_params["block"]["max_gas"]="10000000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# change port +sed -i "s/create_empty_blocks = true/create_empty_blocks = false/g" $ETHCONFIG +sed -i "s/26657/$COSMOSPORT1/g" $CLIENTCONFIG +sed -i "s/26657/$COSMOSPORT1/g" $ETHCONFIG +sed -i "s/26656/$COSMOSPORT0/g" $ETHCONFIG +sed -i "s/9090/$GRPCPORT0/g" $APPCONFIG +sed -i "s/9091/$GRPCPORT1/g" $APPCONFIG +sed -i "s/8545/$ETHPORT0/g" $APPCONFIG +sed -i "s/8546/$ETHPORT1/g" $APPCONFIG +sed -i "s/aphoton/$DENOM/g" $APPCONFIG +sed -i "s/aphoton/$DENOM/g" $GENESIS + + + +# Allocate genesis accounts (cosmos formatted addresses) +$CLI add-genesis-account $KEY $TOTALAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"1 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"2 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"3 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME + +$CLI gentx $KEY $MYAMOUNT --keyring-backend $KEYRING --chain-id $CHAINID --home $CHAINHOME + +$CLI collect-gentxs --home $CHAINHOME + +$CLI validate-genesis --home $CHAINHOME + + +. ./run.sh diff --git a/my/apple/initmac.sh b/my/apple/initmac.sh new file mode 100755 index 0000000000..eef1b1c9c5 --- /dev/null +++ b/my/apple/initmac.sh @@ -0,0 +1,61 @@ +. ./setup.sh + +# validate dependencies are installed +command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } + +# remove existing daemon and client +rm -rf $CHAINHOME + + +$CLI config keyring-backend $KEYRING --home $CHAINHOME +$CLI config chain-id $CHAINID --home $CHAINHOME + +# if $KEY exists it should be deleted +echo $MYMNEMONICS | $CLI keys add "$KEY" --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 5 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"1 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 0 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"2 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 1 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"3 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 2 --home $CHAINHOME + +# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) +$CLI init $MONIKER --chain-id $CHAINID --home $CHAINHOME + +# Change parameter token denominations to $DENOM +cat $GENESIS | jq '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["crisis"]["constant_fee"]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# increase block time (?) +cat $GENESIS | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# Set gas limit in genesis +cat $GENESIS | jq '.consensus_params["block"]["max_gas"]="10000000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# change port +sed -i "" "s/create_empty_blocks = true/create_empty_blocks = false/g" $ETHCONFIG +sed -i "" "s/26657/$COSMOSPORT1/g" $CLIENTCONFIG +sed -i "" "s/26657/$COSMOSPORT1/g" $ETHCONFIG +sed -i "" "s/26656/$COSMOSPORT0/g" $ETHCONFIG +sed -i "" "s/9090/$GRPCPORT0/g" $APPCONFIG +sed -i "" "s/9091/$GRPCPORT1/g" $APPCONFIG +sed -i "" "s/8545/$ETHPORT0/g" $APPCONFIG +sed -i "" "s/8546/$ETHPORT1/g" $APPCONFIG +sed -i "" "s/aphoton/$DENOM/g" $APPCONFIG +sed -i "" "s/aphoton/$DENOM/g" $GENESIS + + + +# Allocate genesis accounts (cosmos formatted addresses) +$CLI add-genesis-account $KEY $TOTALAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"1 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"2 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"3 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME + +$CLI gentx $KEY $MYAMOUNT --keyring-backend $KEYRING --chain-id $CHAINID --home $CHAINHOME + +$CLI collect-gentxs --home $CHAINHOME + +$CLI validate-genesis --home $CHAINHOME + + +. ./run.sh diff --git a/my/apple/run.sh b/my/apple/run.sh new file mode 100755 index 0000000000..e572200c0a --- /dev/null +++ b/my/apple/run.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI start --pruning=nothing $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001$DENOM --json-rpc.api eth,txpool,personal,net,debug,web3,miner --home $CHAINHOME diff --git a/my/apple/s1.sh b/my/apple/s1.sh new file mode 100755 index 0000000000..7705c50ba8 --- /dev/null +++ b/my/apple/s1.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI query bank balances $S1 --node $NODE diff --git a/my/apple/s2.sh b/my/apple/s2.sh new file mode 100755 index 0000000000..4468eb16ae --- /dev/null +++ b/my/apple/s2.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI query bank balances $S2 --node $NODE diff --git a/my/apple/send.sh b/my/apple/send.sh new file mode 100755 index 0000000000..528514e129 --- /dev/null +++ b/my/apple/send.sh @@ -0,0 +1,8 @@ +. ./setup.sh +export FROM=$S1 +export TO=$S2 + + +export AMOUNT=2100000000000000001$DENOM +echo "send amount $AMOUNT" +$CLI tx bank send $FROM $TO $AMOUNT --chain-id $CHAINID --keyring-backend $KEYRING --fees 20$DENOM --home $CHAINHOME diff --git a/my/apple/send0.sh b/my/apple/send0.sh new file mode 100755 index 0000000000..f2d2997e40 --- /dev/null +++ b/my/apple/send0.sh @@ -0,0 +1,8 @@ +. ./setup.sh +export FROM=$K1 +export TO=$S1 + + +export AMOUNT=1001000000000000000000$DENOM +echo "send amount $AMOUNT" +$CLI tx bank send $FROM $TO $AMOUNT --chain-id $CHAINID --keyring-backend $KEYRING --fees 20$DENOM --home $CHAINHOME diff --git a/my/apple/setup.sh b/my/apple/setup.sh new file mode 100755 index 0000000000..07c6481cbb --- /dev/null +++ b/my/apple/setup.sh @@ -0,0 +1,43 @@ + +export KEY="mykey" +export CHAINID="applemint_9000-2" +export MONIKER="localtestnet" +export KEYRING="test" +export KEYALGO="eth_secp256k1" +export LOGLEVEL="info" +# to trace evm +export TRACE="--trace" +#export TRACE="" +export CHAINHOME=$HOME/.$CHAINID + +export ETHCONFIG=$CHAINHOME/config/config.toml +export GENESIS=$CHAINHOME/config/genesis.json +export TMPGENESIS=$CHAINHOME/config/tmp_genesis.json +export APPCONFIG=$CHAINHOME/config/app.toml +export CLIENTCONFIG=$CHAINHOME/config/client.toml +export DENOM=aapple +#echo $GENESIS +#echo $TMPGENESIS +#echo $ETHCONFIG +#echo $APPCONFIG +#echo 'DENOM='$DENOM + + +export GRPCPORT0=9090 +export GRPCPORT1=9091 +export ETHPORT0=8545 +export ETHPORT1=8546 +export COSMOSPORT0=26656 +export COSMOSPORT1=26657 +export CLI=ethermintd +export NODE=tcp://127.0.0.1:26657 +$CLI keys list --keyring-backend $KEYRING --home $CHAINHOME +#echo 'HOME='$CHAINHOME + +export TOTALAMOUNT=100000000000000000000000000000000000$DENOM +export MYAMOUNT=1000000100000000000000001$DENOM + +export K1=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[0].address' | tr -d '"') +export S1=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[1].address' | tr -d '"') +export S2=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[2].address' | tr -d '"') + diff --git a/my/pear/addkey.sh b/my/pear/addkey.sh new file mode 100755 index 0000000000..e984757466 --- /dev/null +++ b/my/pear/addkey.sh @@ -0,0 +1,4 @@ +. ./setup.sh + + + diff --git a/my/pear/init.sh b/my/pear/init.sh new file mode 100755 index 0000000000..1e7bf56203 --- /dev/null +++ b/my/pear/init.sh @@ -0,0 +1,61 @@ +. ./setup.sh + +# validate dependencies are installed +command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } + +# remove existing daemon and client +rm -rf $CHAINHOME + + +$CLI config keyring-backend $KEYRING --home $CHAINHOME +$CLI config chain-id $CHAINID --home $CHAINHOME + +# if $KEY exists it should be deleted +echo $MYMNEMONICS | $CLI keys add "$KEY" --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 5 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"1 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 0 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"2 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 1 --home $CHAINHOME +echo $MYMNEMONICS | $CLI keys add "$KEY"3 --keyring-backend $KEYRING --algo "eth_secp256k1" --recover --index 2 --home $CHAINHOME + +# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) +$CLI init $MONIKER --chain-id $CHAINID --home $CHAINHOME + +# Change parameter token denominations to $DENOM +cat $GENESIS | jq '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["crisis"]["constant_fee"]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS +cat $GENESIS | jq '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# increase block time (?) +cat $GENESIS | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# Set gas limit in genesis +cat $GENESIS | jq '.consensus_params["block"]["max_gas"]="10000000"' > $TMPGENESIS && mv $TMPGENESIS $GENESIS + +# change port +sed -i "" "s/create_empty_blocks = true/create_empty_blocks = false/g" $ETHCONFIG +sed -i "" "s/26657/$COSMOSPORT1/g" $CLIENTCONFIG +sed -i "" "s/26657/$COSMOSPORT1/g" $ETHCONFIG +sed -i "" "s/26656/$COSMOSPORT0/g" $ETHCONFIG +sed -i "" "s/9090/$GRPCPORT0/g" $APPCONFIG +sed -i "" "s/9091/$GRPCPORT1/g" $APPCONFIG +sed -i "" "s/8545/$ETHPORT0/g" $APPCONFIG +sed -i "" "s/8546/$ETHPORT1/g" $APPCONFIG +sed -i "" "s/aphoton/$DENOM/g" $APPCONFIG +sed -i "" "s/aphoton/$DENOM/g" $GENESIS + + + +# Allocate genesis accounts (cosmos formatted addresses) +$CLI add-genesis-account $KEY $TOTALAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"1 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"2 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME +$CLI add-genesis-account "$KEY"3 $MYAMOUNT --keyring-backend $KEYRING --home $CHAINHOME + +$CLI gentx $KEY $MYAMOUNT --keyring-backend $KEYRING --chain-id $CHAINID --home $CHAINHOME + +$CLI collect-gentxs --home $CHAINHOME + +$CLI validate-genesis --home $CHAINHOME + + +. ./run.sh diff --git a/my/pear/run.sh b/my/pear/run.sh new file mode 100755 index 0000000000..8e89a844a3 --- /dev/null +++ b/my/pear/run.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI start --pruning=nothing $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001$DENOM --json-rpc.api eth,txpool,personal,net,debug,web3,miner --home $CHAINHOME \ No newline at end of file diff --git a/my/pear/s1.sh b/my/pear/s1.sh new file mode 100755 index 0000000000..7705c50ba8 --- /dev/null +++ b/my/pear/s1.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI query bank balances $S1 --node $NODE diff --git a/my/pear/s2.sh b/my/pear/s2.sh new file mode 100755 index 0000000000..4468eb16ae --- /dev/null +++ b/my/pear/s2.sh @@ -0,0 +1,2 @@ +. ./setup.sh +$CLI query bank balances $S2 --node $NODE diff --git a/my/pear/send.sh b/my/pear/send.sh new file mode 100755 index 0000000000..528514e129 --- /dev/null +++ b/my/pear/send.sh @@ -0,0 +1,8 @@ +. ./setup.sh +export FROM=$S1 +export TO=$S2 + + +export AMOUNT=2100000000000000001$DENOM +echo "send amount $AMOUNT" +$CLI tx bank send $FROM $TO $AMOUNT --chain-id $CHAINID --keyring-backend $KEYRING --fees 20$DENOM --home $CHAINHOME diff --git a/my/pear/send0.sh b/my/pear/send0.sh new file mode 100755 index 0000000000..f2d2997e40 --- /dev/null +++ b/my/pear/send0.sh @@ -0,0 +1,8 @@ +. ./setup.sh +export FROM=$K1 +export TO=$S1 + + +export AMOUNT=1001000000000000000000$DENOM +echo "send amount $AMOUNT" +$CLI tx bank send $FROM $TO $AMOUNT --chain-id $CHAINID --keyring-backend $KEYRING --fees 20$DENOM --home $CHAINHOME diff --git a/my/pear/setup.sh b/my/pear/setup.sh new file mode 100755 index 0000000000..7c5b75e046 --- /dev/null +++ b/my/pear/setup.sh @@ -0,0 +1,43 @@ + +export KEY="mykey" +export CHAINID="pearmint_9000-6" +export MONIKER="localtestnet" +export KEYRING="test" +export KEYALGO="eth_secp256k1" +export LOGLEVEL="info" +# to trace evm +export TRACE="--trace" +#export TRACE="" +export CHAINHOME=$HOME/.$CHAINID + +export ETHCONFIG=$CHAINHOME/config/config.toml +export GENESIS=$CHAINHOME/config/genesis.json +export TMPGENESIS=$CHAINHOME/config/tmp_genesis.json +export APPCONFIG=$CHAINHOME/config/app.toml +export CLIENTCONFIG=$CHAINHOME/config/client.toml +export DENOM=apear +#echo $GENESIS +#echo $TMPGENESIS +#echo $ETHCONFIG +#echo $APPCONFIG +#echo 'DENOM='$DENOM + + +export GRPCPORT0=9080 +export GRPCPORT1=9081 +export ETHPORT0=8535 +export ETHPORT1=8536 +export COSMOSPORT0=26646 +export COSMOSPORT1=26647 +export CLI=cronosd +export NODE=tcp://127.0.0.1:26647 +$CLI keys list --keyring-backend $KEYRING --home $CHAINHOME +#echo 'HOME='$CHAINHOME + +export TOTALAMOUNT=100000000000000000000000000000000$DENOM +export MYAMOUNT=1000100000000000000001$DENOM + +export K1=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[0].address' | tr -d '"') +export S1=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[1].address' | tr -d '"') +export S2=$($CLI keys list --keyring-backend $KEYRING --home $CHAINHOME | yq eval -o json | jq '.[2].address' | tr -d '"') + diff --git a/server/json_rpc.go b/server/json_rpc.go index 204427fce7..8a8e024bdb 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -1,6 +1,7 @@ package server import ( + "net" "net/http" "time" @@ -45,9 +46,17 @@ func StartJSONRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr, tmEn } httpSrv := &http.Server{ - Addr: config.JSONRPC.Address, - Handler: handlerWithCors.Handler(r), + Addr: config.JSONRPC.Address, + Handler: handlerWithCors.Handler(r), + IdleTimeout: 0, + ReadHeaderTimeout: 0, + WriteTimeout: 0, + ConnState: func(a net.Conn, b http.ConnState) { + //fmt.Printf("ConnState %v %v\n", a, b) + time.Sleep(5 * time.Millisecond) + }, } + httpSrv.SetKeepAlivesEnabled(false) httpSrvDone := make(chan struct{}, 1) errCh := make(chan error)