Skip to content

Commit

Permalink
README: Revamp contract deployment slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Apr 12, 2024
1 parent 1755c42 commit cb973d6
Showing 1 changed file with 16 additions and 25 deletions.
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

0 comments on commit cb973d6

Please sign in to comment.