sdk/geolocation: add Go SDK for geolocation program#3025
Closed
sdk/geolocation: add Go SDK for geolocation program#3025
Conversation
ae5246b to
72c5675
Compare
72c5675 to
151e520
Compare
Contributor
Author
|
This has been split into PR #3179 and PR#3180 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #3011
Summary of Changes
doublezero-geolocationSolana program, providing instruction builders, state deserialization, PDA derivation, and an RPC clientInitProgramConfig,UpdateProgramConfig,CreateGeoProbe,UpdateGeoProbe,DeleteGeoProbe,AddParentDevice,RemoveParentDeviceGeolocationProgramConfigandGeoProbeaccounts, with field layout matching the Rust onchain structsClientwith read methods (GetProgramConfig,GetGeoProbeByCode,GetGeoProbes) and write methods for all instructionsDiff Breakdown
All new code — 43% core logic, 57% tests.
Key files (click to expand)
client.go— High-level SDK client with read/write methods for all geolocation accounts and instructionsexecutor.go— Transaction executor with blockhash fetching, signing, submission, and finalization pollingstate.go— Borsh serialization/deserialization forGeolocationProgramConfigandGeoProbestate structscreate_geo_probe.go— CreateGeoProbe instruction builder with validation and account metasupdate_geo_probe.go— UpdateGeoProbe instruction builder with optional fields (IP, port, metrics publisher)add_parent_device.go— AddParentDevice instruction builderremove_parent_device.go— RemoveParentDevice instruction builder with device pubkey in instruction dataconstants.go— Instruction discriminant indices, PDA seeds, and validation limitsTesting Verification