diff --git a/fern/images/34619bc-alch_security.png b/fern/images/34619bc-alch_security.png deleted file mode 100644 index 34fc2558d..000000000 Binary files a/fern/images/34619bc-alch_security.png and /dev/null differ diff --git a/fern/images/3bf4e5e-nim_dash.png b/fern/images/3bf4e5e-nim_dash.png deleted file mode 100644 index 6e2788a1f..000000000 Binary files a/fern/images/3bf4e5e-nim_dash.png and /dev/null differ diff --git a/fern/images/restrict-access.png b/fern/images/restrict-access.png new file mode 100644 index 000000000..61fee1998 Binary files /dev/null and b/fern/images/restrict-access.png differ diff --git a/fern/images/security.png b/fern/images/security.png new file mode 100644 index 000000000..5c0626c61 Binary files /dev/null and b/fern/images/security.png differ diff --git a/fern/tutorials/getting-started/developer-best-practices/34619bc-alch_security.png b/fern/tutorials/getting-started/developer-best-practices/34619bc-alch_security.png deleted file mode 100644 index 34fc2558d..000000000 Binary files a/fern/tutorials/getting-started/developer-best-practices/34619bc-alch_security.png and /dev/null differ diff --git a/fern/tutorials/getting-started/developer-best-practices/3bf4e5e-nim_dash.png b/fern/tutorials/getting-started/developer-best-practices/3bf4e5e-nim_dash.png deleted file mode 100644 index 6e2788a1f..000000000 Binary files a/fern/tutorials/getting-started/developer-best-practices/3bf4e5e-nim_dash.png and /dev/null differ diff --git a/fern/tutorials/getting-started/developer-best-practices/best-practices-when-using-alchemy.mdx b/fern/tutorials/getting-started/developer-best-practices/best-practices-when-using-alchemy.mdx index 3b7b2a0b3..c8d798d57 100644 --- a/fern/tutorials/getting-started/developer-best-practices/best-practices-when-using-alchemy.mdx +++ b/fern/tutorials/getting-started/developer-best-practices/best-practices-when-using-alchemy.mdx @@ -1,14 +1,10 @@ --- title: Best Practices When Using Alchemy -description: Here is a list of best practices to reduce compute unit usage costs to make sure you’re getting the most out of Alchemy’s platform! We will continue updating these as we receive customer feedback. 1. Send Requests Concurrently Depending on your background with blockchain nodes, you might expect that... -subtitle: Here is a list of best practices to reduce compute unit usage costs to make sure you’re getting the most out of Alchemy’s platform! We will continue updating these as we receive customer feedback. 1. Send Requests Concurrently Depending on your background with blockchain nodes, you might expect that... slug: docs/best-practices-when-using-alchemy --- Here is a list of best practices to reduce [compute unit usage costs](/reference/compute-units) to make sure you’re getting the most out of Alchemy’s platform! -We will continue updating these as we receive customer feedback. - ## 1. Send Requests Concurrently Depending on your background with blockchain nodes, you might expect that requests need to be sent sequentially to function properly. That’s not the case! @@ -43,7 +39,7 @@ Implementing exponential backoff retry logic in your application will help handl ## 4. Send Requests over HTTPS, not WebSockets -Though it may be tempting to use WebSockets for all node requests because it’s a newer technology, the [industry best practice for using WebSockets](/docs/best-practices-for-using-websockets-in-web3) is still primarily for push-based notifications. In the case of EVM chains, `eth_subscribe` and `eth_unsubscribe` to certain events. +Though it may be tempting to use WebSockets for all node requests because it’s a newer technology, the [industry best practice for using WebSockets](/docs/reference/best-practices-for-using-websockets-in-web3) is still primarily for push-based notifications. In the case of EVM chains, `eth_subscribe` and `eth_unsubscribe` to certain events. HTTPS is a better option for standard JSON-RPC node requests for several reasons: @@ -55,7 +51,7 @@ HTTPS is a better option for standard JSON-RPC node requests for several reasons * **HTTP status codes**: When web3 developers use WebSockets they won't receive HTTP status codes in WebSockets responses, which can be useful for debugging or sorting responses. -## 4. Avoid Large Request / Response Sizes +## 5. Avoid Large Request / Response Sizes We recommend keeping the vast majority of requests to be under 100 KB and avoiding response sizes above 10 MB. @@ -63,7 +59,7 @@ Though we permit sending large requests (currently up to 2.5 MB) and receiving l By keeping your API calls an order of magnitude smaller than our hard limits, your infrastructure will become more reliable, responsive, and you’ll spend less time debugging your dApp. -## 5. Use gZip Compression to Speed Up Large Requests +## 6. Use gZip Compression to Speed Up Large Requests At Alchemy, many of our developers have brought up slow response times as a major blocker to providing their customers with a good web3 user experience. @@ -71,15 +67,9 @@ To provide users with better product experiences, we updated our internal infras In practice, we’ve seen roughly a **75% improvement in the total latency of typical JSON-RPC replayTransaction calls.** -Go to the article below to learn how to implement gZip compression: - -[![How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](https%3A%2F%2F3169887760-files.gitbook.io%2F~%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MB17w56kk7ZnRMWdqOL%252Fsocialpreview%252FtgxWJf2xDuUaJyGF7gaS%252Falchemy-logo.png%3Falt%3Dmedia%26token%3D58b4377f-b9fa-4fdb-ad28-a43620781c90)](/docs/alchemy/guides/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) - -[![docs.alchemy.com](spaces%2F-MB17w56kk7ZnRMWdqOL%2Favatar-1631043648701.png)docs.alchemy.com](/docs/alchemy/guides/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) +Go to this article to learn how to implement gZip compression: [How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](/docs/alchemy/guides/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) -[How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](/docs/alchemy/guides/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) - -## 6. Contact Us When Multiplying Your Capacity +## 7. Contact Us When Multiplying Your Capacity Are you planning on launching the next big NFT project? Planning a major indexing project to backfill your databases with custom node data? @@ -101,21 +91,17 @@ At Alchemy, we’ve solved most of these issues, but the more advanced warning y For large projects, we provide white-glove support and direct access to our engineers; one of the reasons our customers love us so much. We’re available and willing to help with your infrastructure needs - just let us know! -## 7. Protecting your API Keys +## 8. Protecting your API Keys There might be instances where you want to embed your API key somewhere public, like frontend-only applications. To avoid unintended use of the API Key, you can setup an allowlist within your Alchemy dashboard, specifying what domains, contract addresses, wallet addresses, or IP addresses are able to send requests. To do this, visit your unique app page in the dashboard, and click on "Security" in the top right. -![1280](34619bc-alch_security.png "alch_security.png") - -Security Button - -This will open up a pop-up screen that allows you to restrict access to your API key +![1280](security.png "security.png") -![1424](3bf4e5e-nim_dash.png "nim_dash.png") +This will bring you to a page that allows you to restrict access to your API key -Restrict app access +![1424](restrict-access.png "restrict-access.png") Learn more about it [here](/docs/how-to-add-allowlists-to-your-apps-for-enhanced-security). diff --git a/fern/tutorials/getting-started/developer-best-practices/restrict-access.png b/fern/tutorials/getting-started/developer-best-practices/restrict-access.png new file mode 100644 index 000000000..61fee1998 Binary files /dev/null and b/fern/tutorials/getting-started/developer-best-practices/restrict-access.png differ diff --git a/fern/tutorials/getting-started/developer-best-practices/security.png b/fern/tutorials/getting-started/developer-best-practices/security.png new file mode 100644 index 000000000..5c0626c61 Binary files /dev/null and b/fern/tutorials/getting-started/developer-best-practices/security.png differ