Skip to content

39. 链上随机数:本地测试 #607

Description

@yuhengfdada

纯小白学到39课,之前连metamask都没用过(

根据教程,需要在公共测试网上进行。WTF网站上关于Chainlink的信息其实是过时的,不过这个其他issue有说就不赘述了。
好在代码是新版V2,但也要搞懂Sepolia测试网,连Metamask,连Remix等一系列操作。花了一些时间弄好,LINK也转给contract了,但还是报错。
https://sepolia.etherscan.io/tx/0x62769adc0788e27b8b5a106611e0c8f3047c0e8d1e9d8332380cb93827ee3e8b

我猜测是因为给的代码里面没有正确create subscription,导致subID不对。这一点教程里似乎也没有提到。
不过其实是可以不用连测试网的,自己Mock一个Coordinator先本地测试好再去连测试网会好点,毕竟要花测试ETH还慢。
https://docs.chain.link/vrf/v2/subscription/examples/test-locally

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions