1- import {
2- getByteCode ,
3- getEnv ,
4- killProcessOnPort ,
5- wait ,
6- waitForHealth ,
7- } from './util.ts'
8- import { FlipperAbi } from '../codegen/abi/Flipper.ts'
9-
10- if ( Deno . env . get ( 'START_REVIVE_DEV_NODE' ) ) {
11- const nodePath = Deno . env . get ( 'REVIVE_DEV_NODE_PATH' ) ??
12- `${ Deno . env . get ( 'HOME' ) } /polkadot-sdk/target/debug/revive-dev-node`
13- console . log ( `🚀 Start node ${ nodePath } ...` )
14- killProcessOnPort ( 9944 )
15- new Deno . Command ( nodePath , {
16- args : [
17- '--dev' ,
18- '-l=error,evm=debug,sc_rpc_server=info,runtime::revive=debug' ,
19- ] ,
20- stdout : 'inherit' ,
21- stderr : 'inherit' ,
22- } ) . spawn ( )
23- }
1+ #!/usr/bin/env -S deno run --env-file --allow-all
242
25- // Run eth-rpc on 8545
26- if ( Deno . env . get ( 'START_ETH_RPC' ) ) {
27- const adapterPath = Deno . env . get ( 'ETH_RPC_PATH' ) ??
28- `${ Deno . env . get ( 'HOME' ) } /polkadot-sdk/target/debug/eth-rpc`
29- console . log ( `🚀 Start eth-rpc ${ adapterPath } ...` )
30- killProcessOnPort ( 8545 )
31- new Deno . Command ( adapterPath , {
32- args : [
33- '--dev' ,
34- '--node-rpc-url=ws://localhost:9944' ,
35- '-l=rpc-metrics=debug,eth-rpc=debug' ,
36- ] ,
37- stdout : 'inherit' ,
38- stderr : 'inherit' ,
39- } ) . spawn ( )
40- }
3+ import { getByteCode , getEnv , wait , waitForHealth } from './util.ts'
4+ import { FlipperAbi } from '../codegen/abi/Flipper.ts'
415
426await waitForHealth ( 'http://localhost:8545' ) . catch ( )
437const env = await getEnv ( )
@@ -49,7 +13,7 @@ const hash = await wallet.deployContract({
4913 bytecode : getByteCode ( 'Flipper' , env . evm ) ,
5014} )
5115
52- const deployReceipt = await wallet . waitForTransactionReceipt ( { hash } )
16+ const deployReceipt = await wallet . waitForTransactionReceipt ( hash )
5317if ( ! deployReceipt . contractAddress ) {
5418 throw new Error ( 'Contract address should be set' )
5519}
9155
9256 const hash = await wallet . writeContract ( request )
9357 console . time ( hash )
94- wallet . waitForTransactionReceipt ( { hash } ) . then ( ( receipt ) => {
58+ wallet . waitForTransactionReceipt ( hash ) . then ( ( receipt ) => {
9559 console . timeEnd ( hash )
9660 console . log ( '-----------------------------------' )
9761 console . log ( `status: ${ receipt . status ? '✅' : '❌' } ` )
0 commit comments