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

README: Revamp contract deployment slightly #11

Merged
merged 1 commit into from
Apr 13, 2024
Merged
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
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,37 @@ Move to the `backend` folder and build smart contracts:
pnpm build
```

Next, deploy the contract.
Then, prepare your hex-encoded private key for paying the deployment gas fee
and store it as an environment variable:

### Basic Local Hardhat Deployment
```shell
export PRIVATE_KEY=0x...
```

Start the hardhat node:
To deploy the contracts to the [Sapphire Localnet], Testnet or Mainnet, use
one of the following commands:

```sh
npx hardhat node
```shell
npx hardhat deploy --network sapphire-localnet
npx hardhat deploy --network sapphire-testnet
npx hardhat deploy --network sapphire
```

Deploy smart contracts to that local network:
If you don't need any Sapphire-specific precompiles, you can spin up the
hardhat node and deploy the contract locally:

```sh
```
npx hardhat node
npx hardhat deploy --network localhost
```

The deployed MessageBox address will be reported. Remember it and store it
Once deployed, the MessageBox address will be reported. Remember it and store it
inside the `frontend` folder's `.env.development`, for example:

```
VITE_MESSAGE_BOX_ADDR=0x5FbDB2315678afecb367f032d93F642f64180aa3
```

### Deploying to Sapphire Localnet, Testnet and Mainnet

Prepare your hex-encoded private key and store it as an environment variable:

```shell
export PRIVATE_KEY=0x...
```

To deploy the contracts to the [Sapphire Localnet], Testnet or Mainnet, use the
following commands respectively:

```shell
npx hardhat deploy --network sapphire-localnet
npx hardhat deploy --network sapphire-testnet
npx hardhat deploy --network sapphire
```

[Sapphire Localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/pkgs/container/sapphire-dev

## Frontend
Expand Down
Loading