Skip to content

Commit

Permalink
docs(website): prover proposer danger private key with nextra callout…
Browse files Browse the repository at this point in the history
… type error + generate isolated burner wallet (#14853)
  • Loading branch information
MarcusWentz authored and KorbinianK committed Oct 2, 2023
1 parent eae3927 commit 9aec364
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
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

0 comments on commit 9aec364

Please sign in to comment.