Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/briangershon/solana-anchor-client-start
This project demonstrates the TypeScript code needed to call a live deployed Solana program built with the Anchor framework.
https://github.com/briangershon/solana-anchor-client-start
anchor solana solana-program starter-template typescript
Last synced: about 1 month ago
JSON representation
This project demonstrates the TypeScript code needed to call a live deployed Solana program built with the Anchor framework.
- Host: GitHub
- URL: https://github.com/briangershon/solana-anchor-client-start
- Owner: briangershon
- License: mit
- Created: 2022-09-11T22:56:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-12T03:47:24.000Z (over 2 years ago)
- Last Synced: 2024-11-13T03:18:25.877Z (3 months ago)
- Topics: anchor, solana, solana-program, starter-template, typescript
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# solana-anchor-client-start
This project demonstrates the code needed to call a live deployed Solana program built with the [Anchor](https://github.com/coral-xyz/anchor) framework.
There are many examples of how to use the Anchor framework when building your own program, though often you may want to call existing program on the Solana blockchain.
Here's a good place to start.
This project demonstrates:
- connecting to Solana network
- automatically downloading a program's interface (IDL)
- calling the program from a Node-based TypeScript program (though this same code will run in the front-end as well)## What program are we going to call?
The Solana program we'll call is a basic Clicker game. The complete project is at .
This example code will download all the Clicker games played. Each game includes the player's publicKey and their score ("number of clicks").
```
First 3 Solana Clicker games:[
{
"playerPublicKey": "8QzheFjSyu5Lk9a8u9sj9Nm2WDofm3ru28w4amBXokpC",
"clicks": 0
},
{
"playerPublicKey": "2CT3GsMffomxM132NEzWgDH7Efa7PtQR14HKudJohEmF",
"clicks": 4
},
{
"playerPublicKey": "GFC2jtciuWfgxZ7WoA9xwxkr6ZbXS1cPg3rWw36KMbqR",
"clicks": 1
}
]
```## How to run
1. Copy `.env.sample` to `.env` and add a Solana Provider pointing to devnet. An example provider is Alchemy.com.
2. Run `npm start`.