Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRF-782: Fix setup-env script in order to include flag for deploying … #11445

Merged
merged 7 commits into from
Dec 5, 2023
6 changes: 4 additions & 2 deletions core/scripts/common/vrf/setup-envs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ go run . \
--batch-fulfillment-enabled="true" \
--min-confs=3 \
--register-vrf-key-against-address=<vrf key will be registered against this address
in order to call oracleWithdraw from this address>
in order to call oracleWithdraw from this address> \
--deploy-vrfv2-owner="true"
```

Optional parameters - will not be deployed if specified
Expand Down Expand Up @@ -71,7 +72,7 @@ go run . \
--sending-key-funding-amount="1e17" \
--deploy-contracts-and-create-jobs="false"
```
Then update corresponding deployment scripts with the new ETH addresses, specifying max gas price for each key
Then update corresponding deployment scripts in infra-k8s repo with the new ETH addresses, specifying max gas price for each key

e.g.:
```
Expand All @@ -98,6 +99,7 @@ go run . \
--batch-fulfillment-enabled="true" \
--min-confs=3 \
--register-vrf-key-against-address="<eoa address>" \
--deploy-vrfv2-owner="true" \
--link-address "<link address>" \
--link-eth-feed "<link eth feed address>"
```
Expand Down
6 changes: 5 additions & 1 deletion core/scripts/common/vrf/setup-envs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/shopspring/decimal"
"github.com/urfave/cli"

helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
"github.com/smartcontractkit/chainlink/core/scripts/common/vrf/constants"
"github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model"
Expand All @@ -21,7 +23,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5"
"github.com/smartcontractkit/chainlink/v2/core/web/presenters"
"github.com/urfave/cli"
)

func newApp(remoteNodeURL string, writer io.Writer) (*clcmd.Shell, *cli.App) {
Expand Down Expand Up @@ -87,6 +88,7 @@ func main() {
batchCoordinatorAddressString := flag.String("batch-coordinator-address", "", "address Batch VRF Coordinator contract")
registerVRFKeyAgainstAddress := flag.String("register-vrf-key-against-address", "", "VRF Key registration against address - "+
"from this address you can perform `coordinator.oracleWithdraw` to withdraw earned funds from rand request fulfilments")
deployVRFOwner := flag.Bool("deploy-vrfv2-owner", true, "whether to deploy VRF owner contracts")

e := helpers.SetupEnv(false)
flag.Parse()
Expand Down Expand Up @@ -211,6 +213,7 @@ func main() {
coordinatorConfigV2,
*batchFulfillmentEnabled,
nodesMap,
*deployVRFOwner,
)
case "v2plus":
feeConfigV2Plus := vrf_coordinator_v2_5.VRFCoordinatorV25FeeConfig{
Expand Down Expand Up @@ -503,6 +506,7 @@ func createETHKeysIfNeeded(client *clcmd.Shell, app *cli.App, output *bytes.Buff
var newKey presenters.ETHKeyResource

flagSet := flag.NewFlagSet("blah", flag.ExitOnError)
flagSet.String("evm-chain-id", os.Getenv("ETH_CHAIN_ID"), "chain id")
if *maxGasPriceGwei > 0 {
helpers.PanicErr(flagSet.Set("max-gas-price-gwei", fmt.Sprintf("%d", *maxGasPriceGwei)))
}
Expand Down
Loading