solana-go
Go SDK library and RPC client for the Solana Blockchain
File Explorer
- commit-lint.yml
- lint.yml
- release.yml
- semver-check.yml
- tests.yml
- avx2_amd64.go
- avx2_amd64.s
- avx2_amd64_test.go
- avx2_amd64_v1.go
- avx2_amd64_v3.go
- avx2_other.go
- base58_test.go
- decode.go
- encode.go
- fuzz_test.go
- matmul_amd64.go
- matmul_amd64.s
- matmul_arm64.go
- matmul_arm64.s
- matmul_other.go
- tables.go
- cli.go
- getpass.go
- common.go
- decoding.go
- get.go
- get_account.go
- get_balance.go
- get_block.go
- get_latest_blockhash.go
- get_program_accounts.go
- get_slot.go
- get_spl_token.go
- get_transactions.go
- is_blockhash_valid.go
- logging.go
- request_airdrop.go
- root.go
- system.go
- system_transfer.go
- token.go
- token_get.go
- token_get_mint.go
- token_list.go
- token_list_mints.go
- token_registry.go
- token_registry_get.go
- token_registry_list.go
- token_registry_register.go
- token_transfer.go
- vault.go
- vault_add.go
- vault_create.go
- vault_export.go
- vault_list.go
- main.go
- diff.go
- diff_test.go
- init_test.go
- logging.go
- address-lookup.go
- address-lookup_test.go
- CloseLookupTable.go
- CreateLookupTable.go
- DeactivateLookupTable.go
- ExtendLookupTable.go
- FreezeLookupTable.go
- instruction_test.go
- instructions.go
- resolve.go
- resolve_test.go
- Create.go
- CreateIdempotent.go
- instruction_test.go
- instructions.go
- RecoverNested.go
- loader.go
- instruction.go
- instruction_test.go
- RequestHeapFrame.go
- RequestHeapFrame_test.go
- RequestUnitsDeprecated.go
- RequestUnitsDeprecated_test.go
- SetComputeUnitLimit.go
- SetComputeUnitLimit_test.go
- SetComputeUnitPrice.go
- SetComputeUnitPrice_test.go
- SetLoadedAccountsDataSizeLimit.go
- SetLoadedAccountsDataSizeLimit_test.go
- Create.go
- Create_test.go
- instructions.go
- Authorize.go
- Authorize_test.go
- AuthorizeChecked.go
- AuthorizeChecked_test.go
- AuthorizeCheckedWithSeed.go
- Authorized.go
- AuthorizeWithSeed.go
- Deactivate.go
- Deactivate_test.go
- DeactivateDelinquent.go
- DeactivateDelinquent_test.go
- DelegateStake.go
- DelegateStake_test.go
- GetMinimumDelegation.go
- GetMinimumDelegation_test.go
- Initialize.go
- Initialize_test.go
- InitializeChecked.go
- InitializeChecked_test.go
- instructions.go
- instructions_test.go
- Lockup.go
- Merge.go
- Merge_test.go
- MoveLamports.go
- MoveLamports_test.go
- MoveStake.go
- MoveStake_test.go
- Redelegate.go
- SetLockup.go
- SetLockup_test.go
- SetLockupChecked.go
- Split.go
- Split_test.go
- state.go
- state_test.go
- testing_utils_test.go
- types.go
- Withdraw.go
- Withdraw_test.go
- accounts.go
- accounts_test.go
- AdvanceNonceAccount.go
- AdvanceNonceAccount_test.go
- Allocate.go
- Allocate_test.go
- AllocateWithSeed.go
- AllocateWithSeed_test.go
- Assign.go
- Assign_test.go
- AssignWithSeed.go
- AssignWithSeed_test.go
- AuthorizeNonceAccount.go
- AuthorizeNonceAccount_test.go
- CreateAccount.go
- CreateAccount_test.go
- CreateAccountWithSeed.go
- CreateAccountWithSeed_test.go
- init_test.go
- InitializeNonceAccount.go
- InitializeNonceAccount_test.go
- instructions.go
- logging.go
- testing_utils.go
- Transfer.go
- Transfer_test.go
- TransferWithSeed.go
- TransferWithSeed_test.go
- types.go
- UpgradeNonceAccount.go
- UpgradeNonceAccount_test.go
- WithdrawNonceAccount.go
- WithdrawNonceAccount_test.go
- accounts.go
- accounts_test.go
- Approve.go
- Approve_test.go
- ApproveChecked.go
- ApproveChecked_test.go
- Burn.go
- Burn_test.go
- BurnChecked.go
- BurnChecked_test.go
- CloseAccount.go
- CloseAccount_test.go
- FreezeAccount.go
- FreezeAccount_test.go
- impl_pointer_consistency_test.go
- InitializeAccount.go
- InitializeAccount2.go
- InitializeAccount2_test.go
- InitializeAccount3.go
- InitializeAccount3_test.go
- InitializeAccount_test.go
- InitializeMint.go
- InitializeMint2.go
- InitializeMint2_test.go
- InitializeMint_test.go
- InitializeMultisig.go
- InitializeMultisig2.go
- InitializeMultisig2_test.go
- InitializeMultisig_flags_test.go
- InitializeMultisig_test.go
- instructions.go
- json.go
- MintTo.go
- MintTo_test.go
- MintToChecked.go
- MintToChecked_test.go
- program_id_override_test.go
- Revoke.go
- Revoke_test.go
- rpc.go
- SetAuthority.go
- SetAuthority_test.go
- SyncNative.go
- SyncNative_test.go
- testing_utils.go
- ThawAccount.go
- ThawAccount_test.go
- Transfer.go
- Transfer_test.go
- TransferChecked.go
- TransferChecked_test.go
- types.go
- deriveKeys.go
- kdf_vectors.json
- README.md
- ae_key.go
- doc.go
- elgamal_secret.go
- errors.go
- kdf_test.go
- signer.go
- accounts.go
- AmountToUiAmount.go
- Approve.go
- ApproveChecked.go
- Burn.go
- BurnChecked.go
- CloseAccount.go
- ConfidentialMintBurnExtension.go
- ConfidentialTransferExtension.go
- ConfidentialTransferFeeExtension.go
- CpiGuardExtension.go
- CreateNativeMint.go
- DefaultAccountStateExtension.go
- example_test.go
- extension_account.go
- extension_account_test.go
- extension_codecs.go
- extension_codecs_test.go
- extension_fuzz_test.go
- extension_math.go
- extension_math_test.go
- extension_rust_parity_test.go
- extension_states.go
- extension_test.go
- extension_types.go
- FreezeAccount.go
- GetAccountDataSize.go
- GroupMemberPointerExtension.go
- GroupPointerExtension.go
- impl_pointer_consistency_test.go
- InitializeAccount.go
- InitializeAccount2.go
- InitializeAccount3.go
- InitializeImmutableOwner.go
- InitializeMint.go
- InitializeMint2.go
- InitializeMintCloseAuthority.go
- InitializeMultisig.go
- InitializeMultisig2.go
- InitializeMultisig_flags_test.go
- InitializeNonTransferableMint.go
- InitializePermanentDelegate.go
- instruction_test.go
- instructions.go
- InterestBearingMintExtension.go
- json.go
- MemoTransferExtension.go
- MetadataPointerExtension.go
- MintTo.go
- MintToChecked.go
- PausableExtension.go
- PermissionedBurnExtension.go
- program_id_override_test.go
- Reallocate.go
- Revoke.go
- rpc.go
- ScaledUiAmountExtension.go
- SetAuthority.go
- SyncNative.go
- testing_utils.go
- ThawAccount.go
- Transfer.go
- TransferChecked.go
- TransferFeeExtension.go
- TransferHookExtension.go
- types.go
- UiAmountToAmount.go
- UnwrapLamports.go
- WithdrawExcessLamports.go
- instruction.go
- logging.go
- program.go
- rpc.go
- types.go
- types_test.go
- Authorize.go
- Authorize_test.go
- AuthorizeChecked.go
- AuthorizeChecked_test.go
- AuthorizeWithSeed.go
- AuthorizeWithSeed_test.go
- compact.go
- compact_test.go
- InitializeAccount.go
- InitializeAccount_test.go
- InitializeAccountV2.go
- InitializeAccountV2_test.go
- instructions.go
- instructions_test.go
- state.go
- state_test.go
- testing_utils_test.go
- TowerSync.go
- TowerSync_test.go
- types.go
- UpdateCommission.go
- UpdateCommission_test.go
- UpdateCommissionCollector.go
- UpdateCommissionCollector_test.go
- UpdateValidatorIdentity.go
- UpdateValidatorIdentity_test.go
- UpdateVoteState.go
- UpdateVoteState_test.go
- Vote.go
- Vote_test.go
- VoteSwitch.go
- VoteSwitch_test.go
- Withdraw.go
- Withdraw_test.go
- createMint.go
- getAccountInfo.go
- getBalance.go
- getBlock.go
- getBlockCommitment.go
- getBlockHeight.go
- getBlockProduction.go
- getBlocks.go
- getBlocksWithLimit.go
- getBlockTime.go
- getClusterNodes.go
- getEpochInfo.go
- getEpochSchedule.go
- getFeeForMessage.go
- getFirstAvailableBlock.go
- getGenesisHash.go
- getHealth.go
- getHighestSnapshotSlot.go
- getIdentity.go
- getInflationGovernor.go
- getInflationRate.go
- getInflationReward.go
- getLargestAccounts.go
- getLatestBlockhash.go
- getLeaderSchedule.go
- getMaxRetransmitSlot.go
- getMaxShredInsertSlot.go
- getMinimumBalanceForRentExemption.go
- getMultipleAccounts.go
- getProgramAccounts.go
- getRecentPerformanceSamples.go
- getSignaturesForAddress.go
- getSignatureStatuses.go
- getSlot.go
- getSlotLeader.go
- getSlotLeaders.go
- getSupply.go
- getTokenAccountBalance.go
- getTokenAccountsByDelegate.go
- getTokenAccountsByOwner.go
- getTokenLargestAccounts.go
- getTokenSupply.go
- getTransaction.go
- getTransactionCount.go
- getVersion.go
- getVoteAccounts.go
- isValidBlockhash.go
- minimumLedgerSlot.go
- requestAirdrop.go
- sendEncodedTransaction.go
- sendRawTransaction.go
- sendTransaction.go
- simulateTransaction.go
- jsonrpc.go
- jsonrpc_test.go
- LICENSE
- README.md
- sendAndConfirmTransaction.go
- .gitignore
- accountSubscribe.go
- logsSubscribe.go
- programSubscribe.go
- rootSubscribe.go
- signatureSubscribe.go
- slotSubscribe.go
- voteSubscribe.go
- accountSubscribe.go
- accountSubscribe_test.go
- blockSubscribe.go
- blockSubscribe_rewards_test.go
- blockSubscribe_test.go
- client.go
- client_test.go
- example_test.go
- fixes_test.go
- json.go
- logging.go
- logsSubscribe.go
- parsedBlockSubscribe.go
- programSubscribe.go
- programSubscribe_test.go
- rootSubscribe.go
- signatureSubscribe.go
- signatureSubscribe_test.go
- slotSubscribe.go
- slotsUpdatesSubscribe.go
- subscription.go
- types.go
- types_test.go
- voteSubscribe.go
- client-with-ratelimit.go
- client-with-ratelimit2.go
- client.go
- client_constructors_test.go
- client_test.go
- endpoints.go
- errors.go
- example_test.go
- getAccountInfo.go
- getAccountInfoWithRpcContext.go
- getBalance.go
- getBlock.go
- getBlockCommitment.go
- getBlockHeight.go
- getBlockProduction.go
- getBlocks.go
- getBlocksWithLimit.go
- getBlockTime.go
- getClusterNodes.go
- getEpochInfo.go
- getEpochSchedule.go
- getFeeForMessage.go
- getFirstAvailableBlock.go
- getGenesisHash.go
- getHealth.go
- getHighestSnapshotSlot.go
- getIdentity.go
- getInflationGovernor.go
- getInflationRate.go
- getInflationReward.go
- getLargestAccounts.go
- getLatestBlockhash.go
- getLeaderSchedule.go
- getMaxRetransmitSlot.go
- getMaxShredInsertSlot.go
- getMinContextSlot_test.go
- getMinimumBalanceForRentExemption.go
- getMultipleAccounts.go
- getParsedTransaction.go
- getProgramAccounts.go
- getRecentPerformanceSamples.go
- getRecentPrioritizationFees.go
- getSignaturesForAddress.go
- getSignatureStatuses.go
- getSlot.go
- getSlotLeader.go
- getSlotLeaders.go
- getStakeMinimumDelegation.go
- getSupply.go
- getTokenAccountBalance.go
- getTokenAccountsByDelegate.go
- getTokenAccountsByOwner.go
- getTokenLargestAccounts.go
- getTokenSupply.go
- getTransaction.go
- getTransactionCount.go
- getTransactionsForAddress.go
- getTransactionsForAddress_test.go
- getVersion.go
- getVoteAccounts.go
- isBlockhashValid.go
- json.go
- json_bench_test.go
- logging.go
- minimumLedgerSlot.go
- requestAirdrop.go
- rpc_test.go
- sendEncodedTransaction.go
- sendRawTransaction.go
- sendTransaction.go
- simulateTransaction.go
- simulateTransaction_test.go
- transaction_version.go
- types.go
- types_test.go
- util.go
- util_bench_test.go
- util_test.go
- clock.go
- epoch_rewards.go
- epoch_schedule.go
- fees.go
- ids.go
- last_restart_slot.go
- recent_blockhashes.go
- rent.go
- slot_hashes.go
- slot_history.go
- stake_history.go
- sysvar_codec.go
- sysvars_test.go
- standard.solana-keygen.json
- format.go
- codes.go
- encoder.go
- encoder_test.go
- interface.go
- rgbterm.go
- tag.go
- tools.go
- tools_test.go
- tree.go
- types.go
- json.go
- kmsgcp.go
- kmsmanager.go
- passphrase.go
- passphrase_test.go
- secretboxer.go
- vault.go
- encoder.go
- utils.go
- .envrc
- .gitignore
- .golangci.yml
- .goreleaser.yml
- account.go
- account_test.go
- base58_bench_test.go
- CHANGELOG.md
- constants.go
- CONTRIBUTING.md
- fee_calculator.go
- generic_instruction.go
- generic_instruction_test.go
- go.mod
- go.sum
- init_test.go
- interface.go
- json.go
- keys.go
- keys_test.go
- LICENSE
- logging.go
- message.go
- message_bench_test.go
- message_test.go
- message_v0_test.go
- mnemonic.go
- mnemonic_test.go
- nativetype_test.go
- nativetypes.go
- nonce.go
- nonce_test.go
- program_ids.go
- README.md
- registry.go
- registry_test.go
- sanitize.go
- sanitize_test.go
- sysvar.go
- transaction.go
- transaction_bench_test.go
- transaction_test.go
- transaction_v0_test.go
- types.go
- types_test.go
- util.go
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
fmt
View Details ▼
fmt
Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).
fmt {{path/to/file}}
Reformat a file:
fmt {{[-w|--width]}} {{n}} {{path/to/file}}
Reformat a file producing output lines of (at most) `n` characters:
fmt {{[-s|--split-only]}} {{path/to/file}}
Reformat a file without joining lines shorter than the given width together:
go get
View Details ▼
go get
Add a dependency package, or download packages in legacy GOPATH mode.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
go get {{example.com/pkg}}
Add a specified package to `go.mod` in module-mode or install the package in GOPATH-mode:
go get {{example.com/pkg}}@{{v1.2.3}}
Modify the package with a given version in module-aware mode:
go get {{example.com/pkg}}@{{none}}
Remove a specified package:
go test
View Details ▼
go test
Test Go packages (files have to end with `_test.go`).
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
go test
Test the package found in the current directory:
go test -v
[v]erbosely test the package in the current directory:
go test -v ./...
Test the packages in the current directory and all subdirectories:
golangci-lint
View Details ▼
golangci-lint
Parallelized, smart, and fast Go linters runner that integrates with all major IDEs and supports YAML configuration.
golangci-lint run
Run linters in the current folder:
golangci-lint linters
List enabled and disabled linters (Note: Disabled linters are shown last, do not mistake them for enabled ones):
golangci-lint run {{[-E|--enable]}} {{linter}}
Enable a specific linter for this run:
time
View Details ▼
time
Measure how long a command took to run.
Note: `time` can either exist as a shell builtin, a standalone program, or both.
See also: `times`.
time {{command}}
Run the `command` and print the time measurements to `stdout`:
time
Display the current system time and prompt to enter a new time (leave empty to keep unchanged):
time read
Create a very simple stopwatch (only works in Bash):
timeout
View Details ▼
timeout
Run a command with a time limit.
timeout 3s sleep 10
Run `sleep 10` and terminate it after 3 seconds:
timeout {{[-s|--signal]}} {{INT|HUP|KILL|...}} {{5s}} {{sleep 10}}
Send a signal to the command after the time limit expires (`TERM` by default, `kill -l` to list all signals):
timeout {{[-v|--verbose]}} {{0.5s|1m|1h|1d|...}} {{command}}
Send verbose output to `stderr` showing signal sent upon timeout:
rpcClient
View Details ▼
rpcClient
MS-RPC client tool (part of the samba suite).
rpcclient {{[-U|--user]}} {{domain}}\{{username}}%{{password}} {{ip_address}}
Connect to a remote host:
rpcclient {{[-U|--user]}} {{username}} {{[-W|--workgroup]}} {{domain}} {{[-N|--no-pass]}} {{ip_address}}
Connect to a remote host on a domain without a password:
rpcclient {{[-U|--user]}} {{domain}}\{{username}} --pw-nt-hash {{ip_address}}
Connect to a remote host, passing the password hash:
net
View Details ▼
net
System utility to view and modify network-related settings.
net {{start|stop}} {{service}}
Start or stop a Windows service synchronously:
net use {{\\smb_shared_folder}} /USER:{{username}}
Make sure an SMB share is available in the current console:
net share
Show the folders currently shared over SMB:
