-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix frontend build #67
Conversation
We also need to find a way to get the blockfrost key into the frontend so that lucid can call blockfrost directly. There are several options:
|
fc28535
to
aaeb1a3
Compare
Sadly the proxy doesn't work. I keep getting an |
I went with
It works now. Although it seems to be re-initialising lucid once per second, not sure if this is intentional. |
@KJES4 I tried to make it so that the normal workflow for next.js is unaffected. Please let me know if anything needs to be changed there. |
Also I deleted the |
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
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.
Since we were able to get Lucid to work we can also get rid of the Cardano SDK core and crypto dependencies. We can also remove ts-log as that was used with the SDK wallet setup.
I believe the Lace team is using a secrets manager for the api keys they use. Would something like Bitwarden work for what you are trying to do? |
For the blockfrost key thing? Yeah it might work, I need to check it out, thanks for the pointer. I'll get back to this when everything is working properly. |
Yes, for the Blockfrost key thing. It looks like they have a Free forever plan you can check out: https://bitwarden.com/products/secrets-manager/#pricing |
No, that should not be happening. The call is only done once when the application loads and there aren't any dependencies that would cause the to be recalled by any state mutations. |
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.
@j-mueller remove the items in the array at the end of the useEffect in the clientLayout component. This will stop the Lucid initialization from being called over and over. Leave this array empty so that it is just called once on the initial app load.
Ah yes that explains it. I added the items because of a warning from the linter ( |
I know better than the linter on this topic. The linter always tried to get me to do this too but you only add dependencies to the array of you want that component to rerun anytime one of those dependencies changes. For the layoutComponent I don't want this to happen. |
export
script topackage.json
WST_BUILD=export
, which we use innext.config.js
to switch to a config that has theoutput: 'export'
fieldoutput: 'export'
:@next/next/no-page-custom-font
warning@cardano-sdk/key-management
dependency (didn't seem to be used)generateStaticParams
in the part that doesn't haveuse client
WST_STATIC_FILES
(if not provided via--static-files
). The nix derivation of the container sets this variable to the path in the nix store that has the frontend code.blockfrost-key
route that returns the blockfrost key