-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(gas-station): improove logging, fix naming, change CLI args, fix…
… readme accordingly, add script to deploy test gas-station, create payer and run bridge
- Loading branch information
Showing
6 changed files
with
124 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
evm_contract=0x507AAe92E8a024feDCbB521d11EC406eEfB4488F; | ||
|
||
signer_keypair=$1; | ||
out_dir=$2; | ||
project_root=$3; | ||
|
||
gas_station_keypair=$out_dir/gas_station_keypair.json; | ||
payer_info_storage_keypair=$out_dir/payer_storage_keypair.json; | ||
|
||
mkdir -p "$out_dir" | ||
velas-keygen new -o "$payer_info_storage_keypair" | ||
velas-keygen new -o "$gas_station_keypair" | ||
|
||
owner_key=$(velas -u t -k "$signer_keypair" address) | ||
storage_key=$(velas -u t -k "$payer_info_storage_keypair" address) | ||
gas_station_key=$(velas -u t -k "$gas_station_keypair" address) | ||
echo "Keys used: signer/owner: $owner_key, storage: $storage_key, gas_station: $gas_station_key" | ||
|
||
echo Building.. | ||
"$project_root"/cargo-build-bpf -- -p evm-gas-station | ||
echo Deploying.. | ||
velas program deploy -u t -k "$signer_keypair" --program-id "$gas_station_keypair" "$project_root"/target/deploy/evm_gas_station.so | ||
|
||
echo "Registering payer.." | ||
gas_station_filter=$out_dir/gas_station_filter.json | ||
echo "[{ \"InputStartsWith\": [ \"$evm_contract\", [96, 87, 54, 29] ] }]" > "$gas_station_filter" | ||
velas evm create-gas-station-payer -u t -k "$signer_keypair" \ | ||
"$payer_info_storage_keypair" "$gas_station_key" 100000 "$gas_station_filter" | ||
|
||
echo "Starting bridge.." | ||
RUST_LOG=info evm-bridge "$signer_keypair" https://api.testnet.velas.com 127.0.0.1:8545 111 \ | ||
--gas-station "$gas_station_key" --redirect-to-proxy "$evm_contract:$owner_key:$storage_key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters