Skip to content
Closed
Show file tree
Hide file tree
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
54 changes: 49 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,24 @@ This repository hosts a self-contained containerized application for running a d

### Retrieve Deployed Contract

- Once the container is deployed with `DEPLOYED_CONTRACT` env variable empty the logs will display the deployed contract address in the following format:
- Once the container is deployed with `DEPLOYED_CONTRACT` env variable empty, two contracts are deployed automatically: an implementation contract and a proxy. The logs will show:

```plaintext
level=info msg="Implementation pending deploy: 0x<implementation_address>."
level=info msg="Transaction waiting to be mined: 0x<tx_hash>."
```

- Wait approximately **3 minutes** for the implementation transaction to mine. The proxy deployment will then begin automatically:

```plaintext
│ time="2024-11-25T11:30:08Z" level=info msg="Contract pending deploy: 0xxxxxxxxxxxxxxxxxxxxxxxxxx."
level=info msg="Proxy pending deploy: 0x<proxy_address>."
level=info msg="Transaction waiting to be mined: 0x<tx_hash>."
```
- Copy the displayed contract address (e.g., `0xxxxxxxxxxxxxxxxxxxxxxxxxx`) and stop the container with `docker rm -f <container_name>`.

- Update your `.env` file with `DEPLOYED_CONTRACT` variable mentioned above. Redeployed the container with `docker-compose up -d`
- Copy the **proxy address** from the `Proxy pending deploy` log line and update your `.env` file with the `DEPLOYED_CONTRACT` variable:

```plaintext
DEPLOYED_CONTRACT=0xxxxxxxxxxxxxxxxxxxxxxxxxx
DEPLOYED_CONTRACT=0x<proxy_address>
```

- Check if the container is running correctly by viewing the logs. Run the following command:
Expand Down Expand Up @@ -191,6 +199,42 @@ If any issues arise during deployment, follow these steps:
```
- Apply fixes and redeploy.

## Contract Verification

When a feeder auto-deploys a new DIAOracleV3 contract (i.e. `DEPLOYED_CONTRACT` is empty on startup), the feeder logs the deployed addresses:

```
level=info msg="Implementation pending deploy: 0x<IMPLEMENTATION_ADDRESS>."
level=info msg="Proxy pending deploy: 0x<PROXY_ADDRESS>."
```

Copy `PROXY_ADDRESS` and set it as `DEPLOYED_CONTRACT` in your `.env` so the feeder uses it on restart.

Only the **implementation** needs to be verified on the block explorer. The proxy is auto-detected by the explorer as an EIP-1967 proxy and will automatically expose the implementation's read/write methods once the implementation is verified.

To verify the implementation, run the following from the repo root (requires [Foundry](https://getfoundry.sh) installed):

```bash
# 1. Build the V3 contracts
FOUNDRY_PROFILE=v3 forge build contracts/DIAOracleV3/DIAOracleV3.sol

# 2. Verify the implementation
FOUNDRY_PROFILE=v3 forge verify-contract \
--rpc-url <RPC_URL> \
--verifier blockscout \
--verifier-url '<EXPLORER_URL>/api/' \
<IMPLEMENTATION_ADDRESS> \
contracts/DIAOracleV3/DIAOracleV3.sol:DIAOracleV3
```

**Testnet values:**
- `RPC_URL`: `https://testnet-rpc.diadata.org`
- `EXPLORER_URL`: `https://testnet-explorer.diadata.org`

**Mainnet values:**
- `RPC_URL`: `https://rpc.diadata.org`
- `EXPLORER_URL`: `https://explorer.diadata.org`

## Documentation

For the full node deployment instructions, you can visit our [Wiki](https://github.com/diadata-org/decentral-feeder/wiki) page.
Expand Down
7 changes: 5 additions & 2 deletions cmd/scrapers/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module github.com/diadata-org/decentral-feeder/cmd/scrapers
go 1.24.0

require (
github.com/diadata-org/diadata v1.4.568
github.com/diadata-org/lumina-library v1.0.3
github.com/diadata-org/lumina-library v1.0.3-rc10
github.com/sirupsen/logrus v1.9.3
)

Expand All @@ -23,14 +22,18 @@ require (
github.com/ethereum/go-ethereum v1.15.7 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
Expand Down
Loading
Loading