Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
Add Optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
akegaviar committed Jan 26, 2023
1 parent 12fc9ab commit ee443c0
Show file tree
Hide file tree
Showing 7 changed files with 823 additions and 17 deletions.
46 changes: 29 additions & 17 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ module.exports = {
'/operations/arbitrum/tools',
]
},
{
title: 'Optimism',
collapsable: true,
children: [
'/operations/optimism/',
'/operations/optimism/networks',
'/operations/optimism/types',
'/operations/optimism/modes',
'/operations/optimism/debug-and-trace-apis',
'/operations/optimism/tools',
]
},
{
title: 'NEAR',
collapsable: true,
Expand Down Expand Up @@ -209,6 +221,16 @@ module.exports = {
'/operations/cronos/tools',
]
},
{
title: 'Filecoin',
collapsable: true,
children: [
'/operations/filecoin/',
'/operations/filecoin/networks',
'/operations/filecoin/types',
'/operations/filecoin/tools',
]
},
{
title: 'Fantom',
collapsable: true,
Expand All @@ -221,16 +243,6 @@ module.exports = {
'/operations/fantom/tools',
]
},
{
title: 'Filecoin',
collapsable: true,
children: [
'/operations/filecoin/',
'/operations/filecoin/networks',
'/operations/filecoin/types',
'/operations/filecoin/tools',
]
},
{
title: 'StarkNet',
collapsable: true,
Expand Down Expand Up @@ -432,19 +444,19 @@ module.exports = {
]
},
{
title: 'Fantom',
title: 'Filecoin',
collapsable: true,
children: [
'/tutorials/fantom/',
'/tutorials/fantom/erc-721-collection-contract-with-truffle-and-openzeppelin',
'/tutorials/filecoin/',
'/tutorials/filecoin/deploy-an-erc20-token-on-filecoin-with-hardhat',
]
},
{
title: 'Filecoin',
title: 'Fantom',
collapsable: true,
children: [
'/tutorials/filecoin/',
'/tutorials/filecoin/deploy-an-erc20-token-on-filecoin-with-hardhat',
'/tutorials/fantom/',
'/tutorials/fantom/erc-721-collection-contract-with-truffle-and-openzeppelin',
]
},
{
Expand Down Expand Up @@ -796,8 +808,8 @@ module.exports = {
'/blockchains/aptos',
'/blockchains/gnosis',
'/blockchains/cronos',
'/blockchains/fantom',
'/blockchains/filecoin',
'/blockchains/fantom',
'/blockchains/starknet',
'/blockchains/harmony',
'/blockchains/tezos',
Expand Down
15 changes: 15 additions & 0 deletions docs/operations/optimism/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
meta:
- name: description
content: Learn what Optimism networks you can deploy your nodes on, how to connect to your Optimism node.
- name: keywords
content: optimism node deploy rollup
---

# Introduction

This section outlines the fundamentals of and operations for Optimism.

Deploying an Optimism node with Chainstack provides you with a near-instantly fully synchronized Optimism node.

Learn about [the supported networks](/operations/optimism/networks), [full and archive node modes](/operations/optimism/modes), and how to [interact with your node](/operations/optimism/tools).
48 changes: 48 additions & 0 deletions docs/operations/optimism/debug-and-trace-apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
meta:
- name: description
content: Learn what the debug and trace APIs are and how to trace transactions on Optimism.
- name: keywords
content: optimism debug trace namespace transaction api geth
---

# Debug and trace APIs

A dedicated Optimism full or archive node has the `debug_*` API methods enabled. For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/rpc/ns-debug).

## Usage examples

You can debug and trace transactions by replaying them in the Ethereum Virtual Machine to get the execution details in the exact same way as they happened on the chain.

Note that to debug and trace transactions, you need to have historical states on the node. Optimism full nodes keep historical states for the immediately previous 128 blocks. Optimism archive nodes keep historical states for the entire chain.

### debug_traceBlockByNumber

Trace all transactions included in a block with [debug_traceBlockByNumber](https://geth.ethereum.org/docs/rpc/ns-debug#debug_traceblockbynumber):

``` sh
curl -H "Content-Type: application/json" -d '{"id": 1, "method": "debug_traceBlockByNumber", "params": ["BLOCK_NUMBER", {"tracer": "callTracer"}]}' ENDPOINT
```

where

* BLOCK_NUMBER — the number of the block in hex to get the traces of included transactions.
* ENDPOINT — your node HTTPS endpoint.

See [View node access and credentials](/platform/view-node-access-and-credentials).

For example, trace all smart contract interactions in block 21972089:

``` sh
curl -H "Content-Type: application/json" -d '{"id": 1, "method": "debug_traceBlockByNumber", "params": ["0x14F4479", {"tracer": "callTracer"}]}' https://nd-123-456-789.p2pify.com/3c6e0b8a9c15224a8228b9a98ca1531d
```

::: tip See also

* [EVM opcodes](https://ethereum.org/en/developers/docs/evm/opcodes)
* [Geth: debug namespace](https://geth.ethereum.org/docs/rpc/ns-debug)
* [Modes](/operations/optimism/modes)
* <a href="https://support.chainstack.com/hc/en-us/articles/900003400806-Tracing-EVM-transactions" target="_blank">Tracing EVM transactions</a>
* <a href="https://chainstack.com/evm-nodes-a-dive-into-the-full-vs-archive-mode/" target="_blank">EVM nodes: A dive into the full vs. archive mode </a>

:::
39 changes: 39 additions & 0 deletions docs/operations/optimism/modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
meta:
- name: description
content: Learn the difference between an Optimism full node and an Optimism archive node. Run sample commands to see the difference.
- name: keywords
content: optimism node full archive difference
---

# Modes

Chainstack supports deploying an Optimism node on the mainnet in the following modes:

* Full node — a node that stores full blockchain data.
* Archive node — a node that stores full blockchain data and an archive of historical states.

To be a part of the Optimism mainnet, you can deploy either a full node or an archive node.

With a full node, you can query the historical state of the Optimism mainnet at only the latest 128 blocks.

To be able to query the historical state of the Optimism mainnet at any block, you need an archive node.

See [Geth JSON-RPC methods](https://eth.wiki/json-rpc/API#the-default-block-parameter) that support querying at a block number.

Query example to get the balance of an address at different block numbers through an archive node:

``` js
> eth.getBalance("0x06908fdbe4a6af2be010fe3709893fb2715d61a6","latest")
187186839646605076
> eth.getBalance("0xc94770007dda54cF92009BFF0dE90c06F603a09f","4644316")
197218339647724796
```

::: tip See also

* [Networks](/operations/optimism/networks)
* [Tools](/operations/optimism/tools)
* [Tutorials](/tutorials/optimism/)

:::
22 changes: 22 additions & 0 deletions docs/operations/optimism/networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
meta:
- name: description
content: Deploy a public Optimism node on mainnet or Goerli testnet with Chainstack in seconds.
- name: keywords
content: optimism mainnet goerli testnet node
---

# Networks

Chainstack supports joining the following Optimism networks:

* Mainnet — public Optimism mainnet.
* Goerli testnet — a proof-of-stake public Optimism testnet.

::: tip See also

* [Modes](/operations/optimism/modes)
* [Tools](/operations/optimism/tools)
* [Tutorials](/tutorials/optimism/)

:::
Loading

0 comments on commit ee443c0

Please sign in to comment.