This repository hosts two essential scripts for MongoDB data migration and Polkadot asset airdrops. Refer to each project's respective directory for detailed instructions.
Directory structure:
├── .gitignore
├── directory_structure.txt
├── README.md
├── scripts
│ ├── substrate-address-extractor
│ │ ├── src
│ │ │ └── main.ts
│ │ ├── package.json
│ │ └── tsconfig.json
│ ├── mongo-migration
│ │ ├── setup.ts
│ │ ├── package.json
│ │ ├── docker-compose.yml
│ │ ├── README.md
│ │ ├── tsconfig.json
│ │ └── index.ts
│ ├── myriad-address-snapshotter
│ │ ├── src
│ │ │ └── main.ts
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── myriad_addresses.json
│ ├── extracted.txt
│ └── rococo-airdrop
│ ├── airdropList.ts
│ ├── package.json
│ ├── docker-compose.yml
│ ├── README.md
│ ├── tsconfig.json
│ ├── failed_airdrops.json
│ ├── index.ts
│ └── logs
│ └── devnet-airdrop-execution.logs.txt
├── .git
└── raw.txt
The scripts are for MongoDB data migration, Myriad address extraction, and Polkadot asset airdrops. The process includes taking a snapshot of the current MongoDB database, extracting Myriad addresses, and performing an airdrop on a new chain.
- Docker & Docker Compose
- Node.js
- pnpm
- Git
git clone [email protected]:myriadsocial/myriad-scripts.git
cd myriad-scripts
We've provided a shell script that automates the entire process. To use it:
-
Make the script executable:
chmod +x run.sh
-
Run the script:
./run.sh
This script will prompt you for the following information:
- MongoDB URL (default: mongodb://localhost:27017)
- WebSocket URL for Myriad network (default: wss://ws-rpc.testnet.myriad.social)
- WebSocket URL for Rococo network (default: wss://ws-rpc.devnet.myriad.social/websocket/)
The script will automatically perform the following steps:
- Myriad Address Snapshotter
- Substrate Address Extractor
- Rococo Airdrop
If you prefer to run the steps manually or need to troubleshoot, follow these steps:
cd scripts/myriad-address-snapshotter
pnpm install
pnpm start
cd ../..
cd scripts/substrate-address-extractor
pnpm install
pnpm start
cd ../..
cd scripts/rococo-airdrop
pnpm install
pnpm start
cd ../..
run.sh
: Automation script for the entire processscripts/myriad-address-snapshotter/
: Scripts for extracting Myriad addressesscripts/substrate-address-extractor/
: Scripts for extracting Substrate addressesscripts/rococo-airdrop/
: Scripts for performing the airdrop on Rococo network
- Always ensure you have the necessary backups before performing migrations in a production environment.
- Test the process on a testnet before running it on a mainnet.
- Keep your seed phrases and private keys secure and never share them.
If you encounter issues:
- Ensure all dependencies are correctly installed.
- Verify network permissions and access.
- Check that MongoDB and WebSocket URLs are correct in all relevant files.
- Review console output for specific error messages.
For persistent problems, please open an issue in this repository with a detailed description.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.