Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions fern/api-reference/tempo/tempo-api-faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Tempo API FAQ
description: Frequently asked questions about the Tempo API
subtitle: Frequently asked questions about the Tempo API
slug: reference/tempo-api-faq
---

## What is Tempo?
Tempo is a general-purpose blockchain optimized for payments. Tempo is designed to be a low-cost, high-throughput blockchain with user and developer features core to a modern payment system.

## How do I get started with Tempo?
Check out our [Tempo API Quickstart guide](./tempo-api-quickstart) to get started building on Tempo.

## What is the Tempo API?
The Tempo API allows developers to interface with the Tempo mainnet. With this API, developers can execute transactions, query on-chain data, and interact with the Tempo network, relying on a JSON-RPC standard.

## Is Tempo EVM compatible?
Yes, Tempo is EVM compatible.

## What API does Tempo use?
Tempo uses the JSON-RPC API standard. This API is crucial for any blockchain interaction on the Tempo network, allowing users to read block/transaction data, query chain information, execute smart contracts, and store data on-chain.

## What methods are supported on Tempo?
Tempo supports standard Ethereum JSON-RPC methods. Some chain-specific methods may vary. Please check the Tempo API endpoints documentation for a complete list.

## What is a Tempo API key?
When accessing the Tempo network via a node provider like Alchemy, Tempo developers use an API key to send transactions and retrieve data from the network. For the best development experience, we recommend that you [sign up for a free API key](https://dashboard.alchemy.com/signup)!

## Which libraries support Tempo?
Common Ethereum libraries like [ethers.js](https://docs.ethers.org/v5/) should be compatible with Tempo, given its EVM nature.

## My question isn’t here, where can I get help?
If you have any questions or feedback, please contact us at [email protected] or open a ticket in the dashboard.
117 changes: 117 additions & 0 deletions fern/api-reference/tempo/tempo-api-quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: Tempo API Quickstart
description: How to get started building on Tempo and using the JSON-RPC API
subtitle: How to get started building on Tempo and using the JSON-RPC API
slug: reference/tempo-api-quickstart
---

*To use the Tempo API you'll need to [create a free Alchemy account](https://dashboard.alchemy.com/signup) first!*

## Introduction

Tempo is a general-purpose blockchain optimized for payments. Tempo is designed to be a low-cost, high-throughput blockchain with user and developer features core to a modern payment system.

## What is the Tempo API?

The Tempo API allows interaction with the Tempo network through a set of JSON-RPC methods. Its design is familiar to developers who have worked with Ethereum's JSON-RPC APIs, making it intuitive and straightforward to use.

## Getting Started Instructions

### 1. Choose a Package Manager (npm or yarn)

Select a package manager to manage your project's dependencies. Choose between `npm` and `yarn` based on your preference or project requirements.

<CodeGroup>
```shell npm
# Begin with npm by following the npm documentation
# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
```

```shell yarn
# For yarn, refer to yarn's installation guide
# https://classic.yarnpkg.com/lang/en/docs/install
```
</CodeGroup>

### 2. Set Up Your Project

Open your terminal and execute the following commands to create and initialize your project:

<CodeGroup>
```shell npm
mkdir tempo-api-quickstart
cd tempo-api-quickstart
npm init --yes
```

```shell yarn
mkdir tempo-api-quickstart
cd tempo-api-quickstart
yarn init --yes
```
</CodeGroup>

This creates a new directory named `tempo-api-quickstart` and initializes a Node.js project within it.

### 3. Make Your First Request

Install Axios, a popular HTTP client, to make API requests:

<CodeGroup>
```shell npm
npm install axios
```

```shell yarn
yarn add axios
```
</CodeGroup>

Create an `index.js` file in your project directory and paste the following code:

<CodeGroup>
```javascript index.js
const axios = require('axios');

const url = 'https://tempo-testnet.g.alchemy.com/v2/${your-api-key}';

const payload = {
jsonrpc: '2.0',
id: 1,
method: 'eth_blockNumber',
params: []
};

axios.post(url, payload)
.then(response => {
console.log('Latest Block:', response.data.result);
})
.catch(error => {
console.error(error);
});
```
</CodeGroup>

Remember to replace `your-api-key` with your actual Alchemy API key that you can get from your [Alchemy dashboard](https://dashboard.alchemy.com/signup).

### 4. Run Your Script

Execute your script to make a request to the Tempo network:

<CodeGroup>
```shell shell
node index.js
```
</CodeGroup>

You should see the latest block information from Tempo's network outputted to your console:

<CodeGroup>
```shell shell
Latest Block: 0x...
```
</CodeGroup>

## Next Steps

Congratulations! You've made your first request to the Tempo network. You can now explore the various JSON-RPC methods available on Tempo and start building your dApps on this innovative platform.
Loading