Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of small fixes #24

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f3d97e9
Change svelte devnet references to localhost
mikemaccana Jun 4, 2023
a4edead
Change devnet to localnet in Anchor.toml
mikemaccana Jun 4, 2023
c1c6e44
Fix wallet location in Anchor.toml
mikemaccana Jun 4, 2023
c6de85b
Fix Svelte language server warning
mikemaccana Jun 4, 2023
d309c27
Run npm audit fix to fix security warnings when installating
mikemaccana Jun 4, 2023
3ee6e81
Use npm everywhere, fix audit warnings on install.
mikemaccana Jun 4, 2023
ea3560b
Fix README, Anchor.toml uses 'localnet' not 'localhost' because Ancho…
mikemaccana Jun 4, 2023
b765c60
Minor README tweaks
mikemaccana Jun 4, 2023
ee47786
Minor README fixes
mikemaccana Jun 4, 2023
895df02
Fix 'clusterApiUrl('localhost')' - there is no URL for localhost
mikemaccana Jun 4, 2023
f6982fd
Remove Slope, it's now unsupported and hacked
mikemaccana Jun 4, 2023
5c253a0
Don't log undefined
mikemaccana Jun 4, 2023
8993b69
Fix README: since defaults in project in this PR are now localhost
mikemaccana Jun 4, 2023
3208004
fixup layout.svelte
mikemaccana Jun 4, 2023
d320dfd
Prettier only
mikemaccana Jun 4, 2023
b283358
Silence Svelte accessibility warnings
mikemaccana Jun 4, 2023
a03da03
Bump anchor
mikemaccana Jun 4, 2023
9642b95
Add instructions to configure a wallet to use localhost
mikemaccana Jun 4, 2023
c0f838d
Make log message less mysterious
mikemaccana Jun 4, 2023
8c3e5bf
Fix button being off to the side
mikemaccana Jun 4, 2023
7728990
Silence TS deprecation warnings
mikemaccana Jun 4, 2023
47cf152
More updates to fix TypeScript deprecation warnings
mikemaccana Jun 4, 2023
b4e3141
Bump wallet-adapter-base and wallet-adapter-wallets
mikemaccana Jun 4, 2023
beb35a8
Bump @svelte-on-solana/wallet-adapter-ui
mikemaccana Jun 4, 2023
e23d741
Add Troubleshooting section to README
mikemaccana Jun 4, 2023
d85478c
Fix Svelte log not running when value changed
mikemaccana Jun 4, 2023
f49579c
Minor grammar fix
mikemaccana Jun 4, 2023
7511ec4
Remove 'warning' when not connected
mikemaccana Jun 4, 2023
89d4e5a
Don't jump around on mobile
mikemaccana Jun 4, 2023
7b6332a
Style the status area (seperate from when it's a warning)
mikemaccana Jun 4, 2023
cc8d967
Minor docs improvements
mikemaccana Jun 5, 2023
547fbaa
Bump Svelte
mikemaccana Jun 5, 2023
a5a194f
Remove remaining lib references
mikemaccana Jun 5, 2023
23947ad
Update lockfile
mikemaccana Jun 6, 2023
9552d17
Notes only
mikemaccana Jun 6, 2023
1186af3
Upgrade vite and SvelteKit
mikemaccana Jun 6, 2023
bb8ebbe
Remove template dir
mikemaccana Jun 6, 2023
b483963
Docs: Solana doesn't call on-chain apps 'smart contracts'
mikemaccana Jun 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[programs.devnet]
[programs.localnet]
solana_svelte_counter = "C7SGr2s3HdBuEveTahL9H3CsXQDwxkYEUSRPeJAVeDN5"

[registry]
url = "https://anchor.projectserum.com"

[provider]
cluster = "devnet"
wallet = "/Users/silvestrevivo/.config/solana/id.json"
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "mocha -t 1000000 tests/"
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# solana-svelte-counter

**Anchor/SvelteKit** application to demo the Svelte wallet adapter. The Anchor application lives in the `root folder`. In the `app` folder you can find the SvelteKit application.
**Anchor/SvelteKit** application to demo the Svelte wallet adapter.

The Anchor application lives in the root of the project.

The SvelteKit application lives in the `app` folder.

## Anchor Setup

You need to have Cargo and Rust installed to build the contract. First of all, clone the repo and run `yarn install` to add all the dependencies to the Anchor application. Make sure that you have Solana locally in `localhost` and change all the **`devnet`** references to `localhost`. Once that is done, to `build` and `deploy` locally the project run the next command:
Make sure that you have [installed Solana CLI tools locally](https://docs.solana.com/cli/install-solana-cli-tools).

You need to have Cargo and Rust installed to build the on-chain app.

First of all, clone the repo and run `npm install` to add all the dependencies to the Anchor application.

To build and deploy the project locally, run the command:

```
anchor localnet
npx anchor localnet
```

This command is going to generate the `idl json` file responsible to communicate with the **rpc** from Solana.
This command is going to generate the `idl json` file responsible for communicating with the **RPC** from Solana.

## Frontend setup

Expand All @@ -21,3 +31,23 @@ cd app
npm install
npm run dev
```

## Wallet localhost setup

You will also need to configure your installed wallet to work with localhost. For example, in Solflare:

`⚙️` > `Network` > `Add custom node +` then add `localnet` with the address `http://127.0.0.1:8899`.

### Troubleshooting

If, after hitting 'Create Counter' you recieve a console error about:

> Attempt to debit an account but found no record of a prior credit.

You will need to [Airdrop your wallet some tokens on your localhost RPC](https://docs.solana.com/cli/transfer-tokens).

Eg:

```
solana airdrop 1 <your wallet address>
```
Loading