This commit is contained in:
Conner Gallagher 2022-05-20 12:44:41 -06:00
parent b0e1641800
commit 179b22a901
4 changed files with 10 additions and 45 deletions

View File

@ -10,6 +10,7 @@ A monorepo containing APIs, Utils, and examples for Switchboard V2.
| ---------------------------------------------- | ------------------------------------------------------------- |
| [Typescript](./libraries/ts) | Typescript client to interact with Switchboard V2. |
| [Typescript **_Lite_**](./libraries/sbv2-lite) | Typescript "Lite" client to deserialize aggregator accounts |
| [Sbv2 Utils](./libraries/sbv2-utils) | Typescript library with helpful utility functions |
| [Python](./libraries/py) | Python client to interact with Switchboard V2. |
| [Rust](./libraries/rs) | Rust client to interact with Switchboard V2. |
| [CLI](./cli) | Command Line Interface (CLI) to interact with Switchboard V2. |
@ -41,30 +42,11 @@ A monorepo containing APIs, Utils, and examples for Switchboard V2.
## Setup
### Typescript Setup
```
yarn install
yarn workspaces run build
yarn workspace @switchboard-xyz/switchboardv2-cli link
```
### Rust Setup
The following command will build the anchor projects and update the program IDs
```
anchor build
node scripts/setup-example-programs
anchor test
```
### Python Setup
```
pip install poetry
cd libraries/py
poetry install
anchor build && node ./scripts/setup-example-programs.js
```
### Localnet Testing Setup
@ -72,30 +54,16 @@ poetry install
You may wish to run your own oracle for integration test. The following command will create a devnet Switchboard environment and output a `Switchboard.env` file to assist copying
```
sbv2 localnet:env --keypair ../payer-keypair.json
chmod +x ./start-local-validator.sh && chmod +x ./start-oracle.sh
sbv2 localnet:env --keypair ../payer-keypair.json -o .switchboard
```
## Test
### Libraries
```
yarn test:libraries
```
### Programs
```
sbv2 localnet:env --keypair ../payer-keypair.json
chmod +x ./start-local-validator.sh && chmod +x ./start-oracle.sh
```
Set the _[provider.cluster]_ in `Anchor.toml` to localnet.
Run each of the commands in a separate shell
- `./start-local-validator.sh`
- `./start-oracle.sh`
- `yarn test:anchor`
- `./.switchboard/start-local-validator.sh`
- `./.switchboard/start-oracle.sh`
- `anchor test --skip-local-validator`
## Website

View File

@ -84,8 +84,7 @@
"test": "echo \"No test script for @switchboard-xyz/switchboardv2-cli\" && exit 0",
"version": "oclif-dev readme && git add README.md",
"fmt": "prettier --write 'src/**/*.ts'",
"lint": "eslint . --ext .ts --config .eslintrc.json --fix",
"postpublish": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag \"sbv2-cli/v$PACKAGE_VERSION\" && git push --tags"
"lint": "eslint . --ext .ts --config .eslintrc.json --fix"
},
"dependencies": {
"@google-cloud/secret-manager": "^3.10.1",

View File

@ -24,8 +24,7 @@
"docgen": "yarn build && npx typedoc",
"build": "shx rm -rf lib && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts'",
"prepublishOnly": "yarn build && yarn test",
"postpublish": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag sbv2-lite/v$PACKAGE_VERSION && git push --tags"
"prepublishOnly": "yarn build && yarn test"
},
"author": "",
"license": "ISC",

View File

@ -25,8 +25,7 @@
"docgen": "yarn build && npx typedoc",
"build": "shx rm -rf lib tsconfig.tsbuildinfo && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && shx echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json && shx echo '{\"type\": \"module\"}' > lib/esm/package.json",
"test": "mocha --extension ts --require ts-node/register -t 1000000 tests/",
"prepublishOnly": "npm run build && npm version patch --force",
"postpublish": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag sbv2-ts/v$PACKAGE_VERSION && git push --tags"
"prepublishOnly": "npm run build && npm version patch --force"
},
"peerDependencies": {
"@solana/spl-governance": "^0.0.34",