This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 416
Add documentation for Truffle Dashboard #1089
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a799dfe
Add documentation for Truffle Dashboard
rkalis 5b777e7
Update Truffle Dashboard docs
rkalis ab9ca8e
Small updates to the dashboard docs
rkalis 30ff8f2
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 5dfe09e
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 29881e1
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts d9775e7
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 45ec560
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 1b4276a
Update src/docs/truffle/reference/configuration.md
fainashalts 187d6bf
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 385fcad
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 33d0977
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts 77c67e3
Update src/docs/truffle/getting-started/using-the-truffle-dashboard.md
fainashalts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
src/docs/truffle/getting-started/using-the-truffle-dashboard.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
--- | ||
title: Using the Truffle Dashboard | ||
layout: docs.hbs | ||
--- | ||
# Using the Truffle Dashboard | ||
|
||
When deploying your smart contracts you need to specify an Ethereum account that has enough funds to cover the transaction fees of the deployment. A popular method of doing this is copy-pasting your mnemonic phrase to a gitignored `.env` file so that it can be used for e.g. the `@truffle/hdwallet-provider`. But in general it is a bad practice to copy-paste your keys, especially since we have wallets like MetaMask that can send transactions for us. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
This is why we developed the Truffle Dashboard, an easy way to use your existing MetaMask wallet for your deployments and for other transactions that you need to send from a command line context. Because the Truffle Dashboard connects directly to MetaMask it is also possible to use it in combination with hardware wallets like Ledger or Trezor. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Starting a dashboard | ||
|
||
To start a Truffle Dashboard, you need to run the `truffle dashboard` command in a separate terminal window. | ||
|
||
``` | ||
> truffle dashboard [--port <number>] [--host <string>] [--verbose] | ||
Truffle Dashboard running at http://localhost:24012 | ||
DashboardProvider RPC endpoint running at http://localhost:24012/rpc | ||
``` | ||
|
||
By default, this starts a dashboard at `http://localhost:24012` and opens the dashboard in a new tab in your default browser. The Dashboard then prompts you to connect your wallet and confirm that you're connected to the right network. You should double check your connected network at this point, since switching to a different network during a deployment can have unintended consequences. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
 | ||
|
||
The port and host can be configured through command line options, or by configuring them inside your `truffle-config.js`. | ||
|
||
```js | ||
module.exports = { | ||
// ... rest of truffle config | ||
|
||
dashboard: { | ||
port: 24012, | ||
} | ||
|
||
networks: { | ||
// ... network configurations, including the network named 'dashboard' | ||
} | ||
} | ||
``` | ||
|
||
|
||
## Connecting to the dashboard | ||
|
||
To make connecting to the Truffle Dashboard easy, Truffle includes a builtin network named "dashboard". This builtin network automatically uses the port and host specified in the dashboard config or falls back to the default `http://localhost:24012`. This builtin network can be used with all your deployments or scripts. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` | ||
truffle migrate --network dashboard | ||
truffle console --network dashboard | ||
``` | ||
|
||
From there every Ethereum RPC request will be forwarded from Truffle to the Truffle Dashboard, where the user can inspect the RPC requests and process them with MetaMask. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
Any additional network options or overrides can be provided by adding a network called "dashboard" to your `truffle-config.js` file and providing network options like it were a regular network. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```js | ||
module.exports = { | ||
// ... rest of truffle config | ||
|
||
networks: { | ||
// ... rest of network config | ||
|
||
dashboard: { | ||
networkCheckTimeout: 120000, | ||
} | ||
} | ||
|
||
dashboard: { | ||
// ... dashboard host/port config | ||
} | ||
}; | ||
``` | ||
|
||
|
||
## Usage with non-Truffle tooling | ||
|
||
We know that not everyone uses Truffle for their smart contract development, but we believe that the Truffle Dashboard should be accessible to everyone. This is why we developed the Truffle Dashboard to be agnostic of the tools you're using, so it can also be used with other tools such as Hardhat. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
When using the Truffle Dashboard with Hardhat, you need to create a network configuration inside your `hardhat.config.js` file that specifies the Truffle Dashboard's RPC URL. | ||
|
||
```js | ||
module.exports = { | ||
// ... rest of hardhat config | ||
|
||
networks: { | ||
// ... rest of network config | ||
|
||
'truffle-dashboard': { | ||
url: "http://localhost:24012/rpc" | ||
} | ||
}, | ||
}; | ||
``` | ||
|
||
From there it can be used with any Hardhat tasks as well as tools like hardhat-deploy. | ||
fainashalts marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` | ||
hardhat deploy --network truffle-dashboard | ||
``` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+506 KB
src/img/docs/truffle/using-the-truffle-dashboard/truffle-dashboard-confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+487 KB
src/img/docs/truffle/using-the-truffle-dashboard/truffle-dashboard-connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+577 KB
src/img/docs/truffle/using-the-truffle-dashboard/truffle-dashboard-transaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.