Scripts that self transfers SOL with various configurations to demonstrate the importance of sending optimized transactions
Presentation: https://docs.google.com/presentation/d/1kJPX_kZbHSU_WB2v0PtSD9gARVjbgVSmG2PT6nxZzLQ/edit?usp=sharing
Endpoints:
-
No Jet: https://tritono-main-e861.mainnet.rpcpool.com/aa6544ed-6f6a-4af9-95b0-8b6811593a84
-
Jet: https://tritono-main-e861.mainnet.rpcpool.com/1b393e72-6fe6-4945-9178-4c8de272a3c6
- NodeJS: https://nodejs.org/en/download/package-manager
- Wallet private key. See #generate-private-key
- Very little mainnet SOL (0.05 SOL). It'll be transferred to yourself
optimized.mjs
: Sends optimized transactions by following this docunoptimized.mjs
: Sends unoptimized transaction with default config
- Install dependencies:
npm install
- Create and add the following dependencies in
.env
fileRPC_ENDPOINT
: The provided RPC EndpointWALLET_PRIVATE_KEY
: base58 encoded wallet private key
- Run the script
node optimized.js
- Execute
node keypair.mjs
. It'll output the public and private keys. Send some nominal amount of SOL to it. 0.05 will be suffcient.
NOTE: You'll be transferring the SOL to yourself