Skip to content

Commit

Permalink
Merge branch 'main' into fee_recipient
Browse files Browse the repository at this point in the history
  • Loading branch information
zengzengzenghuy committed Apr 4, 2023
2 parents 59b5d60 + 3a8484c commit f0a49e9
Show file tree
Hide file tree
Showing 15 changed files with 303 additions and 54 deletions.
80 changes: 80 additions & 0 deletions docs/developers/interact/dynamic.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
description: Dynamic is a powerful web3 auth developer platform with built-in support for Gnosis Chain. It lets you integrate multiple wallets such as Coinbase Wallet, Metamask, and more into your app or website, handles network switching, multi-wallet linking and more. This guide will show you how to use Gnosis Chain with Dynamic.
keywords: [dynamic, wagmi, tools, front end, development, dapps]
---

# Using Dynamic

[Dynamic](https://www.dynamic.xyz/) is a powerful web3 auth developer platform with built-in support for Gnosis Chain. It lets you integrate multiple wallets such as Coinbase Wallet, Metamask, and more into your app or website, handles network switching, multi-wallet linking and more.

Dynamic comes with Gnosis Chain built-in. You can play around with a live demo of Dynamic [here](https://demo.dynamic.xyz/) and see a full video walkthrough [here](https://www.dynamic.xyz/product-walkthrough). In this tutorial, we'll go through how to set up Dynamic with Gnosis Chain.

You can see a CodeSandbox of the example below [here](https://codesandbox.io/s/dynamic-gnosis-chain-demo-vzps4b) (configured to Gnosis Chain).

## Prerequisites

Dynamic works with React today. You can go through the standard getting started guide [here](https://docs.dynamic.xyz/docs/getting-started-with-dynamic).

## Step 1: Create a Dynamic account

1. [Sign up](https://app.dynamic.xyz) to get an environment ID

2. Create an organization and a set up your first project

3. Copy your `environmentID` from the Dynamic overview page

4. (optional) <a href="doc:security" target="_blank"> Configure your site's CORS origins</a>

## Step 2: Install the Dynamic npm package

You can install Dynamic's SDK with either `yarn` or `npm`. We currently support React and NextJS.

```shell
npm install @dynamic-labs/sdk-react
# or yarn add @dynamic-labs/sdk-react
```



## Step 3: Configure the SDK

Copy the following snippet into your project and paste in your environmentId:

```javascript
import { DynamicContextProvider, DynamicWidget} from '@dynamic-labs/sdk-react';

const App = () => (
<DynamicContextProvider
settings={{
environmentId: 'ID'
}}>
<DynamicWidget />
</DynamicContextProvider>
);

export default App;
```



## Step 4: Turn on Gnosis Chain in your developer dashboard

Now that we have the basic Dynamic setup, you can go to your developer dashboard, and select `configurations` from the left menu. Next, click on the `EVM` card and toggle `Gnosis` on. Note that you can also chose to toggle the default network, `Ethereum`, off.

<img width="600" alt="Gnosis_new" src="https://user-images.githubusercontent.com/1596208/228478128-925acb34-1f5d-45a5-bd2a-c6467af265a7.png" />



## See it in action

Now that you put things together, you can see a CodeSandbox of the finished product [here](https://codesandbox.io/s/dynamic-gnosis-chain-demo-vzps4b).

## Next steps

Now that you set up Dynamic with **Gnosis Chain**, there are many additional things you can explore:

- **Log in with your wallet, and see data in Dynamic's developer dashboard** - Now that your widget is set up locally, try to log in with a wallet. As soon as you do, head over to the Dynamic developer dashboard and click on user management and analytics. You'll be able to see your user show up!
- **Customize your SDK design** - There are many ways to customize the Dynamic modal to fit your needs (you can explore them in the SDK configuration section), but to start, we suggest setting a light/dark mode and a primary color for the modal, which you can do in the design section of your developer dashboard.
- **Explore how to use the Dynamic SDK** - After your users connect their wallets, you'll want to interact with them for various reasons. You can read more about the SDK in [Dynamic's docs](https://docs.dynamic.xyz).

For support, you can also join [Dynamic's Slack Community](https://www.dynamic.xyz/slack).
27 changes: 21 additions & 6 deletions docs/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ However, a censorship-resistant, decentralized network should not rely on cloud

Gnosis clients can run on your computer, laptop, server, or even a single-board computer. While running clients on your personal computer is possible, having a dedicated machine just for your node can significantly enhance its performance and security while minimizing the impact on your primary computer.

Using your own hardware can be very easy. There are many simple options as well as advanced setups for more technical people. So let's look into the requirements and means for running Ethereum clients on your machine.
Using your own hardware can be very easy. There are many simple options as well as advanced setups for more technical people. So let's look into the requirements and means for running Gnosis clients on your machine.

#### **Requirements** ####
Hardware requirements differ by client but generally are not that high since the node just needs to stay synced. Don't confuse it with mining, which requires much more computing power. Sync time and performance do improve with more powerful hardware however.

Before installing any client, please ensure your computer has enough resources to run it. You can find the minimum and recommended requirements below.

The bottleneck for your hardware is mostly disk space. Syncing the Ethereum blockchain is very input/output intensive and requires a lot of space. It is best to have a solid-state drive (SSD) with hundreds of GBs of free space to spare even after the synchronization.
The bottleneck for your hardware is mostly disk space. Syncing the Gnosis blockchain is very input/output intensive and requires a lot of space. It is best to have a solid-state drive (SSD) with hundreds of GBs of free space to spare even after the synchronization. Refer to [this post](https://gist.github.com/yorickdowne/f3a3e79a573bf35767cd002cc977b038) for good and bad SSD model.

The size of the database and speed of the initial synchronization depends on the chosen client, its configuration and sync strategy.

Expand Down Expand Up @@ -122,6 +122,21 @@ Requirements vary client to client, for more detail see the associated system re

Check out [Rocketpool's excellent guide](https://docs.rocketpool.net/guides/node/local/hardware.html) that explains hardware requirements for running a node.

**Gnosis in Ethereumverse**

Running a Gnosis node requires no different hardware configuration from other nodes in Ethereum universe.

[Ethereum on ARM](https://twitter.com/EthereumOnARM/status/1641374712348409859) demonstrates that it is possible to run a Gnosis, Ethereum, Starknet, and Arbitrum node using the same hardware configuration with less than $400 per node. (March 2023)

| Hardware | Price (USD) |
|------------------------------------|-------------|
| [Rock 5B board(16GB)](https://twitter.com/theradxa) | $189 |
| Acrylic case with passive heatsink | $13 |
| Crucial P2 NVMe SSD 2TB | $140 |
| MicroSD | $8 |
| Ethernet cable | $6 |
| Power supply | $9 |

### Network Connectivity

Running a node requires a reliable internet connection, as nodes are constantly exchanging data across the peer-to-peer network. Brief offline periods will result in [small inactivity penalties](./rewards-penalties), but this will typically be recouped quickly as long as the outage is short.
Expand Down Expand Up @@ -189,7 +204,7 @@ Here are the release pages of clients where you can find their pre-built binarie
Client diversity is critical for consensus nodes running validators. If majority of validators is running a single client implementation, network security is at risk. It is therefore recommended to consider choosing a minority client.

#### **Verifying the software** ####
When downloading software from the internet, it's recommended to verify its integrity. This step is optional but especially with crucial infrastructure piece like the Ethereum client, it's important to be aware of potential attack vectors and avoid them. If you downloaded a pre-built binary, you need to trust it and risk that an attacker could swap the executable for a malicious one.
When downloading software from the internet, it's recommended to verify its integrity. This step is optional but especially with crucial infrastructure piece like the Gnosis client, it's important to be aware of potential attack vectors and avoid them. If you downloaded a pre-built binary, you need to trust it and risk that an attacker could swap the executable for a malicious one.

Developers sign released binaries with their PGP keys so you can cryptographically verify you are running exactly the software they created. You just need to obtain public keys used by developers, which can be found on client release pages or in documentation. After downloading the client release and its signature, you can use a PGP implementation, e.g. [GnuPG](https://gnupg.org/download/index.html) to easily verify them. Check out a tutorial on verifying open-source software using `gpg` on [linux](https://www.tecmint.com/verify-pgp-signature-downloaded-software/) or [Windows/MacOS](https://freedom.press/training/verifying-open-source-software/).

Expand All @@ -212,13 +227,13 @@ Other basic configuration options are, e.g. choosing a network - Mainnet or test
For testing purposes, you might prefer to run a client on Chiado testnet.

##### **Starting the execution client** #####
Before starting the Ethereum client software, perform a last check that your environment is ready. For example, make sure:
Before starting the Gnosis client software, perform a last check that your environment is ready. For example, make sure:

- There is enough disk space considering the chosen network and sync mode.
- Memory and CPU is not halted by other programs.
- Operating system is updated to the latest version.
- System has the correct time and date.
- Your router and firewall accept connections on listening ports. By default Ethereum clients use a listener (TCP) port and a discovery (UDP) port, both on 30303 by default.
- Your router and firewall accept connections on listening ports. By default Gnosis clients use a listener (TCP) port and a discovery (UDP) port, both on 30303 by default.

Run your client on a testnet first to help make sure everything is working correctly.

Expand Down Expand Up @@ -308,7 +323,7 @@ Before running Lighthouse, learn more on how to install and configure it in [Lig
```bash
teku \
--network gnosis \
--data-path "/data/ethereum" \
--data-path "/data/gnosis" \
--ee-endpoint http://localhost:8551 \
--ee-jwt-secret-file "/path/to/jwtsecret" \
```
Expand Down
8 changes: 2 additions & 6 deletions docs/node/guide/beacon/lighthouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import BeaconFolderStructurePartial from '@site/docs/node/guide/beacon/_partials

:::caution Version check

This page's content is up-to-date for [Lighthouse v3.3.0](https://github.com/sigp/lighthouse/releases/tag/v3.3.0).
This page's content is up-to-date for [Lighthouse v3.5.1](hhttps://github.com/sigp/lighthouse/releases/tag/v3.5.1).

:::

Expand Down Expand Up @@ -74,11 +74,7 @@ $ lighthouse bn

## Option 1: Run as a System Process

:::caution

In progress

:::
Refer to [Guide](../README.md#step-3-run-a-beacon-node)

## Option 2: Run using Docker

Expand Down
8 changes: 2 additions & 6 deletions docs/node/guide/beacon/lodestar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BeaconFolderStructurePartial from '@site/docs/node/guide/beacon/_partials
# Run Beacon Node: Lodestar

:::caution Version check
This page's content is up-to-date for [Lodestar v1.2.2](https://github.com/ChainSafe/lodestar/releases/tag/v1.2.2).
This page's content is up-to-date for [Lodestar v1.5.1](https://github.com/ChainSafe/lodestar/releases/tag/v1.5.1).
:::

:::caution Prerequisites
Expand Down Expand Up @@ -63,11 +63,7 @@ $ lodestar beacon

## Option 1: Run as a System Process

:::caution

In progress

:::
Refer to [Guide](../README.md#step-3-run-a-beacon-node)

## Option 2: Run using Docker

Expand Down
5 changes: 5 additions & 0 deletions docs/node/guide/beacon/nimbus.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ networks:
name: gnosis_net
```
Replace `suggested-fee-recipient` with your Gnosis address. This fee recipient address will receive tips from user transactions from the block the validator proposed. If not set, the tips will be sent to zero address, that is burnt competely. It is strongly recommended that you configure this value in your setup. Learn more about [suggested fee recipient](https://nimbus.guide/suggested-fee-recipient.html) flag in Nimbus docs.

Replace `graffiti` with your own [graffiti](https://nimbus.guide/graffiti.html). It is an optional field that can be used to add a message to the [block](https://ethereum.org/en/developers/docs/blocks/) by the proposer.


### 3. Start Containers

Start the consensus layer client listed in the compose file:
Expand Down
8 changes: 2 additions & 6 deletions docs/node/guide/beacon/teku.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import BeaconFolderStructurePartial from '@site/docs/node/guide/beacon/_partials

:::caution Version check

This page's content is up-to-date for [Teku v22.11.0](https://github.com/ConsenSys/teku/releases/tag/22.11.0).
This page's content is up-to-date for [Teku v23.3.0](https://github.com/ConsenSys/teku/releases/tag/23.3.0).

:::

Expand Down Expand Up @@ -65,11 +65,7 @@ $ teku

## Option 1: Run as a System Process

:::caution

In progress

:::
Refer to [Guide](../README.md#step-3-run-a-beacon-node)

## Option 2: Run using Docker

Expand Down
14 changes: 12 additions & 2 deletions docs/node/guide/execution/erigon.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ There are 2 main options for running Nethermind:
Create your folder structure:

```shell
mkdir -p /home/$USER/gnosis/jwtsecret
mkdir -p /home/$USER/gnosis/{jwtsecret,execution}
chown -R 1000:1000 /home/$USER/gnosis/execution
```

```
/home/$USER/gnosis/
|── execution/
└── jwtsecret/
```

Expand All @@ -41,11 +43,14 @@ Create a docker-compose file with your favorite text editor in `/home/$USER/gnos
version: "3"
services:
execution:
container_name: execution
image: thorax/erigon:devel
restart: unless-stopped
volumes:
- ./data:/home/erigon/.local/share/erigon
- /home/$USER/gnosis/execution:/home/erigon/.local/share/erigon
- /home/$USER/gnosis/jwtsecret/jwt.hex:/jwt:ro
networks:
- gnosis_net
ports:
- 30303:30303
- 30303:30303/udp
Expand All @@ -67,6 +72,7 @@ services:
--metrics.addr=0.0.0.0
--pprof
--pprof.addr=0.0.0.0
--pprof.port=6070
--authrpc.addr=0.0.0.0
--authrpc.jwtsecret=/jwt
--authrpc.vhosts=*
Expand All @@ -81,6 +87,10 @@ networks:
name: gnosis_net
```

:::tip Note
[By default](https://github.com/ledgerwatch/erigon#other-ports), `metrics` and `pprof` use the same port, 6060. Therefore, it is required to configure the port correctly if both options are enabled.
:::

### 3. JWT Secret

The JWT secret is a token that allows the EL client to communicate with the CL client, and is required for Nethermind to operate post-merge. We use `rand` to create a random string, and store the `jwt.hex` file in `/home/$USER/gnosis/jwtsecret/`.
Expand Down
4 changes: 1 addition & 3 deletions docs/node/guide/validator/run/lighthouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ The Validator requires a Consensus Client (also known as Beacon Node) in order t

## Option 1: Run as System Process {#system-process}

:::info
In progress
:::
Refer to [Guide](../../README.md#step-4-run-a-validator)

## Option 2: Run using Docker {#docker}

Expand Down
4 changes: 1 addition & 3 deletions docs/node/guide/validator/run/lodestar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ The Validator requires a Consensus Client (also known as Beacon Node) in order t

## Option 1: Run as System Process {#system-process}

:::info
In progress
:::
Refer to [Guide](../../README.md#step-4-run-a-validator)

## Option 2: Run using Docker {#docker}

Expand Down
4 changes: 1 addition & 3 deletions docs/node/guide/validator/run/teku.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ The Validator requires a Consensus client (also known as Beacon Node) in order t

## Option 1: Run as System Process {#system-process}

:::info
In progress
:::
Refer to [Guide](../../README.md#step-4-run-a-validator)

## Option 2: Run using Docker {#docker}

Expand Down
2 changes: 1 addition & 1 deletion docs/node/tools/dappnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ You are now ready to fund these validators and start validating.
### Step 4: Fund Your Validators

:::tip
In case you need some xDai for transaction fees you can get some from the [official xDai faucet for Gnosis](https://stakely.io/en/faucet/gnosis-chain-xdai).
In case you need some xDai for transaction fees you can get some from the [official xDai faucet for Gnosis](https://gnosisfaucet.com/).

:::

Expand Down
3 changes: 0 additions & 3 deletions docs/tools/faucets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ A faucet is a service that provides small amounts of [xDai tokens](/about/tokens

## Community Faucets

- [Gimlu](https://www.gimlu.com/faucet)
- [Stakely](https://stakely.io/en/faucet/gnosis-chain-xdai)
- [Unitap](https://unitap.app/gas-faucet)
- [xDai Faucet](https://xdai-faucet.top/)

## Token Faucet

Expand Down
21 changes: 6 additions & 15 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const sidebars = {
"developers/interact/web3-js",
"developers/interact/ethers-js",
"developers/interact/rainbowkit-wagmi",
"developers/interact/dynamic",
],
},
{
Expand Down Expand Up @@ -523,26 +524,11 @@ const sidebars = {
label: 'Gnosis Faucet',
href: 'https://gnosisfaucet.com/',
},
{
type: 'link',
label: 'Gimlu',
href: 'https://www.gimlu.com/faucet',
},
{
type: 'link',
label: 'Stakely',
href: 'https://stakely.io/en/faucet/gnosis-chain-xdai',
},
{
type: 'link',
label: 'Unitap',
href: 'https://unitap.app/gas-faucet',
},
{
type: 'link',
label: 'xDai Faucet',
href: 'https://xdai-faucet.top/',
},
'tools/faucets/tokens',
],
},
Expand Down Expand Up @@ -659,6 +645,11 @@ const sidebars = {
label: 'Crypto Tax Calculator',
href: 'https://cryptotaxcalculator.io/exchanges/xdai-tax/',
},
{
type: 'link',
label: 'BitOK',
href: 'https://bitok.org/'
},
{
type: 'link',
label: 'Wrapeth',
Expand Down
Loading

0 comments on commit f0a49e9

Please sign in to comment.