diff --git a/README.md b/README.md index 05460c95..04f9c384 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,16 @@ Upon installation, a configuration folder will be created at `~/.config/open-att ## Supported networks -| Network ID | Name | Network | Type | -| ---------- | ------------------------ | ------------ | ---------- | -| `1` | Ethereum Mainnet | `mainnet` | Production | -| `11155111` | Ethereum Testnet Sepolia | `sepolia` | Test | -| `137` | Polygon Mainnet | `polygon` | Production | -| `80001` | Polygon Testnet Mumbai | `mumbai` | Test | -| `50` | XDC Network | `xdc` | Production | -| `51` | XDC Apothem Network | `xdcapothem` | Test | +| Network ID | Name | Network | Type | +|------------|--------------------------|-----------------|------------| +| `1` | Ethereum Mainnet | `mainnet` | Production | +| `11155111` | Ethereum Testnet Sepolia | `sepolia` | Test | +| `137` | Polygon Mainnet | `polygon` | Production | +| `80001` | Polygon Testnet Mumbai | `mumbai` | Test | +| `50` | XDC Network | `xdc` | Production | +| `51` | XDC Apothem Network | `xdcapothem` | Test | +| `295` | Hedera Mainnet | `hederamainnet` | Production | +| `296` | Hedera Testnet | `hederatestnet` | Test | --- @@ -429,6 +431,17 @@ The response looks like: ✔ success Token registry deployed at 0x4B127b8d5e53872d403ce43414afeb1db67B1842 ``` +Example - Hedera network using Title Escrow address. +```bash +open-attestation deploy token-registry "KrypCEBL" KRYE -n hederatestnet -f key.txt --factory-address 0xde5aBf7B2416b99cba15021E3CF35A2a56ac83c1 --standalone +``` + +The response looks like: + +``` +✔ success Token registry deployed at 0x67f98aB5E2836223bCFC3e5c03D701AeB3a8A30a +``` + #### Issuing a document to token registry The `token-registry issue` command issues a hash to a token registry deployed on the blockchain. diff --git a/src/commands/config/config.type.ts b/src/commands/config/config.type.ts index bce27ad1..64b69ab3 100644 --- a/src/commands/config/config.type.ts +++ b/src/commands/config/config.type.ts @@ -13,4 +13,5 @@ export enum TestNetwork { Sepolia = "sepolia", Mumbai = "mumbai (polygon)", Apothem = "apothem (xdc)", + Hedera = "hedera (testnet)" } diff --git a/src/commands/config/create.ts b/src/commands/config/create.ts index f8243bc5..55c246ae 100644 --- a/src/commands/config/create.ts +++ b/src/commands/config/create.ts @@ -60,7 +60,7 @@ export const handler = async (args: CreateConfigCommand): Promise => { args.configTemplatePath = configTemplatePath; } - const networks = [TestNetwork.Local, TestNetwork.Sepolia, TestNetwork.Mumbai, TestNetwork.Apothem]; + const networks = [TestNetwork.Local, TestNetwork.Sepolia, TestNetwork.Mumbai, TestNetwork.Apothem, TestNetwork.Hedera]; const { network } = await inquirer.prompt({ type: "list", name: "network", @@ -84,6 +84,7 @@ const convertNetworkToNetworkCmdName = (selectedNetwork: TestNetwork): NetworkCm [TestNetwork.Sepolia]: NetworkCmdName.Sepolia, [TestNetwork.Mumbai]: NetworkCmdName.Maticmum, [TestNetwork.Apothem]: NetworkCmdName.XDCApothem, + [TestNetwork.Hedera]: NetworkCmdName.HederaTestnet, }; return network[selectedNetwork]; }; diff --git a/src/common/networks.ts b/src/common/networks.ts index ea8ee51c..fa504208 100644 --- a/src/common/networks.ts +++ b/src/common/networks.ts @@ -2,7 +2,7 @@ import { providers } from "ethers"; import type { GasStationFunction } from "./gas-station"; import { gasStation } from "./gas-station"; -export type networkCurrency = "ETH" | "MATIC" | "XDC"; +export type networkCurrency = "ETH" | "MATIC" | "XDC" | "HBAR"; type SupportedNetwork = { explorer: string; @@ -21,6 +21,8 @@ export enum NetworkCmdName { Maticmum = "maticmum", XDC = "xdc", XDCApothem = "xdcapothem", + HederaMainnet = "hederamainnet", + HederaTestnet = "hederatestnet" } const defaultInfuraProvider = @@ -87,6 +89,20 @@ export const supportedNetwork: { networkName: NetworkCmdName.XDCApothem, currency: "XDC", }, + [NetworkCmdName.HederaMainnet]: { + explorer: "https://hashscan.io/mainnet", + provider: jsonRpcProvider("https://mainnet.hashio.io/api"), + networkId: 295, + networkName: NetworkCmdName.HederaMainnet, + currency: "HBAR", + }, + [NetworkCmdName.HederaTestnet]: { + explorer: "https://hashscan.io/testnet", + provider: jsonRpcProvider("https://testnet.hashio.io/api"), + networkId: 296, + networkName: NetworkCmdName.HederaTestnet, + currency: "HBAR", + }, }; export const getSupportedNetwork = (networkCmdName: string): SupportedNetwork => {