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

📝 Docs: Update docs #1495

Merged
merged 4 commits into from
Nov 30, 2024
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
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@

# tevm-monorepo

Tevm tools include an Ethereum devnet that can run in the Browser and Node.js along with a solidity bundler that allows you to import solidity directly into TypeScript files. All built on top of the viem API.
Tevm enables next generation UX for users while providing delightful DX for developers. It's like sticking an RPC node in your web app and making Solidity contracts a first class citizen.

Some things you can do with Tevm.

- Estimate gas with no loading spinners
- Remove latency from many JSON-RPC requests
- Add optimistic updates to your UI
- Run arbitrary solidity code in the browser for code reuse
- Cut latency of some calls in half with a typesafe scripting api
- Use JSON-RPC methods like debug_traceCall even if the underlying RPC does not support it
- And much more

Here is a code example of what Tevm looks like

```typescript
// import solidity directly into typescript
import { ERC20 } from '@openzeppelin/contracts/token/ERC20/ERC20.sol'
import { createMemoryClient, http } from 'tevm'
import { optimism } from 'tevm/common'
Expand All @@ -33,6 +44,8 @@ const balance = await client.readContract(
)
```

Tevm is able to fork a network similar to anvil in the browser and execute contract calls. You will also notice Tevm Bundler allows us to import contract abis directly from solidity contracts. These powerful primitives are the key to Tevm.

## [Join Telegram](https://t.me/+ANThR9bHDLAwMjUx)

## Visit [Docs (under heavy construction)](https://tevm.sh/) for docs, guides, API, and more! 📄
Expand Down
100 changes: 84 additions & 16 deletions docs/astro.sidebar.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
import { typeDocSidebarGroup } from 'starlight-typedoc'

export const sidebarConfig = [
{
"label": "Getting started guide",
"link": "/getting-started/getting-started/"
},
{
"label": "Why",
"label": "Why?",
"items": [
{
"label": "Slow waterfall calls",
"link": "/why/avoid-waterfalls/"
"label": "Why Tevm",
"link": "/why/"
},
{
"label": "Advanced gas estimation",
"link": "/why/advanced-gas-estimation/"
},
{
"label": "Slow waterfall calls",
"link": "/why/avoid-waterfalls/"
},
{
"label": "Reuse solidity",
"link": "/why/reuse-solidity/"
},
{
"label": "Optimistic UI",
"link": "/why/optimistic-updates/"
},
{
"label": "Writing tests",
"link": "/why/writing-tests/"
Expand All @@ -22,23 +36,80 @@ export const sidebarConfig = [
"label": "Writing UI in solidity",
"link": "/why/write-ui-in-solidity/"
},
]
},
{
"label": "TevmNode",
"items": [
{
"label": "Optimistic UI",
"link": "/why/reuse-solidity/"
"label": "Overview",
"link": "/learn/tevm-node/"
},
{
"label": "Why Tevm",
"link": "/why/"
"label": "TevmNode api",
"link": "/learn/tevm-node/installation/"
},
{
"label": "Optimistic UI",
"link": "/why/optimistic-updates/"
"label": "Actions",
"link": "/learn/actions/"
},
{
"label": "Tevm clients guide",
"link": "/learn/viem/"
},
{
"label": "Cli",
"link": "/learn/cli/"
},
{
"label": "JSON-RPC",
"link": "/learn/json-rpc/"
},
{
"label": "Contract action creators",
"link": "/learn/contracts/"
},
{
"label": "Vm component",
"link": "/learn/tevm-node/vm/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/txpool/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/create-tevm-node/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/receipts-manager/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/filters/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/copying-or-forking/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/using-jsonrpc/"
},
{
"label": "Advanced scripting guide",
"link": "/learn/scripting/"
}
]
},
{
"label": "Learn",
"label": "TevmNode",
"items": [
{
"label": "TevmNode api",
"link": "/learn/tevm-node/installation/"
},
{
"label": "Bundler Guide",
"link": "/learn/solidity-imports/"
Expand Down Expand Up @@ -69,13 +140,9 @@ export const sidebarConfig = [
"link": "/learn/contracts/"
},
{
"label": "TevmNode api",
"label": "Vm component",
"link": "/learn/tevm-node/vm/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/installation/"
},
{
"label": "TevmNode api",
"link": "/learn/tevm-node/txpool/"
Expand Down Expand Up @@ -109,5 +176,6 @@ export const sidebarConfig = [
"link": "/learn/scripting/"
}
]
}
},
typeDocSidebarGroup
]
20 changes: 19 additions & 1 deletion docs/src/content/docs/learn/tevm-node/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ description: Using TevmNode from `tevm/node` package
---
# TevmNode

A lightweight performant JavaScript native Ethereum Virtual Machine (EVM) enabling next-generation local-first UX for end users.
A lightweight performant JavaScript native Ethereum Virtual Machine (EVM) Node that runs in Node.js and the Browser.


```typescript
import {createTevmNode} from 'tevm'

const node = createTevmNode()
```

## Why run an ethereum node in the browser

There are many reasons to want to run an Ethereum Node in the browser. Use cases include:

- Advanced gas estimation use cases
- Better ux via improved latency vs making remote RPC requests
- Access to low level control
- Optimistic updates
- Reusing solidity
- More!

## Summary

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions docs/src/content/docs/reference/@tevm/actions/globals.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading