-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an example program which stores simple DNS records as compressed accounts. It consists of the following endpoints: - create - update - delete Currently it has only Rust SBF tests. Co-authored-by: Michal Rostecki <vadorovsky@protonmail.com>
- Loading branch information
1 parent
d2e0e46
commit 4e6241d
Showing
17 changed files
with
723 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
2 changes: 1 addition & 1 deletion
2
cli/accounts/nullifier_queue_pubkey_44J4oDXpjPAbzHCSc24q7NEiPekss4sAbLd8ka4gd9CZ.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
.anchor | ||
.DS_Store | ||
target | ||
**/*.rs.bk | ||
node_modules | ||
test-ledger | ||
.yarn |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
.anchor | ||
.DS_Store | ||
target | ||
node_modules | ||
dist | ||
build | ||
test-ledger |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[toolchain] | ||
|
||
[features] | ||
seeds = false | ||
skip-lint = false | ||
|
||
[programs.localnet] | ||
name_service = "7yucc7fL3JGbyMwg4neUaenNSdySS39hbAk89Ao3t1Hz" | ||
|
||
[registry] | ||
url = "https://api.apr.dev" | ||
|
||
[provider] | ||
cluster = "Localnet" | ||
wallet = "~/.config/solana/id.json" | ||
|
||
[scripts] | ||
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Name Service program example |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Migrations are an early feature. Currently, they're nothing more than this | ||
// single deploy script that's invoked from the CLI, injecting a provider | ||
// configured from the workspace's Anchor.toml. | ||
|
||
const anchor = require("@coral-xyz/anchor"); | ||
|
||
module.exports = async function (provider) { | ||
// Configure client to use the provider. | ||
anchor.setProvider(provider); | ||
|
||
// Add your deploy script here. | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"scripts": { | ||
"lint:fix": "prettier \"*/**/*{.js,.ts}\" -w", | ||
"lint": "prettier \"*/**/*{.js,.ts}\" --check", | ||
"test": "cargo test-sbf -p name-service -- --test-threads 1" | ||
}, | ||
"dependencies": { | ||
"@coral-xyz/anchor": "^0.29.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"mocha": "^9.0.3", | ||
"ts-mocha": "^10.0.0", | ||
"@types/bn.js": "^5.1.0", | ||
"@types/chai": "^4.3.0", | ||
"@types/mocha": "^9.0.0", | ||
"typescript": "^4.3.5", | ||
"prettier": "^2.6.2" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[package] | ||
name = "name-service" | ||
version = "0.1.0" | ||
description = "Created with Anchor" | ||
edition = "2021" | ||
rust-version = "1.75.0" | ||
license = "Apache-2.0" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "name_service" | ||
|
||
[features] | ||
no-entrypoint = [] | ||
no-idl = [] | ||
no-log-ix-name = [] | ||
cpi = ["no-entrypoint"] | ||
custom-heap = ["light-heap"] | ||
default = ["custom-heap"] | ||
test-sbf = [] | ||
bench-sbf = [] | ||
|
||
[dependencies] | ||
anchor-lang = { workspace = true, features = ["init-if-needed"] } | ||
borsh = "0.10" | ||
light-compressed-token = { path = "../../../../programs/compressed-token", version = "0.5.0", features = ["cpi"] } | ||
light-system-program = { path = "../../../../programs/system", version = "0.5.0", features = ["cpi"]} | ||
account-compression = { path = "../../../../programs/account-compression", version = "0.5.0", features = ["cpi"] } | ||
light-hasher = { path = "../../../../merkle-tree/hasher", version = "0.3.0" } | ||
light-heap = { path = "../../../../heap", version = "0.3.0", optional = true } | ||
light-macros = { path = "../../../../macros/light", version = "0.5.0" } | ||
light-utils = { path = "../../../../utils", version = "0.3.0" } | ||
light-verifier = { path = "../../../../circuit-lib/verifier", version = "0.3.0" } | ||
|
||
[target.'cfg(not(target_os = "solana"))'.dependencies] | ||
solana-sdk = "1.18.11" | ||
|
||
[dev-dependencies] | ||
light-test-utils = { path = "../../../../test-utils", version = "0.3.0" } | ||
solana-program-test = "1.18.11" | ||
tokio = "1.36.0" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.bpfel-unknown-unknown.dependencies.std] | ||
features = [] |
Empty file.
Oops, something went wrong.