Skip to content

Commit

Permalink
add fee-asset handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
AkioNak committed Jun 23, 2017
1 parent 5fbb126 commit da3bc23
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/charlie/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func doSubmit(submitRequest lib.SubmitExchangeRequest) (lib.SubmitExchangeRespon
return submitRes, err
}

txid, _, err := rpcClient.RequestAndCastString("sendrawtransaction", signedtx.Hex)
txid, _, err := rpcClient.RequestAndCastString("sendrawtransaction", signedtx.Hex, true)
if err != nil {
logger.Println("RPC/sendrawtransaction error:", err, signedtx.Hex)
return submitRes, err
Expand Down
82 changes: 47 additions & 35 deletions start_demo.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
#!/bin/bash
shopt -s expand_aliases

start_daemon () {
if [ $# -le 1 ]; then
echo " no nodes started."
return 1
fi

for i in ${@:2:$#-1} ; do
${ELDAE} -datadir=${DEMOD}/data/${i} &
if [ ""${1} == "1" ]; then
echo "${i}_dae=$!" >> ./demo.tmp
fi
done

LDW=1
while [ "${LDW}" = "1" ]
do
LDW=0
for i in ${@:2:$#-1} ; do
${ELCLI} -datadir=${DEMOD}/data/${i} getwalletinfo > /dev/null 2>&1 || LDW=1
done
if [ "${LDW}" = "1" ]; then
echo -n -e "."
sleep 1
fi
done
echo " nodes started."
return 0
}

# prepare
## be sure at elements-next folder
cd "$(dirname "${BASH_SOURCE[0]}")"
Expand Down Expand Up @@ -52,17 +81,7 @@ EOF
echo "${i}_dir=\"-datadir=${DEMOD}/data/$i\"" >> ./demo.tmp
done

fred-dae &

LDW=1
while [ "${LDW}" = "1" ]
do
LDW=0
fred getwalletinfo > /dev/null 2>&1 || LDW=1
if [ "${LDW}" = "1" ]; then
sleep 1
fi
done
start_daemon 0 fred

echo "- generating initial blocks to reach maturity"

Expand All @@ -89,32 +108,9 @@ assetdir=$AIRSKY:AIRSKY
assetdir=$MELON:MELON
assetdir=$MONECRE:MONECRE
EOF
${ELDAE} -datadir=${DEMOD}/data/$i &
echo "${i}_dae=$!" >> ./demo.tmp
done

LDW=1
while [ "${LDW}" = "1" ]
do
LDW=0
alice getwalletinfo > /dev/null 2>&1 || LDW=1
bob getwalletinfo > /dev/null 2>&1 || LDW=1
charlie getwalletinfo > /dev/null 2>&1 || LDW=1
dave getwalletinfo > /dev/null 2>&1 || LDW=1
fred getwalletinfo > /dev/null 2>&1 || LDW=1
if [ "${LDW}" = "1" ]; then
echo -n -e "."
sleep 1
fi
done

echo " nodes started"

alice addnode 127.0.0.1:10011 onetry
bob addnode 127.0.0.1:10021 onetry
charlie addnode 127.0.0.1:10031 onetry
dave addnode 127.0.0.1:10041 onetry
fred addnode 127.0.0.1:10041 onetry
start_daemon 0 alice bob charlie dave fred

## generate assets
fred getwalletinfo
Expand Down Expand Up @@ -151,6 +147,22 @@ sleep 1 # wait for sync
echo "Charlie wallet:"
charlie getwalletinfo

## setup nodes phase 3
alice stop
bob stop
charlie stop
dave stop
fred stop
sleep 3

for i in alice bob charlie dave fred; do
cat <<EOF >> ${DEMOD}/data/$i/elements.conf
feeasset=$AIRSKY
EOF
done

start_daemon 1 alice bob charlie dave fred

cd ${DEMOD}
for i in alice bob charlie dave fred; do
./$i &
Expand Down

0 comments on commit da3bc23

Please sign in to comment.