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

docs: Revamp ROFL chapter slightly to also include smart contract deployment #2047

Open
2 tasks
matevz opened this issue Oct 25, 2024 · 0 comments
Open
2 tasks
Assignees
Labels
c:docs Category: documentation c:rofl Category: ROFL

Comments

@matevz
Copy link
Member

matevz commented Oct 25, 2024

A user asked an interesting chickend-and-agg problem which I also considered a while ago:

(According to docs) Basically I need to first open the docker local testnet via sudo docker run -it -p8545:8545 -p8546:8546 -v ./rofl-oracle:/rofls ghcr.io/oasisprotocol/sapphire-localnet
Then deploy a sapphire contract like the one you gave by changin the http provider.
So lets say now I do get an address x of this contract but now I will change the address to this one inside the rofl application like in the docs and build it.
After this I need to again run the local test net but this time by running the docker instance with the rolf app mounted.
My question is does turing my local testnet off then turning it on again not refreshes it completely? Or does my deployed contract on local testnet remain even after stoping the docker instance and loading it again with the rolf app mounted for price updation purposes?

My answer on this was:

the contract address is derived from the address of the account it's deploying it and nonce. This will always be deterministic on Localnet when you restart it.

I suggest we:

  • Put a note somewhere that the contract address will always be deterministic on the Localnet, if you're using the same account and that's why you can simply hardcode the smart contract address into the ROFL rust source.
  • Put the hardhat deploy somewhere into the Application chapter already so that people can try the complete example without reading through the whole Deployment chapter
@matevz matevz added c:docs Category: documentation c:rofl Category: ROFL labels Oct 25, 2024
@matevz matevz self-assigned this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:docs Category: documentation c:rofl Category: ROFL
Projects
None yet
Development

No branches or pull requests

1 participant