Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node API #445

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
37b180b
doc: deprecation notice
jcstein Feb 3, 2023
9a68d94
doc: demo API docs in markdown
jcstein Feb 3, 2023
de164bd
style: add example with toggles
jcstein Feb 3, 2023
43eda4c
style: adding tsx page for demo purposes
jcstein Feb 3, 2023
d9a0373
disable md013
jcstein Feb 3, 2023
b35a055
adding prototype without styling
distractedm1nd Feb 6, 2023
a9f7c6d
feat: installing tailwind, moving node-spec to different file
distractedm1nd Feb 14, 2023
f10d6e1
remove extra CSS
jcstein Feb 14, 2023
4acf342
doc: remove initial markdown demo page
jcstein Feb 17, 2023
a9a9185
add markdown version of tsx page
jcstein Feb 21, 2023
6afd2f9
change to MDX
jcstein Feb 22, 2023
b520353
put tsx page into mdx page
jcstein Feb 22, 2023
95cf58c
change page title to "Node API docs"
jcstein Feb 22, 2023
46abaae
doc: add overview for API docs & draft of tutorial
jcstein Feb 22, 2023
984034a
doc: add draft of Gateway API doc page
jcstein Feb 22, 2023
6cc1903
Update node-gateway-docs.mdx
jcstein Feb 22, 2023
183aaba
isolate which page has tailwind styling applied
jcstein Feb 22, 2023
210e746
style: partial dark mode support
jcstein Feb 22, 2023
fa6d4b9
separate tailwind and custom .css files
jcstein Feb 22, 2023
e42bb75
rename pages to original names
jcstein Feb 23, 2023
013af3d
swap to md
jcstein Feb 23, 2023
5d7544d
Merge branch 'main' into jcs.node-api-updates
jcstein Feb 23, 2023
9e856e5
Update node-api-docs.tsx
jcstein Feb 23, 2023
500df72
Merge branch 'jcs.node-api-updates' of https://github.com/celestiaorg…
jcstein Feb 23, 2023
d3ced35
linting
jcstein Feb 23, 2023
bdb3e7f
Update node-gateway-docs.mdx
jcstein Feb 23, 2023
4887ed0
remove tailwind in docusaurus.config
jcstein Feb 24, 2023
dbb83f2
Merge branch 'main' into jcs.node-api-updates
jcstein Feb 24, 2023
11cafb5
add postcss-nested
jcstein Feb 24, 2023
f59b345
linting
jcstein Feb 24, 2023
a1cccaf
comments
jcstein Feb 24, 2023
929ceb5
test `all: unset;`
jcstein Feb 24, 2023
4570188
edit font type for categories
jcstein Feb 24, 2023
dd05d6d
add note
jcstein Feb 24, 2023
90c0ba1
test prefix
jcstein Mar 1, 2023
1e8151d
hook working, partial tw styling applied
jcstein Mar 1, 2023
aeaf635
tailwind styling applied to one component
jcstein Mar 1, 2023
3ef53c1
update node spec
renaynay Mar 2, 2023
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
57 changes: 57 additions & 0 deletions docs/developers/node-api-tutorial.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
sidebar_label: Node API tutorial
---

# Node API tutorial

This tutorial will teach you how to interact with a node's API.

First, [install celestia-node](../../nodes/light-node).

Initalize your node:

```bash
celestia <node_type> init --p2p.network <network>
```

Start your node:

```bash
celestia <node_type> start --p2p.network <network>
```

## cURL section

In another terminal instance, run the following command to generate the JWT auth token
and set it as a variable:

```bash
# make sure to add network flags if you're using a network other than the default
# auth level can be any of the following [read || write || admin]

export AUTH_TOKEN=$(celestia <node_type> auth <auth level>)
```

You'll also need the port that is exposed on your node, by default it is 26658.

To view the CLI menu:
```bash
celestia light auth -h
```

```bash
# returns the node's SamplingStats

curl -X POST -H 'Authorization: Bearer '$AUTH_TOKEN'' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":0,"method":"das.SamplingStats","params":[]}' http://localhost:26658/ | jq
```

```bash
# returns the node's chain head

curl -X POST -H 'Authorization: Bearer '$AUTH_TOKEN'' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":0,"method":"header.Head","params":[]}' http://localhost:26658/ | jq
```

## Go dev section
- link to Rene's repo
- README with explanation & comments in Go files
- what is necessary to communicate for how to interact with your node with Go
Loading