Skip to content

informalsystems/whitelist-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

merkle-airdrop-server

A small Express.js service that serves per-address airdrop maximums and Merkle proofs based on time-ordered “whitelist” JSON files.

Endpoints

GET /get_maximum/:address Returns { address, amount } for the given address in the current whitelist.

GET /generate_proof/:address Runs npx merkle-airdrop-cli generateProofs against the current whitelist, returning { address, amount, proofs: [...] }.

Local Setup

  1. Clone the repository
git clone
cd merkle-airdrop-server
  1. Install dependencies
yarn install

You will also need the Merkle Airdrop CLI installed globally, see here: https://github.com/CosmWasm/cw-tokens/tree/main/contracts/cw20-merkle-airdrop/helpers

  1. Start the server
npm start
  1. Test the endpoints
curl http://localhost:3000/get_maximum/0x1234567890abcdef1234567890abcdef12345678
{
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "amount": 1000
}

Automated Deployment

Upon changes, this Github repo will automatically be deployed to a DigitalOcean droplet via a Github action. The action will SSH into the droplet and run git pull to update the code, then restart the server.

The Droplet details are stored as Github secrets.

Whitelists

The whitelists are stored in the whitelists directory. Each whitelist is a JSON file with the following format:

[
  { "address": "neutron14fmxw54lgvheyn7m0p9efpr82fac68ysph96ch", "amount": "999"},
  { "address": "neutron1r6rv879netg009eh6ty23v57qrq29afecuehlm", "amount": "991"},
  ...
]

The filename should be in the format {unix_timestamp}_whitelist.json, where the timestamp is the time the whitelist should go into effect. The server will serve the whitelist with the highest timestamp that is less the current time.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published