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(website): prover proposer danger private key with nextra callout type error + generate isolated burner wallet #14853

Merged
merged 1 commit into from
Sep 29, 2023
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
28 changes: 26 additions & 2 deletions packages/website/pages/docs/guides/enable-a-proposer.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout, Steps } from "nextra-theme-docs";
import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs";
import { contractAddressToLink } from "../../../utils/contractAddressToLink";
import { SEPOLIA_CONFIG, GRIMSVOTN_CONFIG } from "../../../domain/chain";
import { StyledLink } from "/components/StyledLink";
Expand All @@ -25,10 +25,34 @@ nano .env

### Set environment variables to enable a proposer

<Callout type="warning">
<Callout type="error">
Do **not** use a private key that is valuable to you. The private key will be
stored in plain text in the `.env` file, and this is not secure. There is a
real risk of losing your assets. You should **only use a test account**.

To generate an isolated burner wallet locally:

<Tabs items={["foundry", "ethers.js"]} defaultIndex="0">
<Tab>
```shell
cast wallet new | tee /dev/tty |
grep 'Private key:' | awk '{print "export PRIVATE_KEY="$3}' >> .env && source .env
```
</Tab>
<Tab>
```js
var ethers = require('ethers');
var crypto = require('crypto');

var id = crypto.randomBytes(32).toString('hex');
var privateKey = "0x"+id;
console.log("SAVE BUT DO NOT SHARE THIS:", privateKey);

var wallet = new ethers.Wallet(privateKey);
console.log("Address: " + wallet.address);
```
</Tab>
</Tabs>
</Callout>

Set the following environment variables to enable your node as a proposer:
Expand Down
32 changes: 28 additions & 4 deletions packages/website/pages/docs/guides/enable-a-prover.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from "next/image";
import { Callout, Steps } from "nextra-theme-docs";
import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs";

# Enable a prover

Expand All @@ -22,10 +22,34 @@ nano .env

### Set environment variables to enable prover

<Callout type="warning">
<Callout type="error">
Do **not** use a private key that is valuable to you. The private key will be
stored in plain text in the `.env` and this is not secure. There is a real
risk of losing your assets. You should **only use a test account**.
stored in plain text in the `.env` file, and this is not secure. There is a
real risk of losing your assets. You should **only use a test account**.

To generate an isolated burner wallet locally:

<Tabs items={["foundry", "ethers.js"]} defaultIndex="0">
<Tab>
```shell
cast wallet new | tee /dev/tty |
grep 'Private key:' | awk '{print "export PRIVATE_KEY="$3}' >> .env && source .env
```
</Tab>
<Tab>
```js
var ethers = require('ethers');
var crypto = require('crypto');

var id = crypto.randomBytes(32).toString('hex');
var privateKey = "0x"+id;
console.log("SAVE BUT DO NOT SHARE THIS:", privateKey);

var wallet = new ethers.Wallet(privateKey);
console.log("Address: " + wallet.address);
```
</Tab>
</Tabs>
</Callout>

Open the `.env` file and set the following environment variables to enable your node as a prover:
Expand Down
Loading