-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: envis for txd and checkout-service URLs #580
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
src/Utils/useTXDTransmitter.ts
Outdated
'wss://peregrine.kilt.io': 'https://dev.checkout.kilt.io', | ||
'wss://peregrine-stg.kilt.io/para': 'https://smoke.checkout.kilt.io', | ||
}; | ||
function deductTxdURL(blockchainEndpoint: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we would change it to this?
I think we should move these links into the environment variables outside of the application itself.
Once we handle them outside, we can change them without creating a PR.
That would mean this needs to be reworked to take an env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggera What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, did it.
New environment variables:
REACT_APP_CHECKOUT_URL
REACT_APP_TXD_URL
'wss://peregrine.kilt.io': 'https://dev.txd.trusted-entity.io', | ||
'wss://peregrine-stg.kilt.io/para': 'https://smoke.txd.trusted-entity.io', | ||
}; | ||
export const checkoutServiceURL = process.env.REACT_APP_CHECKOUT_URL as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use different env for the different deployments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggera Can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to override a variable on Amplify at the moment. HODL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @ggera can you confirm you were able to override the variables on amp?
'wss://peregrine.kilt.io': 'https://dev.txd.trusted-entity.io', | ||
'wss://peregrine-stg.kilt.io/para': 'https://smoke.txd.trusted-entity.io', | ||
}; | ||
export const checkoutServiceURL = process.env.REACT_APP_CHECKOUT_URL as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
yes it's possible now |
fixes https://github.com/KILTprotocol/ticket/issues/3614
The TXD and Checkout Service URLs used to be mapped from the blockchain Endpoint. Recently, new endpoints for Spiritnet where added, but the maps where not updated for it. This was leading to bad HTTP requests and breaking the UI of production.
I now changed the approach to find out which TXD and Checkout Service URLs to use. So not all endpoints need to be explicitly listed on the maps, allowing newer endpoints to be used without changing code.For my new approach I assume that peregrine endpoints include "peregrine" and peregrine-staging endpoints include "peregrine-stg" on their URIs. This is still way less assumptions than before, where the whole endpoint URI had to match.The URLs for TxD and the checkout service need to be passed as environment variables now.