Merge branch 'feature/sourcify-ui-improvements' into develop

This commit is contained in:
Willian Mitsuda 2021-09-12 22:13:00 -03:00
commit df40e065c4
3 changed files with 26 additions and 5 deletions

View File

@ -10,6 +10,10 @@ This is the default integration method, we resolve the public Sourcify IPNS to g
The downside is that recently verified contracts may not have yet been added to the root hash and republished into IPNS. The downside is that recently verified contracts may not have yet been added to the root hash and republished into IPNS.
It assumes a local IPFS gateway at localhost:8080 to avoid leaking your queries to public gateways.
> This option is actually not working, but it is provided for completeness, follow https://github.com/ethereum/sourcify/issues/495
## Direct HTTP connection to Sourcify's repository ## Direct HTTP connection to Sourcify's repository
Standard HTTP connection to their repo at https://repo.sourcify.dev/ Standard HTTP connection to their repo at https://repo.sourcify.dev/
@ -21,3 +25,19 @@ Fast access to fresh verified data. On the other hand it is less private and cen
As a midterm solution, we are making available a snapshot docker image of their repository, containing only mainnet full verified contracts. As a midterm solution, we are making available a snapshot docker image of their repository, containing only mainnet full verified contracts.
This would allow you to play with existing contracts up to the snapshot date/time locally, not depending on their service or IPFS connectivity availability. This would allow you to play with existing contracts up to the snapshot date/time locally, not depending on their service or IPFS connectivity availability.
> It is very likely this run mode will be deprecated in future.
The Sourcify snapshot is provided as a nginx image at: https://hub.docker.com/repository/docker/otterscan/sourcify-snapshot
You can run it with:
```
docker run --rm -d -p 3006:80 --name sourcify-snapshot otterscan/sourcify-snapshot:2021-09
```
Stop it with:
```
docker stop sourcify-snapshot
```

View File

@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown"; import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
import ContentFrame from "../ContentFrame"; import ContentFrame from "../ContentFrame";
import InfoRow from "../components/InfoRow"; import InfoRow from "../components/InfoRow";
import Copy from "../components/Copy";
import ABI from "./ABI"; import ABI from "./ABI";
import Contract from "./Contract"; import Contract from "./Contract";
import { RuntimeContext } from "../useRuntime"; import { RuntimeContext } from "../useRuntime";
@ -42,13 +43,13 @@ const Contracts: React.FC<ContractsProps> = ({
<RadioGroup value={sourcifySource} onChange={setSourcifySource}> <RadioGroup value={sourcifySource} onChange={setSourcifySource}>
<div className="flex space-x-2"> <div className="flex space-x-2">
<RadioButton value={SourcifySource.IPFS_IPNS}> <RadioButton value={SourcifySource.IPFS_IPNS}>
Resolve IPNS Resolve IPNS @localhost:8080 gateway
</RadioButton> </RadioButton>
<RadioButton value={SourcifySource.CENTRAL_SERVER}> <RadioButton value={SourcifySource.CENTRAL_SERVER}>
Sourcify Servers Sourcify Servers
</RadioButton> </RadioButton>
<RadioButton value={SourcifySource.CUSTOM_SNAPSHOT_SERVER}> <RadioButton value={SourcifySource.CUSTOM_SNAPSHOT_SERVER}>
Local Snapshot Local Snapshot @localhost:3006
</RadioButton> </RadioButton>
</div> </div>
</RadioGroup> </RadioGroup>
@ -91,7 +92,8 @@ const Contracts: React.FC<ContractsProps> = ({
{rawMetadata.output.abi && ( {rawMetadata.output.abi && (
<div className="mb-3"> <div className="mb-3">
<div className="flex space-x-2 text-sm border-l border-r border-t rounded-t px-2 py-1"> <div className="flex space-x-2 text-sm border-l border-r border-t rounded-t px-2 py-1">
ABI <span>ABI</span>
<Copy value={JSON.stringify(rawMetadata.output.abi)} />
</div> </div>
<ABI abi={rawMetadata.output.abi} /> <ABI abi={rawMetadata.output.abi} />
</div> </div>

View File

@ -27,8 +27,7 @@ export enum SourcifySource {
const sourcifyIPNS = const sourcifyIPNS =
"k51qzi5uqu5dll0ocge71eudqnrgnogmbr37gsgl12uubsinphjoknl6bbi41p"; "k51qzi5uqu5dll0ocge71eudqnrgnogmbr37gsgl12uubsinphjoknl6bbi41p";
const ipfsGatewayPrefix = `https://ipfs.io/ipns/${sourcifyIPNS}`; const ipfsGatewayPrefix = `http://localhost:8080/ipns/${sourcifyIPNS}`;
// const ipfsGatewayPrefix = "http://localhost:8080/ipfs/QmWQoGfrLcizHueg3YkgDCh1S7SkfSP9A7H8YeZmUDfbnn"
const sourcifyHttpRepoPrefix = `https://repo.sourcify.dev`; const sourcifyHttpRepoPrefix = `https://repo.sourcify.dev`;
const snapshotPrefix = "http://localhost:3006"; const snapshotPrefix = "http://localhost:3006";