Fixed configuration problems
This commit is contained in:
parent
d4f4591616
commit
87590524d9
|
@ -9,6 +9,7 @@ cd ..
|
|||
TARGET_NETWORK=${TARGET_NETWORK:=development}
|
||||
|
||||
DEPLOY_DIR="`pwd`/src/deploy"
|
||||
TEST_SERVICES_DIR="`pwd`/src/test-services"
|
||||
DEMO_DIR="`pwd`/demo"
|
||||
|
||||
SIDE_GANACHE_DB="$DEMO_DIR/ganache_side_db"
|
||||
|
@ -101,9 +102,7 @@ deploy_db() {
|
|||
}
|
||||
|
||||
deploy_all() {
|
||||
cd "$DEPLOY_DIR"
|
||||
|
||||
TOKEN_ADDRESS=$(source "$DEPLOY_DIR/deploy-home/.env.$TARGET_NETWORK"; echo "$TOKEN_ADDRESS")
|
||||
TOKEN_ADDRESS=$(source "$DEPLOY_DIR/deploy-home/.env.$TARGET_NETWORK"; echo "$HOME_TOKEN_ADDRESS")
|
||||
|
||||
if [[ "$TARGET_NETWORK" == "development" ]] || [[ "$TOKEN_ADDRESS" == "0x" ]]; then
|
||||
deploy_token
|
||||
|
@ -119,10 +118,15 @@ deploy_all() {
|
|||
|
||||
echo "Updating deployed contract addresses in demo validators .env.$TARGET_NETWORK configs"
|
||||
for file in "$DEMO_DIR"/validator*/.env."$TARGET_NETWORK"; do
|
||||
sed -i 's/TOKEN_ADDRESS=.*$/TOKEN_ADDRESS='"$TOKEN_ADDRESS"'/' "$file"
|
||||
sed -i 's/BRIDGE_ADDRESS=.*$/BRIDGE_ADDRESS='"$BRIDGE_ADDRESS"'/' "$file"
|
||||
sed -i 's/SHARED_DB_ADDRESS=.*$/SHARED_DB_ADDRESS='"$SHARED_DB_ADDRESS"'/' "$file"
|
||||
sed -i 's/HOME_TOKEN_ADDRESS=.*$/HOME_TOKEN_ADDRESS='"$TOKEN_ADDRESS"'/' "$file"
|
||||
sed -i 's/HOME_BRIDGE_ADDRESS=.*$/HOME_BRIDGE_ADDRESS='"$BRIDGE_ADDRESS"'/' "$file"
|
||||
sed -i 's/SIDE_SHARED_DB_ADDRESS=.*$/SIDE_SHARED_DB_ADDRESS='"$SHARED_DB_ADDRESS"'/' "$file"
|
||||
done
|
||||
|
||||
echo "Updating deployed contract addresses in test-services .env.$TARGET_NETWORK configs"
|
||||
sed -i 's/HOME_TOKEN_ADDRESS=.*$/HOME_TOKEN_ADDRESS='"$TOKEN_ADDRESS"'/' "$TEST_SERVICES_DIR/ethereumBalance/.env.$TARGET_NETWORK"
|
||||
sed -i 's/HOME_BRIDGE_ADDRESS=.*$/HOME_BRIDGE_ADDRESS='"$BRIDGE_ADDRESS"'/' "$TEST_SERVICES_DIR/ethereumSend/.env.$TARGET_NETWORK"
|
||||
sed -i 's/HOME_TOKEN_ADDRESS=.*$/HOME_TOKEN_ADDRESS='"$TOKEN_ADDRESS"'/' "$TEST_SERVICES_DIR/ethereumSend/.env.$TARGET_NETWORK"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0
|
||||
HOME_BRIDGE_ADDRESS=0x752621cb86811A907F871f77Ce25118ADDA5476B
|
||||
HOME_TOKEN_ADDRESS=0xbE9f77e3644e2CF311287921E9307Ee97607Bf66
|
||||
HOME_START_BLOCK=13257537
|
||||
HOME_BRIDGE_ADDRESS=0x0448A50271c3791A09939e45fbdffd70824e29BC
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
HOME_START_BLOCK=13273212
|
||||
|
||||
SIDE_RPC_URL=https://sokol.poa.network
|
||||
SIDE_SHARED_DB_ADDRESS=0x8E5096305555F02E0005354A15DC6c2300c84319
|
||||
SIDE_SHARED_DB_ADDRESS=0x9271D07B3C038a30347089C9Ec8B9FDc10a7a286
|
||||
|
||||
FOREIGN_URL=https://testnet-dex.binance.org/
|
||||
FOREIGN_CHAIN_ID=Binance-Chain-Nile
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0
|
||||
HOME_BRIDGE_ADDRESS=0x752621cb86811A907F871f77Ce25118ADDA5476B
|
||||
HOME_TOKEN_ADDRESS=0xbE9f77e3644e2CF311287921E9307Ee97607Bf66
|
||||
HOME_START_BLOCK=13257537
|
||||
HOME_BRIDGE_ADDRESS=0x0448A50271c3791A09939e45fbdffd70824e29BC
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
HOME_START_BLOCK=13273212
|
||||
|
||||
SIDE_RPC_URL=https://sokol.poa.network
|
||||
SIDE_SHARED_DB_ADDRESS=0x8E5096305555F02E0005354A15DC6c2300c84319
|
||||
SIDE_SHARED_DB_ADDRESS=0x9271D07B3C038a30347089C9Ec8B9FDc10a7a286
|
||||
|
||||
FOREIGN_URL=https://testnet-dex.binance.org/
|
||||
FOREIGN_CHAIN_ID=Binance-Chain-Nile
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0
|
||||
HOME_BRIDGE_ADDRESS=0x752621cb86811A907F871f77Ce25118ADDA5476B
|
||||
HOME_TOKEN_ADDRESS=0xbE9f77e3644e2CF311287921E9307Ee97607Bf66
|
||||
HOME_START_BLOCK=13257537
|
||||
HOME_BRIDGE_ADDRESS=0x0448A50271c3791A09939e45fbdffd70824e29BC
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
HOME_START_BLOCK=13273212
|
||||
|
||||
SIDE_RPC_URL=https://sokol.poa.network
|
||||
SIDE_SHARED_DB_ADDRESS=0x8E5096305555F02E0005354A15DC6c2300c84319
|
||||
SIDE_SHARED_DB_ADDRESS=0x9271D07B3C038a30347089C9Ec8B9FDc10a7a286
|
||||
|
||||
FOREIGN_URL=https://testnet-dex.binance.org/
|
||||
FOREIGN_CHAIN_ID=Binance-Chain-Nile
|
||||
|
|
|
@ -3,7 +3,7 @@ HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0
|
|||
#HOME_PRIVATE_KEY is taken from src/deploy/.keys.staging
|
||||
|
||||
#Set to '0x' for redeployment of token contract in staging environment
|
||||
HOME_TOKEN_ADDRESS=0xbE9f77e3644e2CF311287921E9307Ee97607Bf66
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
|
||||
VALIDATOR_ADDRESS_1=0xaaaaB15630f63cA01bb50943AaAb4008CB53748D
|
||||
VALIDATOR_ADDRESS_2=0xbbbb63D6Fc58bD14dAF9eeF653650c4D10f3dBC8
|
||||
|
|
|
@ -58,6 +58,8 @@ async function main () {
|
|||
homeValidatorNonce = await homeWeb3.eth.getTransactionCount(validatorAddress)
|
||||
sideValidatorNonce = await sideWeb3.eth.getTransactionCount(validatorAddress)
|
||||
|
||||
console.log(`My validator address in home and side networks is ${validatorAddress}`)
|
||||
|
||||
app.listen(8001, () => {
|
||||
console.log('Proxy is listening on port 8001')
|
||||
})
|
||||
|
@ -186,7 +188,9 @@ function sideSendQuery (query) {
|
|||
nonce: sideValidatorNonce++,
|
||||
chainId: await sideWeb3.eth.net.getId()
|
||||
}
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975)
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas({
|
||||
from: validatorAddress
|
||||
}) * 1.5), 6721975)
|
||||
const signedTx = await sideWeb3.eth.accounts.signTransaction(tx, VALIDATOR_PRIVATE_KEY)
|
||||
|
||||
return sideWeb3.eth.sendSignedTransaction(signedTx.rawTransaction)
|
||||
|
@ -222,8 +226,9 @@ function homeSendQuery (query) {
|
|||
nonce: homeValidatorNonce++,
|
||||
chainId: await homeWeb3.eth.net.getId()
|
||||
}
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975)
|
||||
console.log(tx)
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas({
|
||||
from: validatorAddress
|
||||
}) * 1.5), 6721975)
|
||||
const signedTx = await homeWeb3.eth.accounts.signTransaction(tx, VALIDATOR_PRIVATE_KEY)
|
||||
|
||||
return homeWeb3.eth.sendSignedTransaction(signedTx.rawTransaction)
|
||||
|
|
|
@ -9,4 +9,4 @@ TARGET_NETWORK=${TARGET_NETWORK:=development}
|
|||
|
||||
docker build -t binance-send . > /dev/null
|
||||
|
||||
docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../keys.$TARGET_NETWORK" binance-send $@
|
||||
docker run --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" binance-send $@
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
HOME_RPC_URL=https://kovan.infura.io/v3/5d7bd94c50ed43fab1cb8e74f58678b0
|
||||
HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
HOME_RPC_URL=http://ganache_home:8545
|
||||
HOME_BRIDGE_ADDRESS=0x44c158FE850821ae69DaF37AADF5c539e9d0025B
|
||||
HOME_TOKEN_ADDRESS=0xd5fE0D28e058D375b0b038fFbB446Da37E85fFdc
|
||||
HOME_BRIDGE_ADDRESS=0x0448A50271c3791A09939e45fbdffd70824e29BC
|
||||
HOME_TOKEN_ADDRESS=0x2c9aAaea798a992a8664c9e0a6D7C84E02A579f6
|
||||
|
||||
#HOME_PRIVATE_KEY is taken from src/test-services/.keys.staging
|
||||
|
|
|
@ -9,4 +9,4 @@ TARGET_NETWORK=${TARGET_NETWORK:=development}
|
|||
|
||||
docker build -t ethreum-send . > /dev/null
|
||||
|
||||
docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" --env-file "../keys.$TARGET_NETWORK" ethreum-send $@
|
||||
docker run --network blockchain_home --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" ethreum-send $@
|
||||
|
|
|
@ -32,9 +32,11 @@ async function main () {
|
|||
from: sender,
|
||||
to: HOME_TOKEN_ADDRESS,
|
||||
nonce: await web3.eth.getTransactionCount(sender),
|
||||
chainId: parseInt(HOME_CHAIN_ID)
|
||||
chainId: HOME_CHAIN_ID
|
||||
}
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas(tx) * 1.5), 6721975)
|
||||
tx.gas = Math.min(Math.ceil(await query.estimateGas({
|
||||
from: sender
|
||||
}) * 1.5), 6721975)
|
||||
let signedTx = await web3.eth.accounts.signTransaction(tx, HOME_PRIVATE_KEY)
|
||||
|
||||
let receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction)
|
||||
|
|
|
@ -4,8 +4,11 @@ set -e
|
|||
|
||||
cd $(dirname "$0")
|
||||
|
||||
# either development or staging
|
||||
TARGET_NETWORK=${TARGET_NETWORK:=development}
|
||||
|
||||
echo "Using $TARGET_NETWORK network"
|
||||
|
||||
docker build -t ethereum-send . > /dev/null
|
||||
|
||||
docker run --network blockchain_side --rm --env-file .env --env-file "../.env.$TARGET_NETWORK" ethereum-send $@
|
||||
docker run --network blockchain_side --rm --env-file ".env.$TARGET_NETWORK" --env-file "../.keys.$TARGET_NETWORK" ethereum-send $@
|
||||
|
|
Loading…
Reference in New Issue