Notarize AT Protocol records on Ethereum using EAS (experiment)

add network info

Changed files
+15 -12
src
+1 -1
README.md
··· 1 - # atnotary 1 + # AT Protocol Notary (atnotary) 2 2 3 3 Create permanent, verifiable attestations of [AT Protocol](https://atproto.com/) records using [Ethereum Attestation Service](https://attest.org/) (EAS). 4 4
+14 -11
src/cli.ts
··· 22 22 .option('-n, --network <network>', 'Network to use', 'sepolia') 23 23 .action(async (options) => { 24 24 try { 25 - console.log(chalk.blue('๐Ÿ”ง Initializing EAS Schema\n')); 25 + console.log(chalk.blue('๐Ÿ”ง Initializing EAS Schema')); 26 + console.log(chalk.gray(`Network: ${options.network}\n`)); 26 27 27 - const spinner = ora('Connecting to network...').start(); 28 + const spinner = ora(`Connecting to ${options.network}...`).start(); 28 29 29 30 const notary = new ATProtocolNotary({ 30 31 privateKey: process.env.PRIVATE_KEY!, 31 32 }, options.network); 32 33 33 34 const address = await notary.getAddress(); 34 - spinner.succeed(`Connected: ${address}`); 35 + spinner.succeed(`Connected to ${options.network}: ${address}`); 35 36 36 - spinner.start('Creating schema on EAS...'); 37 + spinner.start(`Creating schema on EAS (${options.network})...`); 37 38 const schemaUID = await notary.initializeSchema(); 38 39 39 40 spinner.succeed('Schema created!'); ··· 55 56 .option('-n, --network <network>', 'Network to use', 'sepolia') 56 57 .action(async (recordURI: string, options) => { 57 58 try { 58 - console.log(chalk.blue('๐Ÿ” AT Protocol Notary\n')); 59 + console.log(chalk.blue('๐Ÿ” AT Protocol Notary')); 60 + console.log(chalk.gray(`Network: ${options.network}\n`)); 59 61 60 62 const spinner = ora('Initializing...').start(); 61 63 ··· 73 75 console.log(chalk.gray('\nRecord preview:')); 74 76 console.log(chalk.gray(JSON.stringify(record.value, null, 2).substring(0, 200) + '...\n')); 75 77 76 - spinner.start('Creating attestation on Ethereum...'); 78 + spinner.start(`Creating attestation on ${options.network}...`); 77 79 const result = await notary.notarizeRecord(recordURI); 78 80 spinner.succeed('Attestation created!'); 79 81 80 82 console.log(chalk.green('\nโœ… Notarization Complete!\n')); 83 + console.log(chalk.blue('Network:'), chalk.gray(options.network)); 81 84 console.log(chalk.blue('Attestation UID:'), chalk.cyan(result.attestationUID)); 82 85 console.log(chalk.blue('Record URI:'), chalk.gray(result.recordURI)); 83 86 console.log(chalk.blue('CID:'), chalk.gray(result.cid)); ··· 89 92 console.log(chalk.cyan(result.explorerURL + '\n')); 90 93 91 94 console.log(chalk.yellow('๐Ÿ” Verify with:')); 92 - console.log(chalk.gray(`atnotary verify ${result.attestationUID}\n`)); 95 + console.log(chalk.gray(`atnotary verify ${result.attestationUID} --network ${options.network}\n`)); 93 96 94 97 } catch (error: any) { 95 98 console.error(chalk.red('Error:'), error.message); 96 99 process.exit(1); 97 100 } 98 101 }); 99 - 100 102 101 103 // Verify command 102 104 program ··· 106 108 .option('-c, --compare', 'Compare with current record state') 107 109 .action(async (attestationUID: string, options) => { 108 110 try { 109 - console.log(chalk.blue('๐Ÿ” Verifying Attestation\n')); 111 + console.log(chalk.blue('๐Ÿ” Verifying Attestation')); 112 + console.log(chalk.gray(`Network: ${options.network}\n`)); 110 113 111 - const spinner = ora('Fetching attestation from EAS...').start(); 114 + const spinner = ora(`Fetching attestation from EAS (${options.network})...`).start(); 112 115 113 116 const notary = new ATProtocolNotary({ 114 117 privateKey: process.env.PRIVATE_KEY!, ··· 119 122 spinner.succeed('Attestation found'); 120 123 121 124 console.log(chalk.green('\nโœ… Attestation Valid\n')); 125 + console.log(chalk.blue('Network:'), chalk.gray(options.network)); 122 126 console.log(chalk.blue('UID:'), chalk.cyan(attestation.uid)); 123 127 console.log(chalk.blue('Record URI:'), chalk.gray(attestation.recordURI)); 124 128 console.log(chalk.blue('CID:'), chalk.gray(attestation.cid)); ··· 157 161 process.exit(1); 158 162 } 159 163 }); 160 - 161 164 162 165 program.parse();