Install Truebit on Ethereum

circle-info

The Getting Started Guide has been updated to provide instructions on testing Truebit v1 using Hardhat and a locally forked Ethereum node. This replaces the previous version of the guide, which referenced the deprecated Goerli testnetarrow-up-right. The Goerli testnet is expected to sunset in early 2024, and Truebit recommends updating your test environment as soon as possible.

Install Prerequisites

1. Download & Install Gitarrow-up-right

2. Clone the Truebit on Ethereum Git repositoryarrow-up-right.

git clone https://github.com/TruebitProtocol/truebit-eth

3. Download & Install Dockerarrow-up-right.

4. Build the Truebit on Ethereum Docker container.

docker pull truebitprotocol/truebit-eth:latest

5. Install hardhat

Create a new directory called "v1" and move into it

npm install hardhat@"2.20.1"
npx hardhat init

Copy the following file into the directory

file-download
385B

Open the file and update the field <YOUR_INFURA_API_KEY> with your API KEY generated at the Prerequisites. Copy the following file into the directory.

Verify the Installed version to validate that the installed version corresponds to the "2.20.1"

6. Register on Infura and get the Infura API Key.

To fork from Ethereum Mainnet, you need a free Infura account.

  • After the creation, click on your key

  • Copy the API KEY string

Accessing Truebit on Ethereum Smart Contracts with MetaMask (Optional)

1. Install the MetaMaskarrow-up-right browser extension.

2. Import account from Docker shared folder (keystore).

My Accounts -> Import Account
Import Account -> Type Json File
Path to get Keystore

3. Add TRU token contract to each address.

Last updated