Add travis

This commit is contained in:
armaniferrante 2021-08-04 14:18:09 -07:00
parent 274b27ef38
commit 239643edb8
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
10 changed files with 1328 additions and 48 deletions

28
.travis.yml Normal file
View File

@ -0,0 +1,28 @@
dist: bionic
language: rust
rust:
- stable
env:
global:
- NODE_VERSION="v14.7.0"
- SOLANA_VERSION="v1.7.8"
git:
submodules: true
_defaults: &defaults
before_install:
- nvm install $NODE_VERSION
- sudo apt-get install -y pkg-config build-essential libudev-dev
- sh -c "$(curl -sSfL https://release.solana.com/${SOLANA_VERSION}/install)"
- export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
- export NODE_PATH="/home/travis/.nvm/versions/node/${NODE_VERSION}/lib/node_modules/:${NODE_PATH}"
- yes | solana-keygen new
- yarn
jobs:
include:
- <<: *defaults
name: Builds and runs the tests
script:
- yarn build
- yarn test

View File

@ -7,4 +7,4 @@ address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
program = "./deps/serum-dex/dex/target/deploy/serum_dex.so"
[scripts]
test = "mocha -t 1000000 tests/"
test = "mocha -t 1000000 tests/"

60
Cargo.lock generated
View File

