Skip to content

Notes for Circle Team

Constance Shi edited this page Dec 26, 2020 · 7 revisions

WIP

File Infrastructure

Required Files

.env File

Should contain the following:

  • GOOGLE_APPLICATION_CREDENTIALS=./google-credentials.json
  • PURESTAKE_API_KEY=[API Key for Algorand calls]
  • USDC_CONTRACT_ADDRESS=[desired usdc contract address depending on the network (i.e. Mainnet, Ropsten)]

google-credentials.json

Required for Google BigQuery calls, such as querying for minters on the Ethereum (root) page.

Adding New Blockchains

Our component hierarchy, described in more detail here, enables new blockchains to be added simply by adding a new page route /[blockchain-name] in the pages directory, and the desired pages within this new route, such as /transactions. All logic for the root page should go in an index.vue file in this new page route, and can use the same format and code as other index.vue files for already implemented blockchains, except for replacing the logic to query and fetch information. Similarly, pages on other blockchains such as the Accounts page, can be implemented similarly for new blockchains, but with modification to any API logic when requesting information. Our Component Hierarchy Page walks through more specific examples.

Known Issues

Performance of Accounts, Transaction Pages

Our accounts/transaction pages on Ethereum uses binary search and makes repeated calls to web3. This can take a (very) long time, and is likely unacceptable in the context of user experience. It may be optimized by tweaking parameters or by fetching and caching the data via a backend. It might also be solved by switching queries from Web3 to Google BigQuery instead

Google BigQuery Limitations

Currently, we fetch minters from the Google BigQuery dataset for Ethereum Mainnet. However, there is currently no support for Ropsten or other nets for the same data. As of now, we've hidden information that we can't query for, but it is a possible feature in the future if the data becomes available.

Age not shown for Algorand pages

Currently, the transaction tables on the /algorand/** pages don't show the age of transactions. Our API endpoints, which use Purestake, did not provide the age in their transactions responses, and querying a separate transaction call for each transaction was far too expensive, especially since Purestake limits queries to either 5 requests/min or 1 request/min depending on the specific API queried. We did not get the chance to exploring alternative options, so there may also be other solutions.

No support for testnet on Algorand pages

Currently, the /algorand/** pages only show content for the mainnet ledger, and there is no support to "switch" to testnet at the moment. To do this, you can change the subdomain of the base server that we use for our api calls in algorand-rest.js to https://testent-algorand.api.purestake.io. To have support for both ledgers, we were thinking of adding an environment variable that provides the ledger (mainnet vs testnet).

Clone this wiki locally