You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use any number of predefined datasets available from Spice.ai in the Spice runtime.
144
+
import DocCardList from '@theme/DocCardList';
145
145
146
-
A list of publically available datasets from Spice.ai can be found here: https://[docs.spice.ai/building-blocks/datasets](https://docs.spice.ai/building-blocks/datasets).
147
-
148
-
In order to access public datasets from Spice, you will first need to create an account with Spice.ai by selecting the free tier membership.
149
-
150
-
Navigate to [spice.ai](https://spice.ai/) and create a new account by clicking on Try for Free.
You will now be able to access datasets from the Spice.ai Platform. For this quickstart, we will be using the `eth.recent_blocks` dataset.
159
-
160
-
**Step 1.** Log in and authenticate from the command line using the `spice login` command. A pop up browser window will prompt you to authenticate:
161
-
162
-
```bash
163
-
spice login
164
-
```
165
-
166
-
**Step 2.** Initialize a new project and start the runtime:
167
-
168
-
```bash
169
-
# Initialize a new Spice app
170
-
spice init spice_app
171
-
172
-
# Change to app directory
173
-
cd spice_app
174
-
175
-
# Start the runtime
176
-
spice run
177
-
```
178
-
179
-
**Step 3.** Configure the dataset:
180
-
181
-
In a new terminal window, configure a new dataset using the `spice dataset configure` command:
182
-
183
-
```bash
184
-
spice dataset configure
185
-
```
186
-
187
-
Enter a dataset name that will be used to reference the dataset in queries. This name does not need to match the name in the dataset source.
188
-
189
-
```bash
190
-
dataset name: (spice_app) eth_recent_blocks
191
-
```
192
-
193
-
Enter the description of the dataset:
194
-
195
-
```
196
-
description: Recent Ethereum blocks
197
-
```
198
-
199
-
Enter the location of the dataset:
200
-
201
-
```bash
202
-
from: spice.ai/eth.recent_blocks
203
-
```
204
-
205
-
Select `y` when prompted whether to accelerate the data:
206
-
207
-
```bash
208
-
Locally accelerate (y/n)? y
209
-
```
210
-
211
-
You should see the following output from your runtime terminal:
212
-
213
-
```bash
214
-
2024-02-21T22:49:10.038461Z INFO runtime: Loaded dataset: eth_recent_blocks
215
-
```
216
-
217
-
**Step 4.** In a new terminal window, use the Spice SQL REPL to query the dataset
218
-
219
-
```bash
220
-
spice sql
221
-
```
222
-
223
-
```bash
224
-
SELECT number, size, gas_used from eth_recent_blocks LIMIT 10;
225
-
```
226
-
227
-
The output displays the results of the query along with the query execution time:
228
-
229
-
```bash
230
-
+----------+--------+----------+
231
-
| number | size | gas_used |
232
-
+----------+--------+----------+
233
-
| 19281345 | 400378 | 16150051 |
234
-
| 19281344 | 200501 | 16480224 |
235
-
| 19281343 | 97758 | 12605531 |
236
-
| 19281342 | 89629 | 12035385 |
237
-
| 19281341 | 133649 | 13335719 |
238
-
| 19281340 | 307584 | 18389159 |
239
-
| 19281339 | 89233 | 13391332 |
240
-
| 19281338 | 75250 | 12806684 |
241
-
| 19281337 | 100721 | 11823522 |
242
-
| 19281336 | 150137 | 13418403 |
243
-
+----------+--------+----------+
244
-
245
-
Query took: 0.004057791 seconds
246
-
```
247
-
248
-
You can experiment with the time it takes to generate queries when using non-accelerated datasets. You can change the acceleration setting from `true` to `false` in the datasets.yaml file.
title: 'Spice.ai OSS and the Spice.ai Cloud Platform'
3
+
sidebar_label: 'Spice.ai Cloud Platform'
4
+
sidebar_position: 1
5
+
description: 'Connect to the Spice.ai Cloud Platform to access public datasets.'
6
+
pagination_next: null
7
+
---
8
+
9
+
You can use any number of predefined datasets available from the Spice.ai Cloud Platform in the Spice runtime.
10
+
11
+
A list of publically available datasets from Spice.ai can be found here: [https://docs.spice.ai/building-blocks/datasets](https://docs.spice.ai/building-blocks/datasets).
12
+
13
+
In order to access public datasets from Spice, you will first need to create an account with Spice.ai by selecting the free tier membership.
14
+
15
+
Navigate to [spice.ai](https://spice.ai/) and create a new account by clicking on Try for Free.
You will now be able to access datasets from the Spice.ai Platform. For this quickstart, we will be using the `eth.recent_blocks` dataset.
24
+
25
+
**Step 1.** Log in and authenticate from the command line using the `spice login` command. A pop up browser window will prompt you to authenticate:
26
+
27
+
```bash
28
+
spice login
29
+
```
30
+
31
+
**Step 2.** Initialize a new project and start the runtime:
32
+
33
+
```bash
34
+
# Initialize a new Spice app
35
+
spice init spice_app
36
+
37
+
# Change to app directory
38
+
cd spice_app
39
+
40
+
# Start the runtime
41
+
spice run
42
+
```
43
+
44
+
**Step 3.** Configure the dataset:
45
+
46
+
In a new terminal window, configure a new dataset using the `spice dataset configure` command:
47
+
48
+
```bash
49
+
spice dataset configure
50
+
```
51
+
52
+
Enter a dataset name that will be used to reference the dataset in queries. This name does not need to match the name in the dataset source.
53
+
54
+
```bash
55
+
dataset name: (spice_app) eth_recent_blocks
56
+
```
57
+
58
+
Enter the description of the dataset:
59
+
60
+
```
61
+
description: Recent Ethereum blocks
62
+
```
63
+
64
+
Enter the location of the dataset:
65
+
66
+
```bash
67
+
from: spice.ai/eth.recent_blocks
68
+
```
69
+
70
+
Select `y` when prompted whether to accelerate the data:
71
+
72
+
```bash
73
+
Locally accelerate (y/n)? y
74
+
```
75
+
76
+
You should see the following output from your runtime terminal:
77
+
78
+
```bash
79
+
2024-02-21T22:49:10.038461Z INFO runtime: Loaded dataset: eth_recent_blocks
80
+
```
81
+
82
+
**Step 4.** In a new terminal window, use the Spice SQL REPL to query the dataset
83
+
84
+
```bash
85
+
spice sql
86
+
```
87
+
88
+
```bash
89
+
SELECT number, size, gas_used from eth_recent_blocks LIMIT 10;
90
+
```
91
+
92
+
The output displays the results of the query along with the query execution time:
93
+
94
+
```bash
95
+
+----------+--------+----------+
96
+
| number | size | gas_used |
97
+
+----------+--------+----------+
98
+
| 19281345 | 400378 | 16150051 |
99
+
| 19281344 | 200501 | 16480224 |
100
+
| 19281343 | 97758 | 12605531 |
101
+
| 19281342 | 89629 | 12035385 |
102
+
| 19281341 | 133649 | 13335719 |
103
+
| 19281340 | 307584 | 18389159 |
104
+
| 19281339 | 89233 | 13391332 |
105
+
| 19281338 | 75250 | 12806684 |
106
+
| 19281337 | 100721 | 11823522 |
107
+
| 19281336 | 150137 | 13418403 |
108
+
+----------+--------+----------+
109
+
110
+
Query took: 0.004057791 seconds
111
+
```
112
+
113
+
You can experiment with the time it takes to generate queries when using non-accelerated datasets. You can change the acceleration setting from `true` to `false` in the datasets.yaml file.
0 commit comments