Skip to content

Commit

Permalink
VRF-782: Fix setup-env script in order to include flag for deploying …
Browse files Browse the repository at this point in the history
…VRFOwner contract
  • Loading branch information
iljapavlovs committed Dec 1, 2023
1 parent f4a97b2 commit 76391fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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
5 changes: 4 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

0 comments on commit 76391fb

Please sign in to comment.