Sunspot is a proxy server that enables custom RPC urls and custom token metadata lists for the Solflare Solana wallet.
cargo install sunspot
chmod +x generate-cert.sh
./generate-cert.sh
mkdir -p $HOME/.config/sunspot/certs
openssl genrsa -out $HOME/.config/sunspot/certs/sunspot.key 2048
openssl req -x509 -new -nodes -key $HOME/.config/sunspot/certs/sunspot.key -sha256 -days 1825 -out $HOME/.config/sunspot/certs/sunspot.pem
- Go to chrome://settings/certificates in your Chrome browser
- Go to the
Authorities
tab and thenImport
- Select the
sunspot.pem
file from thecerts
directory - Select
Trust this certificate for identifying websites
and clickOK
- Go to about:preferences#privacy in your Firefox browser and scroll down to
Certificates
- Click
View Certificates
, go to theAuthorities
tab, and then clickImport
- Select the
sunspot.pem
file from thecerts
directory - Select
Trust this CA to identify websites.
and clickOK
- Install from the Chrome Web Store or Firefox Add-ons
- In the SwitchyOmega options, go to Import/Export and click
Restore from file
- Select the
OmegaOptions.bak
file from theswitchy-omega-proxy
directory - Click
Apply Changes
and enable theauto switch
option through the extension icon
Using the Testnet RPC option for Solflare is recommended. This will cause Solflare to route transactions through Testnet nodes, so if an API changes unexpectedly, real transactions won't be routed to Mainnet-Beta. Testnet also disables some features, which is what we want since Sunspot can't support everything (yet)!
sunspot --help
By default, Sunspot will try to pull the sunspot.pem
and sunspot.key
files from $HOME/.config/sunspot/certs
.
sunspot http://localhost:8899
If you want to use a custom certificate location, you can use the --certificate
(-c
) and --key
(-k
) flags.
sunspot -k ./certs/sunspot.key -c ./certs/sunspot.pem http://localhost:8899
Sunspot allows you to provide a custom token-list JSON file, which is used to add custom names, symbols, and imageURIs to tokens in both the wallet view and during simulations.
{
"<Token Mint String>": {
"name": "<Token Name>",
"symbol": "<Token Symbol>",
"imageUri": "<Token Image URI>"
},
// USD Coin Example
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
"name": "USD Coin",
"symbol": "USDC",
"imageUri": "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png?1547042389"
}
}
Plop the token list file in $HOME/.config/sunspot/tokens/<TOKEN_NAME>.json
.
You can pass this file to Sunspot using the --token-list
(-t
) flag, providing the <TOKEN_NAME> of the file.
sunspot -t <TOKEN_NAME> http://localhost:8899
Special thanks to the Hudsucker crate for the MITM HTTP/S proxy implementation