@ -25,8 +25,9 @@ checksum = "6b2d54853319fd101b8dd81de382bcbf3e03410a64d8928bbee85a3e7dcde483"
[[package]]
name = "anchor-attribute-access-control"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae964f681f54c3d22b5ac5462479ded57f92673fe40f455801575303240eea2f"
dependencies = [
"anchor-syn",
"anyhow",
@ -38,8 +39,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-account"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df4d32736c808095ca627d1cd9e0725abe7686feedda76b80c65cc710cda0305"
dependencies = [
"anchor-syn",
"anyhow",
@ -50,8 +52,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-error"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a897e35e5dfff00b555860135b8878f2d9fd13dcf3b87a8399a70bbebc12cee2"
dependencies = [
"anchor-syn",
"proc-macro2",
@ -61,8 +64,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-event"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccab903d0a7179ff6cbe679814d7f4a1990f5d40c01d7f5c00a40cf12b8f03c1"
dependencies = [
"anchor-syn",
"anyhow",
@ -73,8 +77,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-interface"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d819f2b0b2c497405efb4c279a9a68306bcdfc77c03d27e22089142f73a623"
dependencies = [
"anchor-syn",
"anyhow",
@ -86,8 +91,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-program"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81c5fd17b9d434cf21e1dc973aad5559994e4c137dff621ce32c9d02a126058c"
dependencies = [
"anchor-syn",
"anyhow",
@ -98,8 +104,9 @@ dependencies = [
[[package]]
name = "anchor-attribute-state"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7013e42ebb64b0bd23dc7ff84d6d992e4c2ddf3a3075d8dca64eec2db0560ec7"
dependencies = [
"anchor-syn",
"anyhow",
@ -110,8 +117,9 @@ dependencies = [
[[package]]
name = "anchor-derive-accounts"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0b03c4bfb1082ff829a41668f01df7960536d3f9b5cdd12731c7e5b6cb0d78b"
dependencies = [
"anchor-syn",
"anyhow",
@ -122,8 +130,9 @@ dependencies = [
[[package]]
name = "anchor-lang"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "170c69a2f7225de9348588c57c4ea036aa573582fcbc66b4b6ff296273abb216"
dependencies = [
"anchor-attribute-access-control",
"anchor-attribute-account",
@ -143,8 +152,9 @@ dependencies = [
[[package]]
name = "anchor-spl"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f68aead67169687e9ba797948b4234db148b36a8632bfffb461e0ff063145503"
dependencies = [
"anchor-lang",
"lazy_static",
@ -155,8 +165,9 @@ dependencies = [
[[package]]
name = "anchor-syn"
version = "0.11.1"
source = "git+https://github.com/project-serum/anchor#1bea1bcbfc078fb39b90df99ff5c73a007c70d29"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d796d34f7ce1cc49a2d2aeeff758fe94f1a1880b044374aa8a88893303564a22"
dependencies = [
"anyhow",
"bs58",
@ -963,8 +974,9 @@ dependencies = [
[[package]]
name = "serum_dex"
version = "0.3.1"
source = "git+https://github.com/project-serum/serum-dex#1527aa7f9617561bd24f7f79ceff731136c3285c"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02705854bae4622e552346c8edd43ab90c7425da35d63d2c689f39238f8d8b25"
dependencies = [
"arrayref",
"bincode",

View File

@ -1,13 +0,0 @@
.PHONY: test build build-deps build-dex localnet
test: build
anchor test
build: build-dex
anchor build
build-dex:
cd deps/serum-dex/dex/ && cargo build-bpf && cd ../../../
localnet: build
./scripts/localnet.sh

View File

@ -30,15 +30,24 @@ git submodule init
git submodule update
```
### Build
### Install Dependencies
[Anchor](https://github.com/project-serum/anchor) is used for developoment, and it's
recommended workflow is used here. To get started, see the [guide](https://project-serum.github.io/anchor/getting-started/introduction.html).
Verify the installation with `anchor -h` and build the dex.
To install Anchor and all local dependencies, run
```
make build-dex
yarn
```
### Build
To build, run
```
yarn build
```
### Test
@ -47,7 +56,7 @@ A set of integration tests are provided. See these for an example of how to use
permissioned market from JavaScript.
```bash
make test
yarn test
```
### Localnet
@ -56,13 +65,13 @@ To start a localnetwork with both the dex and proxy deployed and an orderbook
listed with posted orders, first install the "crank" cli.
```
cargo install --git https://github.com/project-serum/serum-dex --branch armani/auth crank --locked
cargo install --git https://github.com/project-serum/serum-dex crank --locked --tag v0.4.0
```
Then run,
```bash
make localnet
yarn localnet
```
### Connect a GUI

33
package.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "permissioned-markets-quickstart",
"version": "1.0.0",
"description": "This repo demonstrates how to create \"permissioned markets\" on Serum via a proxy smart contract. A permissioned market is a regular Serum market with an additional open orders authority, which must sign every transaction to create an open orders account.",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "anchor test",
"localnet": "./scripts/localnet.sh",
"build": "yarn build:dex && anchor build",
"build:dex": "cd deps/serum-dex/dex/ && cargo build-bpf && cd ../../../"
},
"repository": {
"type": "git",
"url": "git+https://github.com/project-serum/permissioned-markets-quickstart.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/project-serum/permissioned-markets-quickstart/issues"
},
"homepage": "https://github.com/project-serum/permissioned-markets-quickstart#readme",
"devDependencies": {
"@project-serum/anchor": "^0.12.0",
"@project-serum/anchor-cli": "^0.12.0",
"@project-serum/common": "^0.0.1-beta.3",
"@project-serum/serum": "^0.13.55",
"@solana/spl-token": "^0.1.6",
"mocha": "^9.0.3"
}
}

View File

@ -15,6 +15,6 @@ cpi = ["no-entrypoint"]
default = []
[dependencies]
anchor-lang = { git = "https://github.com/project-serum/anchor" }
anchor-spl = { git = "https://github.com/project-serum/anchor" }
anchor-lang = "0.12.0"
anchor-spl = "0.12.0"
solana-program = "=1.7.8"

View File

@ -26,7 +26,7 @@ PAYER_FILEPATH="$HOME/.config/solana/id.json"
#
CRANK=$(which crank)
if [ $? -ne 0 ]; then
CRANK="/home/armaniferrante/Documents/code/src/github.com/project-serum/permissioned-markets-quickstart/deps/serum-dex/target/debug/crank"
CRANK="<your-crank-path-here>"
fi
LOG_DIR="./localnet-logs"

View File

@ -10,7 +10,7 @@ const {
Logger,
ReferralFees,
MarketProxyBuilder,
} = require("/home/armaniferrante/Documents/code/src/github.com/project-serum/serum-ts/packages/serum");
} = require("@project-serum/serum");
// Returns a client for the market proxy.
//

1211
yarn.lock Normal file

File diff suppressed because it is too large Load Diff