[apt] GPG error: https://cli.github.com/packages stable InRelease 에러

apt-get update를 했는데 다음과 같은 에러가 난다.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: 다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: https://cli.github.com/packages/dists/stable/InRelease 파일을 받는데 실패했습니다  다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.

기존 서명 키 삭제

sudo rm /usr/share/keyrings/githubcli-archive-keyring.gpg

최신 키 다운로드 및 설치

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg

/etc/apt/sources.list.d/github-cli.list 파일 안에는 이렇게 되어 있다.

deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main

[ethers.js] HD wallet으로 주소 파생

12개의 seed wallet이 있는 경우, 다음과 같이 파생 주소를 확인할 수 있다.

$ npm install ethers@^5.0.0

const { ethers } = require('ethers');

// 12개의 시드 단어를 여기에 입력하세요
const mnemonic = "Your seed 12 words here";

// HD Node 생성
const hdNode = ethers.utils.HDNode.fromMnemonic(mnemonic);

// 파생 경로 설정
const derivationPath = "m/44'/60'/0'/0/"; // "m/44'/905956'/0'/0/" 와 같이 사용도 가능

// 파생 주소 생성 및 출력 함수
function generateAddresses(count) {
    const addresses = [];
    for (let i = 0; i < count; i++) {
        const walletNode = hdNode.derivePath(derivationPath + i);
        console.log(i, walletNode.address);
        addresses.push({
            index: i,
            address: walletNode.address,
        });
    }
    return addresses;
}

// 원하는 주소 개수를 설정하세요
const numAddresses = 85535;
const addresses = generateAddresses(numAddresses);