Skip to content

Commit

Permalink
various minor updates (#33)
Browse files Browse the repository at this point in the history
* various minor updates

* icons
  • Loading branch information
metachris authored Nov 3, 2023
1 parent 36a48bb commit 990dc31
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 37 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern

Use Node.js v18+

```bash
# check out git submodules
git submodule init
git submodule update
```

Note: if you want to install the node packages from within a Docker container (recommended for security), then you can start it like this:

```sh
```bash
docker run -p 3000:3000 --name suave-docs --rm -it -w /mnt -v $(pwd):/mnt node:20 /bin/bash

# shortcut:
Expand Down Expand Up @@ -50,3 +56,11 @@ This command generates static content into the `build` directory and can be serv
## Deployment

The docs use Vercel for hosting, and deployment is done by Vercel on any merge into the main branch.

## Icons

If you want to use icons, best copy the SVG from one of these:

- https://feathericons.com/
- https://boxicons.com/
- https://icons.getbootstrap.com/
13 changes: 7 additions & 6 deletions docs/how-to/run-suave/build-yourself.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ If you'd like to run the suave-geth binaries yourself, this is the guide for you

### What you need

1. [Install go](https://go.dev/doc/install).
1. [Install Golang](https://go.dev/doc/install)

### What to do

1. Clone the repo and build SUAVE:
Clone the repo and build SUAVE:
```bash
git clone https://github.com/flashbots/suave-geth.git
cd suave-geth
make suave
```
2. Run this command:

Run this command:
```bash
./build/bin/suave --suave.dev
```

### What to do next

In another terminal, you can run:
Test your node by deploying a contract and sending it some transactions:

```bash
go run suave/devenv/cmd/main.go
Expand Down Expand Up @@ -92,7 +93,7 @@ It should tell you the block height of your local network.
### Troubleshooting

<details>
<summary>1. Go permission errors</summary>
<summary>Go permission errors</summary>
<div>
<div>
<div>
Expand All @@ -109,7 +110,7 @@ It should tell you the block height of your local network.
</div>
</details>
<details>
<summary>2. Missing packages</summary>
<summary>Missing packages</summary>
<div>
<div>
<div>
Expand Down
22 changes: 11 additions & 11 deletions docs/how-to/run-suave/with-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ If you'd like to run SUAVE in Docker, this is the guide for you.

### What you need

1. Install and start Docker. You can find general directions [here](https://docs.docker.com/get-docker/).
1. If you're running Ubuntu or Debian, we recommend [this specific guide](https://docs.docker.com/engine/install/ubuntu/#installation-methods).
2. Make sure you have `docker-compose` installed too. The should just happen when you install Docker.
1. Check with `docker-compose version` (Docker Engine) or `docker compose version` (Docker Desktop).
3. We do not have high RAM, disk, or bandwidth requirements. This section should work on most consumer laptops.
1. [Install and start Docker](https://docs.docker.com/get-docker/).
2. Make sure you have `docker-compose` installed too, which should be part of the regular Docker setup (check with `docker compose version` or `docker-compose version`).

### What to do

1. Clone suave-geth:
Clone suave-geth:
```bash
git clone https://github.com/flashbots/suave-geth.git
```
2. Get to the right place in the repo:

Get to the right place in the repo:
```bash
cd suave-geth/
```
3. Run SUAVE:

Run SUAVE:
```bash
make devnet-up
```
Expand All @@ -53,10 +52,11 @@ make devnet-up

### Testing transactions

4. Test your node by deploying a contract and sending it some transactions:
Test your node by deploying a contract and sending it some transactions:
```bash
go run suave/devenv/cmd/main.go
```

You should see something like the below printed to your terminal (addresses, txns, and ids will differ):
```bash
suave-geth$ go run suave/devenv/cmd/main.go
Expand All @@ -82,7 +82,7 @@ make devnet-down
### Troubleshooting

<details>
<summary>2. Docker not running</summary>
<summary>Docker not running</summary>
<div>
<div>
<div>
Expand All @@ -103,7 +103,7 @@ make devnet-down
</div>
</details>
<details>
<summary>3. Unsupported version</summary>
<summary>Unsupported version</summary>
<div>
<div>
<div>
Expand Down
14 changes: 7 additions & 7 deletions docs/how-to/send-transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In either case, you can cause a series of transactions to occur by running:
go run suave/devenv/cmd/main.go
```

[[🔗source](https://github.com/flashbots/suave-geth/blob/main/suave/devenv/cmd/main.go)]
[[🔗source](https://github.com/flashbots/suave-geth/blob/main/suave/devenv/cmd/main.go)]

This guide will show you how to craft such transactions yourself.

Expand All @@ -43,7 +43,7 @@ Returns the list of available addresses in the Kettle to execute the confidentia

The [SUAVE SDK](https://github.com/flashbots/suave-geth/blob/main/suave/sdk/sdk.go) makes it easy to interact with the extended RPC and we will be using it in this guide.

## 1. Fund a local account
## Fund a local account

Create a new file in `suave/devenv/cmd` called `transactions.go`:

Expand Down Expand Up @@ -116,7 +116,7 @@ func fundAccount(clt *sdk.Client, to common.Address, value *big.Int) error {
return nil
}

// General types and methods we need for the above to work as we want it to,
// General types and methods we need for the above to work as we want it to,
// nothing SUAVE specific
type privKey struct {
priv *ecdsa.PrivateKey
Expand Down Expand Up @@ -151,7 +151,7 @@ go run suave/devenv/cmd/transactions.go

The important parts to note are the `SendTransaction` method, and the way the balance of a given account is fetched via the `RPC()` method, both available in the SDK. Using this pattern, you should be able to send most of the transactions you wish to, as well as fetch information about other accounts or transactions as is necessary.

## 2. Deploy a contract
## Deploy a contract

We've written a number of example smart contracts to help get you started thinking about what's possible. For this guide, we'll stick to deploying one of these examples to keep things simple.

Expand Down Expand Up @@ -234,13 +234,13 @@ go run suave/devenv/cmd/deploy.go

You should see the address of your new example contract printed in the terminal.

The important parts to note when deploying contracts are the call to [`e2e`](https://github.com/flashbots/suave-geth/blob/main/suave/e2e/contracts.go), which helps generate ABIs and bytecode for contracts, and the `sdk.DeplyContract` and `sdk.GetContract`.
The important parts to note when deploying contracts are the call to [`e2e`](https://github.com/flashbots/suave-geth/blob/main/suave/e2e/contracts.go), which helps generate ABIs and bytecode for contracts, and the `sdk.DeplyContract` and `sdk.GetContract`.

If you're able to generate the necessary ABIs and bytecode, you should be able to deploy any contract you like using the above pattern.

## 3. Use Rigil Testnet RPC
## Use Rigil Testnet RPC

You can also adapt any of this code to use the Rigil Testnet RPC, rather than your local development environment.
You can also adapt any of this code to use the Rigil Testnet RPC, rather than your local development environment.

1. Request [faucet funds here](https://faucet.rigil.suave.flashbots.net).
2. Change this code:
Expand Down
12 changes: 9 additions & 3 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ keywords:

<div class="warning">

SUAVE is in alpha. We are currently on our first testnet, called Rigil. All software is liable to change often. There are no guarantees that your data will persist, or that it is fully confidential, or that it is secure. Proceed with caution.
SUAVE is currently in early alpha state. The first testnet is called Rigil.
Please be aware that your data will likely not persist or that it is fully confidential or secure.
Happy hacking!

</div>

Expand Down Expand Up @@ -98,7 +100,9 @@ If you'd like to discuss ideas for SUAVE or begin contributing, you can find us
<a href="https://collective.flashbots.net/c/suave/27" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M20 10.07C17.2527 7.60561 13.6907 6.24492 10 6.25002C8.24667 6.25002 6.56333 6.55002 5 7.10335V30.8533C6.60603 30.2867 8.29694 29.9981 10 30C13.8417 30 17.3467 31.445 20 33.82M20 10.07C22.7472 7.60547 26.3093 6.24476 30 6.25002C31.7533 6.25002 33.4367 6.55002 35 7.10335V30.8533C33.394 30.2867 31.7031 29.9981 30 30C26.3093 29.9949 22.7473 31.3556 20 33.82M20 10.07V33.82" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="black" class="bi bi-chat-heart" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M2.965 12.695a1 1 0 0 0-.287-.801C1.618 10.83 1 9.468 1 8c0-3.192 3.004-6 7-6s7 2.808 7 6c0 3.193-3.004 6-7 6a8.06 8.06 0 0 1-2.088-.272 1 1 0 0 0-.711.074c-.387.196-1.24.57-2.634.893a10.97 10.97 0 0 0 .398-2Zm-.8 3.108.02-.004c1.83-.363 2.948-.842 3.468-1.105A9.06 9.06 0 0 0 8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6a10.437 10.437 0 0 1-.524 2.318l-.003.011a10.722 10.722 0 0 1-.244.637c-.079.186.074.394.273.362a21.673 21.673 0 0 0 .693-.125ZM8 5.993c1.664-1.711 5.825 1.283 0 5.132-5.825-3.85-1.664-6.843 0-5.132Z"/>
</svg>
</div>
<div class="introText">
<div class="introHeading">
Expand All @@ -113,7 +117,9 @@ If you'd like to discuss ideas for SUAVE or begin contributing, you can find us
<a href="https://github.com/flashbots/suave-geth/blob/main/CONTRIBUTING.md" class="introLink">
<div class="introBlock">
<div class="introImage">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none"><path d="M13.75 11.25H33.75M13.75 20H33.75M13.75 28.75H33.75M6.25 11.25H6.26167V11.2633H6.25V11.25ZM6.875 11.25C6.875 11.4158 6.80915 11.5747 6.69194 11.6919C6.57473 11.8092 6.41576 11.875 6.25 11.875C6.08424 11.875 5.92527 11.8092 5.80806 11.6919C5.69085 11.5747 5.625 11.4158 5.625 11.25C5.625 11.0842 5.69085 10.9253 5.80806 10.8081C5.92527 10.6908 6.08424 10.625 6.25 10.625C6.41576 10.625 6.57473 10.6908 6.69194 10.8081C6.80915 10.9253 6.875 11.0842 6.875 11.25ZM6.25 20H6.26167V20.0133H6.25V20ZM6.875 20C6.875 20.1658 6.80915 20.3247 6.69194 20.4419C6.57473 20.5592 6.41576 20.625 6.25 20.625C6.08424 20.625 5.92527 20.5592 5.80806 20.4419C5.69085 20.3247 5.625 20.1658 5.625 20C5.625 19.8342 5.69085 19.6753 5.80806 19.5581C5.92527 19.4408 6.08424 19.375 6.25 19.375C6.41576 19.375 6.57473 19.4408 6.69194 19.5581C6.80915 19.6753 6.875 19.8342 6.875 20ZM6.25 28.75H6.26167V28.7633H6.25V28.75ZM6.875 28.75C6.875 28.9158 6.80915 29.0747 6.69194 29.1919C6.57473 29.3092 6.41576 29.375 6.25 29.375C6.08424 29.375 5.92527 29.3092 5.80806 29.1919C5.69085 29.0747 5.625 28.9158 5.625 28.75C5.625 28.5842 5.69085 28.4253 5.80806 28.3081C5.92527 28.1908 6.08424 28.125 6.25 28.125C6.41576 28.125 6.57473 28.1908 6.69194 28.3081C6.80915 28.4253 6.875 28.5842 6.875 28.75Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="black" class="bi bi-github" viewBox="0 0 16 16">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
</svg>
</div>
<div class="introText">
<div class="introHeading">
Expand Down
6 changes: 3 additions & 3 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},
{
type: 'category',
label: '🥷 How To',
label: '🛠️ How To',
collapsed: false,
link: { type: 'doc', id: 'how-to/index' },
items: [
Expand Down Expand Up @@ -40,11 +40,11 @@ module.exports = {
link: { type: 'doc', id: 'technical/README' },
items: [
'technical/specs/rigil/README',
'technical/specs/rigil/suave-chain',
'technical/specs/rigil/kettle',
'technical/specs/rigil/mevm',
'technical/specs/rigil/precompiles',
'technical/specs/rigil/confidential-data-store',
'technical/specs/rigil/kettle',
'technical/specs/rigil/suave-chain',
],
},
// {
Expand Down
11 changes: 5 additions & 6 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'flashbots',
projectName: 'docs',
organizationName: 'flashbots',
projectName: 'docs',
url: process.env.TARGET_URL,
markdown: {
mermaid: true,
Expand All @@ -29,7 +29,7 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");
crossorigin: 'anonymous',
},
],
themeConfig:
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: {
Expand Down Expand Up @@ -65,7 +65,7 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");
},
],
}

}),
presets: [
[
Expand All @@ -76,8 +76,7 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");
sidebarPath: require.resolve('./docs/sidebars.js'),
// Please change this to your repo.
routeBasePath: '/',
// editUrl:
// 'https://github.com/flashbots/docs/edit/main/',
editUrl: "https://github.com/flashbots/suave-docs/edit/main/",
remarkPlugins: [math],
rehypePlugins: [katex],
},
Expand Down

0 comments on commit 990dc31

Please sign in to comment.