https://github.com/xandkar/solana-ping-pong
Illustrates a protocoled communication between client and program. Client in Rust.
https://github.com/xandkar/solana-ping-pong
Last synced: 7 months ago
JSON representation
Illustrates a protocoled communication between client and program. Client in Rust.
- Host: GitHub
- URL: https://github.com/xandkar/solana-ping-pong
- Owner: xandkar
- License: bsd-3-clause
- Created: 2022-08-17T20:52:12.000Z (about 3 years ago)
- Default Branch: dominus
- Last Pushed: 2022-08-19T17:34:31.000Z (about 3 years ago)
- Last Synced: 2024-10-19T03:06:40.719Z (12 months ago)
- Language: Rust
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
solana ping pong
================In hello-world[1], the program simply logs that it has received something from
the client, but does nothing else, for any instruction data whatsoever.Here is a slight escalation in complexity, where the program reads the
specifics of the client request and writes a response into the client-provided
buffer account, which the client proceeds to read.Client sends a ping and the program responds with a pong, ad infinitum.
If all goes well, you should see output like this:
airdrop requesting.
airdrop confirming .....
airdrop done
buffer account creating
buffer account done
Ping(0) > < Pong(1)
Ping(2) > < Pong(3)
Ping(4) > < Pong(5)
Ping(6) > < Pong(7)
Ping(8) > < Pong(9)
Ping(10) > < Pong(11)
Ping(12) > < Pong(13)
Ping(14) > < Pong(15)
Ping(16) > < Pong(17)
Ping(18) > < Pong(19)
...[1]: https://github.com/xandkar/solana-hello-world/
build
-----make build
run
---### local
$ solana-test-validator&
$ make all### devnet
$ CLUSTER=dev make all
### testnet
$ CLUSTER=test make all