Skip to content

Commit

Permalink
switch demo and examples to new origin scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
adraffy committed Oct 13, 2024
1 parent 0df54fb commit 76431a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,42 @@ Turnkey [EIP-3668: CCIP-Read](https://eips.ethereum.org/EIPS/eip-3668) Handler f

* see [**types**](./dist/index.d.mts) / uses [ethers](https://github.com/ethers-io/ethers.js/)
* works with any server infrastructure
* uses minimal imports for serverless
* uses minimal imports for serverless
* implements multiple protocols:
* `"tor"` — [resolverworks/**TheOffchainResolver.sol**](https://github.com/resolverworks/TheOffchainResolver.sol)
* `"ens"` — [ensdomains/**offchain-resolver**](https://github.com/ensdomains/offchain-resolver/) and [ccip.tools](https://ccip.tools/)
* `"raw"` — raw response (EVM Gateway, testing, etc.)
* `"tor"` — [resolverworks/**TheOffchainResolver.sol**](https://github.com/resolverworks/TheOffchainResolver.sol)
* `"ens"` — [ensdomains/**offchain-resolver**](https://github.com/ensdomains/offchain-resolver/) and [ccip.tools](https://ccip.tools/)
* `"raw"` — raw response (EVM Gateway, testing, etc.)
* used by [resolverworks/**TheOffchainGateway.js**](https://github.com/resolverworks/TheOffchainGateway.js)
* `enableENSIP10()` drop-in support for [resolverworks/**enson.js**](https://github.com/resolverworks/enson.js) **Record**-type
* supports *Multicall-over-CCIP-Read*
* `resolve(name, multicall([...]))`
* `multicall([resolve(name, ...), ...])`
* `multicall([resolve(name, multicall([...])), ...])`
* `resolve(name, multicall([...]))`
* `multicall([resolve(name, ...), ...])`
* `multicall([resolve(name, multicall([...])), ...])`
* use [`serve()`](#serve) to quickly launch a server
* [**CCIP Postman**](https://resolverworks.github.io/ezccip.js/test/postman.html) ⭐️
* directly debug any CCIP-Read server (no RPC)
* directly debug any CCIP-Read server (no RPC)

## Demo

1. `npm run start` — starts a CCIP-Read server for [**TOR**](https://github.com/resolverworks/TheOffchainResolver.sol#context-format) protocol using [`serve()`](#serve)
1. `TOR.setText("ccip.context", "0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd http://localhost:8016")`
1. or, use [Postman](https://resolverworks.github.io/ezccip.js/test/postman.html#endpoint=https%3A%2F%2Fraffy.xyz%2Fezccip%2F&proto=tor&name=raffy.eth&multi=inner&field=addr-&field=text-description) — change to `http://localhost:8016`
1. check [Postman](https://resolverworks.github.io/ezccip.js/test/postman.html#endpoint=https%3A%2F%2Fraffy.xyz%2Fezccip%2F&proto=tor&name=raffy.eth&multi=inner&field=addr-&field=text-description) ← change to `http://localhost:8016`
1. choose a TOR:
1. [**TOR** on Mainnet or Sepolia](https://github.com/resolverworks/TheOffchainResolver.sol#theoffchainresolversol)
1. [**DNSTORWithENSProtocol** on Mainnet or Sepolia](https://github.com/resolverworks/TheOffchainResolver.sol?tab=readme-ov-file#dnstorwithensprotocolsol)
1. [setup](https://github.com/resolverworks/TheOffchainResolver.sol#setup) Context: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd http://localhost:8016`


### Examples

* **DNS**: [`ezccip.raffy.xyz`](https://adraffy.github.io/ens-normalize.js/test/resolver.html#ezccip.raffy.xyz) (Mainnet)
* Context: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/`
* **ENS**: [`ezccip.eth`](https://adraffy.github.io/ens-normalize.js/test/resolver.html?sepolia#ezccip.eth) (Sepolia)
* Context: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/s`
* **DNS** (using `"tor"` protocol on Mainnet): [`ezccip.raffy.xyz`](https://adraffy.github.io/ens-normalize.js/test/resolver.html#ezccip.raffy.xyz)
* Resolver: [`0x7CE6Cf740075B5AF6b1681d67136B84431B43AbD`](https://etherscan.io/address/0x7CE6Cf740075B5AF6b1681d67136B84431B43AbD)
* Context: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/0x7CE6Cf740075B5AF6b1681d67136B84431B43AbD`
* **ENS** (using `"tor"` protocol on Sepolia): [`ezccip.eth`](https://adraffy.github.io/ens-normalize.js/test/resolver.html?sepolia#ezccip.eth)
* Resolver: [`0x3c187BAb6dC2C94790d4dA5308672e6F799DcEC3`](https://sepolia.etherscan.io/address/0x3c187BAb6dC2C94790d4dA5308672e6F799DcEC3)
* Context: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/0x3c187BAb6dC2C94790d4dA5308672e6F799DcEC3`
* **DNS** (using `"ens"` protocol on Mainnet) [`ens.ezccip.raffy.xyz`](https://adraffy.github.io/ens-normalize.js/test/resolver.html#ens.ezccip.raffy.xyz)
* Resolver: [0x3CA097Edd180Ea2C2436BD30c021Ca20869087a0](https://etherscan.io/address/0x3CA097Edd180Ea2C2436BD30c021Ca20869087a0)
* Contect: `0xd00d726b2aD6C81E894DC6B87BE6Ce9c5572D2cd https://raffy.xyz/ezccip/0x3CA097Edd180Ea2C2436BD30c021Ca20869087a0`

## Usage

Expand Down
14 changes: 1 addition & 13 deletions test/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {EZCCIP} from '../src/ezccip.js';
import {serve} from '../src/serve.js';
import {readFileSync} from 'node:fs';

const TOR = '0x7CE6Cf740075B5AF6b1681d67136B84431B43AbD';
const DNSTORWithENSProtocol = '0x3CA097Edd180Ea2C2436BD30c021Ca20869087a0';

let {version} = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)));
Expand Down Expand Up @@ -43,17 +42,6 @@ ezccip.enableENSIP10(async (name, context) => {

await serve(ezccip, {
port: 8016,
resolvers: {
// old TORs (during development)
'': '0x828ec5bDe537B8673AF98D77bCB275ae1CA26D1f', // Mainnet
's': '0x9Ec7f2ce83fcDF589487303fA9984942EF80Cb39', // Sepolia
'g': '0x9b87849Aa21889343b6fB1E146f9F734ecFA9982', // Goerli

// newest TOR
'e4': TOR, // Mainnet (v4)
's4': '0x3c187BAb6dC2C94790d4dA5308672e6F799DcEC3', // Sepolia (v4)

'ens': DNSTORWithENSProtocol, // Mainnet
},
protocol: 'tor',
signingKey: '0xbd1e630bd00f12f0810083ea3bd2be936ead3b2fa84d1bd6690c77da043e9e02',
});

0 comments on commit 76431a0

Please sign in to comment.