mirror of
https://github.com/getwax/bls-wallet.git
synced 2026-01-10 06:17:55 -05:00
Turn main repo README into landing page with relevant sub folder/component links. Include aggregator-proxy in setup.ts. Update aggreagator-proxy npm repo. Clean up all component READMEs. Add more troubleshooting, removing empty sections. Add docs folder with guides for local & remote setup, system overview, and client usage. Add image assets for landing & system overview.
Aggregator Proxy
This package makes it easy to provide an aggregator by proxying another. The primary use-case is to expose a free aggregator based on one that requires payment by augmenting the bundles with transactions that pay tx.origin.
Setup
npm install bls-wallet-aggregator-proxy
yarn install bls-wallet-aggregator-proxy
Usage
import {
runAggregatorProxy,
// AggregatorProxyCallback,
// ^ Alternatively, for manual control, import AggregatorProxyCallback to
// just generate the req,res callback for use with http.createServer
} from 'bls-wallet-aggregator-proxy';
runAggregatorProxy(
'https://arbitrum-testnet.blswallet.org',
async bundle => {
console.log('proxying bundle', JSON.stringify(bundle, null, 2));
// Return a different/augmented bundle to send to the upstream aggregator
return bundle;
},
8080,
'0.0.0.0',
() => {
console.log('Proxying aggregator on port 8080');
},
);