Skip to content

Commit c97d898

Browse files
authored
feat: adds tempo testnet faq & quickstart (#876)
1 parent 8fe771c commit c97d898

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Tempo API FAQ
3+
description: Frequently asked questions about the Tempo API
4+
subtitle: Frequently asked questions about the Tempo API
5+
slug: reference/tempo-api-faq
6+
---
7+
8+
## What is Tempo?
9+
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.
10+
11+
## How do I get started with Tempo?
12+
Check out our [Tempo API Quickstart guide](./tempo-api-quickstart) to get started building on Tempo.
13+
14+
## What is the Tempo API?
15+
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.
16+
17+
## Is Tempo EVM compatible?
18+
Yes, Tempo is EVM compatible.
19+
20+
## What API does Tempo use?
21+
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.
22+
23+
## What methods are supported on Tempo?
24+
Tempo supports standard Ethereum JSON-RPC methods. Some chain-specific methods may vary. Please check the Tempo API endpoints documentation for a complete list.
25+
26+
## What is a Tempo API key?
27+
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)!
28+
29+
## Which libraries support Tempo?
30+
Common Ethereum libraries like [ethers.js](https://docs.ethers.org/v5/) should be compatible with Tempo, given its EVM nature.
31+
32+
## My question isn’t here, where can I get help?
33+
If you have any questions or feedback, please contact us at [email protected] or open a ticket in the dashboard.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Tempo API Quickstart
3+
description: How to get started building on Tempo and using the JSON-RPC API
4+
subtitle: How to get started building on Tempo and using the JSON-RPC API
5+
slug: reference/tempo-api-quickstart
6+
---
7+
8+
*To use the Tempo API you'll need to [create a free Alchemy account](https://dashboard.alchemy.com/signup) first!*
9+
10+
## Introduction
11+
12+
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.
13+
14+
## What is the Tempo API?
15+
16+
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.
17+
18+
## Getting Started Instructions
19+
20+
### 1. Choose a Package Manager (npm or yarn)
21+
22+
Select a package manager to manage your project's dependencies. Choose between `npm` and `yarn` based on your preference or project requirements.
23+
24+
<CodeGroup>
25+
```shell npm
26+
# Begin with npm by following the npm documentation
27+
# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
28+
```
29+
30+
```shell yarn
31+
# For yarn, refer to yarn's installation guide
32+
# https://classic.yarnpkg.com/lang/en/docs/install
33+
```
34+
</CodeGroup>
35+
36+
### 2. Set Up Your Project
37+
38+
Open your terminal and execute the following commands to create and initialize your project:
39+
40+
<CodeGroup>
41+
```shell npm
42+
mkdir tempo-api-quickstart
43+
cd tempo-api-quickstart
44+
npm init --yes
45+
```
46+
47+
```shell yarn
48+
mkdir tempo-api-quickstart
49+
cd tempo-api-quickstart
50+
yarn init --yes
51+
```
52+
</CodeGroup>
53+
54+
This creates a new directory named `tempo-api-quickstart` and initializes a Node.js project within it.
55+
56+
### 3. Make Your First Request
57+
58+
Install Axios, a popular HTTP client, to make API requests:
59+
60+
<CodeGroup>
61+
```shell npm
62+
npm install axios
63+
```
64+
65+
```shell yarn
66+
yarn add axios
67+
```
68+
</CodeGroup>
69+
70+
Create an `index.js` file in your project directory and paste the following code:
71+
72+
<CodeGroup>
73+
```javascript index.js
74+
const axios = require('axios');
75+
76+
const url = 'https://tempo-testnet.g.alchemy.com/v2/${your-api-key}';
77+
78+
const payload = {
79+
jsonrpc: '2.0',
80+
id: 1,
81+
method: 'eth_blockNumber',
82+
params: []
83+
};
84+
85+
axios.post(url, payload)
86+
.then(response => {
87+
console.log('Latest Block:', response.data.result);
88+
})
89+
.catch(error => {
90+
console.error(error);
91+
});
92+
```
93+
</CodeGroup>
94+
95+
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).
96+
97+
### 4. Run Your Script
98+
99+
Execute your script to make a request to the Tempo network:
100+
101+
<CodeGroup>
102+
```shell shell
103+
node index.js
104+
```
105+
</CodeGroup>
106+
107+
You should see the latest block information from Tempo's network outputted to your console:
108+
109+
<CodeGroup>
110+
```shell shell
111+
Latest Block: 0x...
112+
```
113+
</CodeGroup>
114+
115+
## Next Steps
116+
117+
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.

0 commit comments

Comments
 (0)