#solana #blockchain #web3

app surfpool-cli

Where you train before surfing Solana

1 unstable release

new 0.1.2 Feb 2, 2025

#8 in Magic Beans

Apache-2.0

105KB
1.5K SLoC

surfpool

TL;DR

surfpool is to solana what anvil is to ethereum: a blazing fast in-memory testnet that has the ability to point-fork Solana mainnet instantly.

Design

surfpool uses the low level solana-svm API through the excellent wrapper LiteSVM. This approach provides greater flexibility and significantly faster boot times.

surfpool is also available as a library on crates.io - facilitating its integration in other projects.

Getting Started

Install surfpool from crates.io:

$ cargo install surfpool-cli

Start a local validator / simnet:

$ surfpool start

Status

surfpool is in active development, here are a few todos of what's coming next.

Configurable

  • Ability to pull configuration from a Surfpool.toml manifest file
  • Ability to setup slot time (default to 400ms)
  • Ability to setup epoch duration (default to 432,000)
  • Ability to configure behavior:
    • genesis
    • point-fork mainnet
    • stream-fork mainnet
  • Ability to configure the RPC node URL to default to.

RPC Support

  • Support HTTP Methods
    • Priority 1:
      • getVersion
      • getSlot
      • getEpochInfo
      • getLatestBlockhash
      • sendTransaction
      • getAccountInfo
      • requestAirdrop
      • getMultipleAccounts
      • getFeeForMessage
      • getBalance
      • simulateTransaction
      • getTransaction
    • Priority 2:
      • getBlock
      • getBlockCommitment
      • getBlockHeight
      • getBlockProduction
      • getBlocks
      • getBlocksWithLimit
      • getBlockTime
      • getClusterNodes
      • getEpochSchedule
      • getFirstAvailableBlock
      • getGenesisHash
      • getHealth
      • getHighestSnapshotSlot
      • getIdentity
      • getInflationGovernor
      • getInflationRate
      • getInflationReward
      • getLargestAccounts
      • getLeaderSchedule
      • getMaxRetransmitSlot
      • getMaxShredInsertSlot
      • getMinimumBalanceForRentExemption
      • getProgramAccounts
      • getRecentPerformanceSamples
      • getRecentPrioritizationFees
      • getSignaturesForAddress
      • getSignatureStatuses
      • getSlotLeader
      • getSlotLeaders
      • getStakeMinimumDelegation
      • getSupply
      • getTokenAccountBalance
      • getTokenAccountsByDelegate
      • getTokenAccountsByOwner
      • getTokenLargestAccounts
      • getTokenSupply
      • getTransactionCount
      • getVoteAccounts
      • isBlockhashValid
      • minimumLedgerSlot
  • Support Websocket Methods

Going Further

  • Ability to watch and update fetched account

Dependencies

~142MB
~2.5M SLoC