Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
57cffca
added closing tmp account
ananas-block Jun 1, 2022
8280e9d
removed warning
ananas-block Jun 2, 2022
be69f83
merged pull without fast-forward. updated gitignore, added cli/ dir
Jan 28, 2023
c09f1f6
Merge branch 'main' of github.com:Lightprotocol/light-protocol-onchain
Feb 12, 2023
4f29d40
added base cli layout
Jan 19, 2023
9e63294
olved merge conflicts in lockfiles taging
Jan 20, 2023
a6926aa
removed sdk-ts/lib folder, added cli staging
Jan 20, 2023
ce92bac
added: newwallet, register, login, todo: fetchutxos
Jan 20, 2023
bcd48b1
again removed light-sdk-ts/lib staging: built ts
Jan 21, 2023
92635ff
rm n Please enter the commit message for your changes. Lines starting
Jan 22, 2023
36fa655
rmd lib li cleanup, refactor
Jan 25, 2023
e3abd68
cli done: shield,unshield,etc. (TODO: transfer add shielded pubkey re…
Jan 25, 2023
6c15ea6
rm
Feb 12, 2023
07e0ef7
commands working, layout wise done TODO: debug onchain, debug: getut…
Jan 25, 2023
ad7d685
removed lookuptable.txt
Jan 27, 2023
44379f1
upd to yarn, debugging version mismatch - took current pckjsons (HEAD)
Jan 28, 2023
4ccbf53
added verifiertests
Feb 12, 2023
5cd4bae
shield, unshield non-SPL working. resolved merkletree build. TODO: tr…
Jan 31, 2023
7560a63
applied transaction rebase
Feb 12, 2023
0fba8b6
rebased tx
Feb 12, 2023
dac67a2
extended readme, log cleanup, rm some repeated calls
Feb 2, 2023
0600b1c
readme: /relayer wip
Feb 2, 2023
023f712
latest
Feb 2, 2023
f148882
cleanup
Feb 2, 2023
d838219
tmp merge tx
Feb 12, 2023
b87a29f
removed keypair import in buildbalance.ts
Feb 12, 2023
e104221
merged: .relayer -> .params.relayer ++ instance -> provider
Feb 12, 2023
48187a1
added verif0 -> provider.browserwallet err (is this required?)
Feb 12, 2023
43b3352
added verif1: wallet check (still required?) + functional_tests -> us…
Feb 12, 2023
77618c7
cli and onchain tests all running.
Feb 12, 2023
c4d63f5
Delete cli/node_modules directory
SwenSchaeferjohann Feb 12, 2023
b8be17d
Delete relayer/node_modules directory
SwenSchaeferjohann Feb 12, 2023
8533dd3
Update .gitignore
SwenSchaeferjohann Feb 12, 2023
c75cd8b
Delete cli/build directory
SwenSchaeferjohann Feb 12, 2023
36b412f
Delete lookUpTable.txt
SwenSchaeferjohann Feb 12, 2023
b72c6f1
upd readme exclude cli/lookupTable.txt
Feb 12, 2023
b35b380
Update .gitignore
SwenSchaeferjohann Feb 12, 2023
f73ee31
rm build folder
Feb 12, 2023
43e034f
update lib.rs - revert delete of #noentrypoint macro
SwenSchaeferjohann Feb 12, 2023
16febca
provider.ts - rm optional feepayer override
SwenSchaeferjohann Feb 12, 2023
62a1fee
.env.USER -> .env.HOME
Feb 13, 2023
9bffa5f
Merge branch 'swen-dev_v4-cli' of github.com:Lightprotocol/light-prot…
Feb 13, 2023
bfd66b6
tests runnign except for mockappverifier(doesnt compile either); stag…
Feb 13, 2023
3e13e8c
fixed up verifier tests
Feb 13, 2023
12aad82
upd packages missing in light-circuits, +upd gitignore to include lig…
Feb 14, 2023
4e9fef3
fixed security text usage in merkletree program
Feb 14, 2023
d20a1cd
build-sdk.sh script: no rm just overwrite with npm i; other minor cha…
Feb 15, 2023
61020e5
added mockProvider static method, tests running without test validato…
Feb 17, 2023
3894e6f
cli: rename /cache/ to /light-test-cache/ for less ambigous use with …
Feb 17, 2023
35dfdbe
renamed util (cli) to utils for naming consistency, upd readme todos …
Feb 17, 2023
fea0bee
adding: error throw /disable spl
Feb 17, 2023
77751a1
upd todos remove relayerrecipient airdrops
Feb 17, 2023
a236f87
Merge branch 'main' into swen-dev_v4-cli
ananas-block Feb 17, 2023
57083bd
added: prettier config files
Feb 18, 2023
79f847b
Merge branch 'swen-dev_v4-cli' of github.com:Lightprotocol/light-prot…
Feb 18, 2023
be23003
added: userclass tests (shield, transfer, unshield) into systemprogra…
Feb 18, 2023
9d41b6f
rm js files from tests
Feb 18, 2023
a1bb821
updated gitignore to exclude js ext in light-system-programs/tests/
Feb 18, 2023
e98de58
Delete package.json
ananas-block Feb 18, 2023
53ea66e
Delete lookUpTable.txt
ananas-block Feb 18, 2023
502fccc
Delete package-lock.json
ananas-block Feb 18, 2023
03c3fb0
Update .gitignore
ananas-block Feb 18, 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
53 changes: 37 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
/program/target
/program/Cargo.lock
*/.coderrect
/program/dist/program/*.so
*/*.so
test-ledger
/program/dist/
/program/docker-target
/test-ledger/
# CLI
/cli/node_modules/
/cli/build/
/cli/cache/secret.txt
/cli/cache/utxos.txt
/cli/cache/signature.txt
/cli/cache/user.txt
/cli/lookupTable.txt
/cli/build/cli.js
/cli/build/lookupTable.txt
*/light-test-cache/

/program_merkle_tree/target
/program_merkle_tree/Cargo.lock
/program_merkle_tree/dist/program/*.so

/program_merkle_tree/dist/
/program_merkle_tree/docker-target
groth16-solana/target
light-verifier-sdk/target
# relayer
/relayer/node_modules/

# light-sdk-ts
/light-sdk-ts/node_modules/
/light-sdk-ts/lib/
/light-sdk-ts/lookUpTable.txt

# light-system-programs
/light-system-programs/node_modules/
/light-system-programs/target/
/light-system-programs/tests/*.js

# light-verifier-sdk
/light-verifier-sdk/target/

# other
/groth16-solana/target
*/target/*
/anchor_programs/build/*
/anchor_programs/Light_Circuits/build/circuits/ptau17
light-sdk/node_modules/*
/light-system-programs/lookUpTable.txt
/groth16-solana/target/
*/target/*

# light-circuits
/light-circuits/node_modules/
/light-circuits/lookUpTable.txt
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ _Requirements:_
## Tests

_Global:_

- `sh test.sh`

_Rust tests:_

- `cd groth16-solana/`
- `cargo test`
- `cd light-verifier-sdk/`
- `cargo test`

_Sdk tests:_

- `cd light-sdk-ts/`
- `npm test`

_Circuit tests:_

- `cd light-circuits`
- `npm test`

Expand All @@ -46,19 +50,23 @@ The default test is a functional test, setting up a test environment with a merk
Tests can be executed in bulk or one by one.

**Without external validator:**

- `cd light-system-programs/`
- `npm test`
- `npm test-verifiers`
- `npm test-merkle-tree`


**Manual:**

- Assuming that your clones of `solana` and `light-protocol-onchain` git
repositories share the same parent directory and you are currently in the
`light-protocol-onchain` directory, launch a validator with the following
command:

1. cargo build in light-verifier-sdk (optional)
2. anchor build in light-system-programs
3. anchor build in mock-app-verifier

```
../solana/validator/solana-test-validator \
--reset \
Expand All @@ -74,3 +82,20 @@ Tests can be executed in bulk or one by one.
- `anchor test --skip-build --skip-deploy --skip-local-validator`

Check logs in anchor_programs/.anchor/program-logs
w

## Todos

### Swen

[ ] - add encryption to file storage (cli)

[ ] - "privamount" -> "shieldedAmount", 2 amounts passable w SPL support

[ ] - userTokenPda -> as variable input w SPL support

[ ] - relayer should recevie ixs instead of txs

[ ] - remove testaccountsetup fns (part of spl support)

[ ] - remove 2 airdrop checks for relayer recipient (currently randomly generated inside transfer/unshield), part of relayer activation
9 changes: 5 additions & 4 deletions build-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cd light-sdk-ts && npm run build & sleep 5 && kill $! && cd .. ;
cd light-circuits && rm node_modules/light-sdk/ -r && npm i && cd -;
cd light-system-programs && rm node_modules/light-sdk/ -r && npm i && cd -;
cd mock-app-verifier && rm node_modules/light-sdk/ -r && npm i && cd -;
cd light-sdk-ts && npm run build & sleep 5 && kill $! && cd ..;
cd light-circuits && npm i && cd -;
cd light-system-programs && npm i && cd -;
cd mock-app-verifier && npm i && cd -;

5 changes: 5 additions & 0 deletions cli/.prettierc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "all",
"tabWidth": 2,
"singleQuote": false
}
27 changes: 27 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### v3 CLI

- meant to replicate all typical uses of the Light SDK that any UI or wallet would implement too.
- /cli/src/commands -> UI
- build with `npx tsc`

- ./build/cli.js <command> <params> -flag

COMMANDS

initial setup:

./build/cli.js balance

consecutive:
./build/cli.js shield --amount=3 --token=SOL

./build/cli.js unshield --amount=1 --token=SOL --recipient=ErAe2LmEKgBNCSP7iA8Z6B396yB6LGCUjzuPrczJYDbz

./build/cli.js transfer --amount=1 --token=SOL --shieldedRecipient=19a20668193c0143dd96983ef457404280741339b95695caddd0ad7919f2d434 --encryptionPublicKey=LPx24bc92eecaf5e3904bc1f4f731a2b1e0a28adf445e800c4cff112eb7a3f5350b

### TODOs Swen

- [] enable SPL support
- [] implement relayer (/relayer) WIP, replace relayer 'mocks' in user class
- [] add test cases [e.g. merging >2 inUtxos, 10-in circuit, extend checkBalance() for multiple out-utxos]
- [] test-case with browser wallet instead of CLI
Loading