-
Notifications
You must be signed in to change notification settings - Fork 28
Add support for running both a TESTNET and an alpha PUBLIC network Turret #36
Conversation
|
Note this PR breaks the current GitHub Actions for Serverless. The current flow alters the env variables depending on which Turret you're deploying. With GitHub secrets you would have to set once either for testnet or alpha but it wound't support deploying to both. Will need to address this before merging to |
|
I have worked through this, it went pretty smoothly. We now have: https://stellar-turrets-testnet.taskio.workers.dev Here's my notes:
Minor notes to keep in mind for when we create new instructions after master merge:
Cheers |
See https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml and grep for |
This is in the current README however it isn't included here that when publishing for the alpha env you'll need to publish an additional Durable Object class via the |
Added a description of running two turrets, and linked to kalepail/stellar-turrets#36 for further information. Signed-off-by: Elliot J. Voris <elliot@voris.me>
update deploy documentation for alpha release
We're finally ready to take our first (very safe) steps in the universe of public network Turrets! 🎉
This PR adds all the necessary config and script changes to make this functionality possible.
Note that when the
STELLAR_NETWORK = "PUBLIC"a new check will come into play on the txFunction upload endpoint blocking all contract uploads except for those hashes which have been manually added to the newALLOWEDKV store.So here are the necessary steps to get everything up and running.
stellar-tssortss-stellarin favor ofstellar-turrets. (note I'll probably change the name of this repo as well). Because of this change you'll likely need to delete your AWS deployment and spin up a new one under this new name. AWS is weird with name changes. To do that just navigate into your AWS console under CloudFormation and delete thetss-stellarstack.stellar-turrets-testnet. You could also delete the existing Worker as it would get recreated the next time you deploy. For the KV navigate to the KV tab and re-prefix the existing KV stores with the newstellar-turrets-testnet. For Cloudflare these changes are more cosmetic than necessary as CF works of ids not names of things, but it should help in the future if we start matching everything with their name.stellar-turrets-alphato our Cloudflare account. The best way to accomplish this is first to run thesetup.shscript from within the./wranglerdirectory again. You may need to comment out the commands for the existing testnet KV stores but I think it should just error out or skip those. Keep track of the alpha outputs and I strongly suggest using a new Stellar key for theTURRET_SIGNERthan you're using for the testnet.npm run preinitand thennpm run init. As the script walks you through the flow just paste in all the appropriate values. If you've forgotten what they were or are they should be in the old .env file or in the Cloudflare dashboard.wrangler publish(for testnet) andwranger publish --env alpha(for alpha, duh)6.1. On the first publish of a new
--envyou'll need to also create the Durable Object so you'll need to run the publish command with the--new-class TxFeesflag. So in the case of an alpha publish it would bewrangler --env alpha --new-class TxFees publish./serverlessdirectory and runnpx envdist testnetandnpx envdist alphaand fill in the appropriate values. Note if you already have a .env file you can delete that as we'll now be creating and relying on.env.testnetand.env.alphafor the deploy process. Once those are built you should be able to just runsls deploy(for testnet) andsls deploy --stage alpha(for alpha, again, duh){TESTNET|ALPHA}_TURRET_FUNCTION_RUNNER_URLvalues if you didn't have them earlier. Same goes for theSLS_TURRET_BASE_URLvariable in the Serverless env files. The deployments are only as good as your configuration so please ensure you've done it right.{TESTNET|ALPHA}_TURRET_ADDRESS/SLS_TURRET_SIGNER_ACCOUNTaddresses between your testnet and alpha Turrets. Duplicating these is a bad idea as a leak to a Testnet key is no big deal but a leak on the public network could equal loss of funds. The time to be safe is now!If any of these instructions were wrong, incomplete or out of order please comment here so we can adjust. Good luck!