diff --git a/.env b/.env new file mode 100644 index 0000000000..f45f897dbb --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VALIDATOR_PRIVATE_KEY=31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc +FOO=BAR diff --git a/.gitignore b/.gitignore index 27da45096f..b11358760d 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ contract-examples/dynamic_rpc.json plugins/evm/hubble.db *.bin + +local_status.sh \ No newline at end of file diff --git a/go.mod b/go.mod index 7829b01ee8..8cf3cbb623 100644 --- a/go.mod +++ b/go.mod @@ -77,6 +77,7 @@ require ( github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-sqlite3 v1.14.16 // indirect diff --git a/go.sum b/go.sum index 00c53fdd37..090ef2f819 100644 --- a/go.sum +++ b/go.sum @@ -336,6 +336,8 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= diff --git a/local_status.sh b/local_status.sh deleted file mode 100644 index 976da3f078..0000000000 --- a/local_status.sh +++ /dev/null @@ -1,2 +0,0 @@ -export CHAIN_ID=DMcFSDBLMfDrFTjXAqT3LkDQS2wGkatuBqAcdJYANTmUw4Bxm -export LOGS_PATH="/Users/shubham/.avalanche-cli/runs/network-runner-root-data_20230310_163606/node/logs" diff --git a/plugin/evm/limitorders/limit_order_tx_processor.go b/plugin/evm/limitorders/limit_order_tx_processor.go index 8fe8450eec..47b44c96fa 100644 --- a/plugin/evm/limitorders/limit_order_tx_processor.go +++ b/plugin/evm/limitorders/limit_order_tx_processor.go @@ -11,6 +11,7 @@ import ( "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/eth" + "github.com/joho/godotenv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -73,6 +74,11 @@ func NewLimitOrderTxProcessor(txPool *core.TxPool, memoryDb LimitOrderDatabase, if err != nil { panic(err) } + err = godotenv.Load() + if err != nil { + panic(err) + } + validatorPrivateKey := os.Getenv("VALIDATOR_PRIVATE_KEY") if validatorPrivateKey == "" { panic("private key is not supplied") diff --git a/scripts/run_local.sh b/scripts/run_local.sh index 3ee0118dbd..3a226e74a1 100755 --- a/scripts/run_local.sh +++ b/scripts/run_local.sh @@ -8,12 +8,6 @@ if ! [[ "$0" =~ scripts/run_local.sh ]]; then exit 255 fi -export VALIDATOR_PRIVATE_KEY="31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc" -if [[ -z "${VALIDATOR_PRIVATE_KEY}" ]]; then - echo "VALIDATOR_PRIVATE_KEY must be set" - exit 255 -fi - avalanche network clean ./scripts/build.sh custom_evm.bin