From 88554c4ff0cce11fbc1ad35bdcb3188738c0aba9 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 25 Oct 2023 11:42:20 -0700 Subject: [PATCH 01/12] Update references to use js-stellar-sdk --- events.ts | 25 ++++++++++++------------- invoke.ts | 31 ++++++++++++++++++------------- js-soroban-client/README.md | 19 ------------------- js-stellar-sdk/README.md | 18 ++++++++++++++++++ package.json | 1 + 5 files changed, 49 insertions(+), 45 deletions(-) delete mode 100644 js-soroban-client/README.md create mode 100644 js-stellar-sdk/README.md diff --git a/events.ts b/events.ts index 587cae4..44188be 100755 --- a/events.ts +++ b/events.ts @@ -1,8 +1,7 @@ #!/usr/bin/env ts-node-script import { ArgumentParser } from 'argparse'; -import * as SorobanClient from 'soroban-client'; -const xdr = SorobanClient.xdr; +import { xdr, Contract, SorobanRpc } from 'stellar-sdk'; async function main() { const parser = new ArgumentParser({ description: 'Get contract events' }) @@ -18,27 +17,27 @@ async function main() { ledgerFrom, } = parser.parse_args() as Record; - const server = new SorobanClient.Server(rpcUrl, { allowHttp: true }); + const server = new SorobanRpc.Server(rpcUrl, { allowHttp: true }); - let filters: SorobanClient.SorobanRpc.EventFilter[] = []; + let filters: SorobanRpc.Api.EventFilter[] = []; if (contractId != null) { filters.push({ - contractIds: [ new SorobanClient.Contract(contractId).contractId() ] + contractIds: [ new Contract(contractId).contractId() ] }); } - let response = await server - .getEvents({ - startLedger: Number(ledgerFrom), - filters: filters, - limit: Number(size)}); - + let response = await server.getEvents({ + startLedger: Number(ledgerFrom), + filters: filters, + limit: Number(size) + }); + if (!response.events) { throw new Error(`No events in response: ${JSON.stringify(response)}`); } - - console.log(JSON.stringify(response.events)); + + console.log(JSON.stringify(response.events)); } main().catch(err => { diff --git a/invoke.ts b/invoke.ts index 318e564..6b5e385 100755 --- a/invoke.ts +++ b/invoke.ts @@ -1,7 +1,16 @@ #!/usr/bin/env ts-node-script import { ArgumentParser } from 'argparse'; -import * as SorobanClient from 'soroban-client'; +import { + Contract, + Keypair, + TransactionBuilder, + SorobanRpc, + scValToNative, + xdr +} from 'stellar-sdk'; + +const { Server } = SorobanRpc; async function main() { const parser = new ArgumentParser({ description: 'Invoke a contract function' }) @@ -24,21 +33,18 @@ async function main() { functionName, } = parser.parse_args() as Record; - const contract = new SorobanClient.Contract(contractId); - const server = new SorobanClient.Server(rpcUrl, { allowHttp: true }); - const secretKey = SorobanClient.Keypair.fromSecret(source); + const contract = new Contract(contractId); + const server = new Server(rpcUrl, { allowHttp: true }); + const secretKey = Keypair.fromSecret(source); const account = secretKey.publicKey(); const sourceAccount = await server.getAccount(account); // Some hacky param-parsing as csv. Generated Typescript bindings would be better. - const params: SorobanClient.xdr.ScVal[] = []; - if (functionParams) { - functionParams.split(",").forEach((param) => { - params.push(SorobanClient.xdr.ScVal.scvSymbol(param)); - }); - } + const params: xdr.ScVal[] = (functionParams ?? []).split(",").map((param) => { + return xdr.ScVal.scvSymbol(param); + }); - const originalTxn = new SorobanClient.TransactionBuilder(sourceAccount, { + const originalTxn = new TransactionBuilder(sourceAccount, { fee: "100", networkPassphrase, }) @@ -66,8 +72,7 @@ async function main() { throw new Error(`No invoke host fn return value provided: ${JSON.stringify(response)}`); } - const scval:SorobanClient.xdr.ScVal = response.returnValue; - const parsed = SorobanClient.scValToNative(scval); + const parsed = scValToNative(response.returnValue); console.log(JSON.stringify(parsed)); return; } diff --git a/js-soroban-client/README.md b/js-soroban-client/README.md deleted file mode 100644 index 375eed3..0000000 --- a/js-soroban-client/README.md +++ /dev/null @@ -1,19 +0,0 @@ -This is a placeholder file only. - -the system-teset/js-soroban-client directory can be used if you want to build system-test -with a local file path for the js-soroban-client project rather than pulling it from remote -npm or gh ref. - -js-soroban-client$ `yarn build` - -then copy the entire js-soroban-client directory over the top of system-test/js-soroban-client, -or soft link the directories, but be careful in soft link case as you don't want to accidentally delete, etc. - -once you have the system-teset/js-soroban-client ready, then build system-test and trigger it to use with: - -``` -make .... JS_SOROBAN_CLIENT_NPM_VERSION=file:/home/tester/js-soroban-client build - -``` - -system-teset/js-soroban-client is copied to the `/home/tester/js-soroban-client` path in the docker image. diff --git a/js-stellar-sdk/README.md b/js-stellar-sdk/README.md new file mode 100644 index 0000000..de2fdc2 --- /dev/null +++ b/js-stellar-sdk/README.md @@ -0,0 +1,18 @@ +**This is a placeholder file only.** + +The `system-test/js-stellar-sdk` directory can be used if you want to build `system-test` with a local file path for the [stellar/js-stellar-sdk](https://github.com/stellar/js-stellar-sdk) project rather than pulling it from remote +npm or GitHub ref. Run, + +```bash +js-stellar-sdk$ yarn build +``` + +Then, copy the entire directory over the top of `system-test/js-stellar-sdk` (or soft link the directories, but be careful in the soft link case as you don't want to accidentally delete, etc.) + +Once you have the `system-test/js-stellar-sdk` ready, then build `system-test` and trigger it to use with: + +```bash +make .... JS_STELLAR_SDK_NPM_VERSION=file:/home/tester/js-stellar-sdk build +``` + +Then, `system-test/js-stellar-sdk` is copied to the `/home/tester/js-stellar-sdk` path in the docker image. diff --git a/package.json b/package.json index 855f94c..5018b0a 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "argparse": "^2.0.1", + "stellar-sdk": "^11.0.0-beta.4", "tslib": "^2.5.0", "typescript": "^4.9.5" }, From 30a86b035d588e282895fa14970c346d53cb16ea Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 25 Oct 2023 13:24:36 -0700 Subject: [PATCH 02/12] Rename references in Makefile, use later Go version --- CHANGELOG.md | 27 +++++++++++++++------------ Dockerfile | 30 +++++++++++++++--------------- Makefile | 14 +++++++------- package.json | 1 - 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b6d3d..f20eb01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # System Test Releases +#### Unreleased + +* js invocation upgraded to use [`stellar-sdk`](https://github.com/stellar/js-stellar-sdk) rather than the now-deprecated `soroban-client`. [system-test, #81](https://github.com/stellar/system-test/pull/81) + #### 1.0.19 * js verification of contract invoke results, compare as strings. [system-test, #68](https://github.com/stellar/system-test/pull/68) @@ -39,7 +43,7 @@ #### 1.0.9 -* Fix bug in NODEJS test invocation. [system-test, #46](https://github.com/stellar/system-test/pull/46) +* Fix bug in NODEJS test invocation. [system-test, #46](https://github.com/stellar/system-test/pull/46) #### 1.0.8 @@ -64,31 +68,31 @@ #### 1.0.5 -* Fixed `--TargetNetwork futurenet`, was incorrectly trying to configure artificial acceleration on core config also, which is only allowed on `standalone`. [system-test, #25](https://github.com/stellar/system-test/pull/25). +* Fixed `--TargetNetwork futurenet`, was incorrectly trying to configure artificial acceleration on core config also, which is only allowed on `standalone`. [system-test, #25](https://github.com/stellar/system-test/pull/25). -This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. +This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. #### 1.0.4 -* Fixed git ref resolution to detached head state when compiling soroban cli during image build [system-test, #23](https://github.com/stellar/system-test/pull/23), to build [Stellar Quickstart](https://github.com/stellar/quickstart). +* Fixed git ref resolution to detached head state when compiling soroban cli during image build [system-test, #23](https://github.com/stellar/system-test/pull/23), to build [Stellar Quickstart](https://github.com/stellar/quickstart). -This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. +This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. #### 1.0.3 -* Modified test framework, [system-test, #21](https://github.com/stellar/system-test/pull/21), to build [Stellar Quickstart](https://github.com/stellar/quickstart) as the base image. -Refer to [README.md](https://github.com/stellar/system-test#readme) for new two step process of running tests: -(1) run make with server versions, creates docker image -(2) run the docker image to run tests. +* Modified test framework, [system-test, #21](https://github.com/stellar/system-test/pull/21), to build [Stellar Quickstart](https://github.com/stellar/quickstart) as the base image. +Refer to [README.md](https://github.com/stellar/system-test#readme) for new two step process of running tests: +(1) run make with server versions, creates docker image +(2) run the docker image to run tests. -This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. +This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces. #### 1.0.2 * Modified tests to follow the new dynamic args format on cli [soroban-tools, #307](https://github.com/stellar/soroban-tools/pull/307) -This version of tests is based on [Soroban Preview 6](https://soroban.stellar.org/docs/releases#preview-6-january-9th-2023) system interfaces, combined with the additional change applied on top of dynamic args in cli `contract invoke` +This version of tests is based on [Soroban Preview 6](https://soroban.stellar.org/docs/releases#preview-6-january-9th-2023) system interfaces, combined with the additional change applied on top of dynamic args in cli `contract invoke` #### 1.0.1 @@ -105,4 +109,3 @@ First release of packaged system tests. Initial focus is on Soroban e2e cases us * DApp developer compiles, deploys and invokes a contract This version of tests execute the [Soroban Preview 5](https://soroban.stellar.org/docs/releases#preview-5-december-8th-2022) system interfaces only. - diff --git a/Dockerfile b/Dockerfile index 3bca29a..a455ee2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ ARG QUICKSTART_IMAGE_REF=stellar/quickstart:soroban-dev ARG SOROBAN_CLI_IMAGE_REF=stellar/system-test-soroban-cli:dev -FROM golang:1.20 as go +FROM golang:1.21 as go -RUN ["mkdir", "-p", "/test"] -RUN ["mkdir", "-p", "/test/bin"] +RUN ["mkdir", "-p", "/test"] +RUN ["mkdir", "-p", "/test/bin"] WORKDIR /test ADD go.mod go.sum ./ @@ -13,7 +13,7 @@ ADD e2e.go ./ ADD features ./features # build each feature folder with go test module. -# compiles each feature to a binary to be executed, +# compiles each feature to a binary to be executed, # and copies the .feature file with it for runtime. RUN go test -c -o ./bin/dapp_develop_test.bin ./features/dapp_develop/... ADD features/dapp_develop/dapp_develop.feature ./bin @@ -30,7 +30,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y build-essential expect git && apt-get clean # Install Rust -RUN ["mkdir", "-p", "/rust"] +RUN ["mkdir", "-p", "/rust"] ENV CARGO_HOME=/rust/.cargo ENV RUSTUP_HOME=/rust/.rust ENV RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION @@ -64,20 +64,20 @@ RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} ENV PATH="/home/tester/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" RUN npm install -g ts-node yarn -# Install js-soroban-client -ARG JS_SOROBAN_CLIENT_NPM_VERSION +# Install js-stellar-sdk +ARG JS_STELLAR_SDK_NPM_VERSION ADD package.json /home/tester/ -ADD js-soroban-client /home/tester/js-soroban-client +ADD js-stellar-sdk /home/tester/js-stellar-sdk RUN sudo chown -R tester:tester /home/tester RUN yarn install --network-concurrency 1 -RUN if echo "$JS_SOROBAN_CLIENT_NPM_VERSION" | grep -q '.*file:.*'; then \ - cd /home/tester/js-soroban-client; \ - yarn cache clean; \ - yarn install --network-concurrency 1; \ - cd /home/tester; \ - yarn add ${JS_SOROBAN_CLIENT_NPM_VERSION} --network-concurrency 1; \ +RUN if echo "$JS_STELLAR_SDK_NPM_VERSION" | grep -q '.*file:.*'; then \ + cd /home/tester/js-stellar-sdk; \ + yarn cache clean; \ + yarn install --network-concurrency 1; \ + cd /home/tester; \ + yarn add ${JS_STELLAR_SDK_NPM_VERSION} --network-concurrency 1; \ else \ - yarn add "soroban-client@${JS_SOROBAN_CLIENT_NPM_VERSION}" --network-concurrency 1; \ + yarn add "stellar-sdk@${JS_STELLAR_SDK_NPM_VERSION}" --network-concurrency 1; \ fi ADD *.ts /home/tester/bin/ diff --git a/Makefile b/Makefile index 9f7a0fc..14fd388 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,10 @@ SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git\#main GO_GIT_REF=https://github.com/stellar/go.git\#master QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git\#master # specify the published npm repo version of soroban-client js library, or you can specify gh git ref url as the version also -JS_SOROBAN_CLIENT_NPM_VERSION=https://github.com/stellar/js-soroban-client.git\#main +JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#main # variables to set if wanting to use existing dockerhub images instead of compiling -# image during build. if using this option, the image ref should provide a version for same +# image during build. if using this option, the image ref should provide a version for same # platform arch as the build host is on, i.e. linux/amd64 or linux/arm64. # # image must have soroban cli bin at /usr/local/cargo/bin/soroban @@ -43,7 +43,7 @@ FRIENDBOT_IMAGE= # image must have core bin at /usr/local/bin/stellar-core CORE_IMAGE= # -# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied, +# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied, # the other core, rpc, horizon, friendbot config settings are mostly ignored, since the quickstart image # has them compiled in already. the 'stellar/quickstart' images also support multi-arch, so the build will # work those images whether the build host is arm64 or amd64. @@ -54,7 +54,7 @@ NODE_VERSION?=16.20.2 # if crate version is set, then it overrides SOROBAN_CLI_GIT_REF, cli will be installed from this create instead SOROBAN_CLI_CRATE_VERSION= -# sets the rustc version in the system test image +# sets the rustc version in the system test image RUST_TOOLCHAIN_VERSION=stable # temporarily needed, builds core with soroban enabled features @@ -73,7 +73,7 @@ build-friendbot: docker build -t "$(FRIENDBOT_STAGE_IMAGE)" \ --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ -f services/friendbot/docker/Dockerfile "$$SOURCE_URL"; \ - fi + fi build-soroban-rpc: if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(SOROBAN_RPC_IMAGE)" ]; then \ @@ -109,7 +109,7 @@ build-horizon: --target builder -f services/horizon/docker/Dockerfile.dev "$$SOURCE_URL"; \ fi -build-core: +build-core: if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(CORE_IMAGE)" ]; then \ SOURCE_URL="$(CORE_GIT_REF)"; \ if [[ ! "$(CORE_GIT_REF)" =~ \.git ]]; then \ @@ -152,5 +152,5 @@ build: build-quickstart build-soroban-cli --build-arg SOROBAN_CLI_IMAGE_REF=$$SOROBAN_CLI_IMAGE_REF \ --build-arg RUST_TOOLCHAIN_VERSION=$(RUST_TOOLCHAIN_VERSION) \ --build-arg NODE_VERSION=$(NODE_VERSION) \ - --build-arg JS_SOROBAN_CLIENT_NPM_VERSION=$(JS_SOROBAN_CLIENT_NPM_VERSION) \ + --build-arg JS_STELLAR_SDK_VERSION=$(JS_STELLAR_SDK_VERSION) \ --label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .; diff --git a/package.json b/package.json index 5018b0a..855f94c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "argparse": "^2.0.1", - "stellar-sdk": "^11.0.0-beta.4", "tslib": "^2.5.0", "typescript": "^4.9.5" }, From af5c8e5f827aedc7b69457ae3641feee2cd8e4af Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 25 Oct 2023 13:35:55 -0700 Subject: [PATCH 03/12] Refresh go.mod to v1.21 + go mod tidy --- go.mod | 2 +- go.sum | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5f0985f..c069510 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/stellar/system-test -go 1.20 +go 1.21 require ( github.com/cucumber/godog v0.12.5 diff --git a/go.sum b/go.sum index 1dee41e..a5189b4 100644 --- a/go.sum +++ b/go.sum @@ -47,15 +47,18 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi v4.0.3+incompatible h1:gakN3pDJnzZN5jqFV2TEdF66rTfKeITyR8qu6ekICEY= +github.com/go-chi/chi v4.0.3+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-cmd/cmd v1.4.1 h1:JUcEIE84v8DSy02XTZpUDeGKExk2oW3DA10hTjbQwmc= github.com/go-cmd/cmd v1.4.1/go.mod h1:tbBenttXtZU4c5djS1o7PWL5pd2xAr5sIqH1kGdNiRc= github.com/go-errors/errors v0.0.0-20150906023321-a41850380601 h1:jxTbmDuqQUTI6MscgbqB39vtxGfr2fi61nYIcFQUnlE= +github.com/go-errors/errors v0.0.0-20150906023321-a41850380601/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= +github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -81,6 +84,7 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= +github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -114,6 +118,7 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -134,6 +139,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739 h1:ykXz+pRRTibcSjG1yRhpdSHInF8yZY/mfn+Rz2Nd1rE= +github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739/go.mod h1:zUx1mhth20V3VKgL5jbd1BSQcW4Fy6Qs4PZvQwRFwzM= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -151,7 +157,9 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -176,9 +184,11 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/go-loggly v0.5.1-0.20171222203950-eb91657e62b2 h1:S4OC0+OBKz6mJnzuHioeEat74PuQ4Sgvbf8eus695sc= +github.com/segmentio/go-loggly v0.5.1-0.20171222203950-eb91657e62b2/go.mod h1:8zLRYR5npGjaOXgPSKat5+oOh+UHd8OdbS18iqX9F6Y= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -200,6 +210,7 @@ github.com/stellar/go-xdr v0.0.0-20211103144802-8017fc4bdfee/go.mod h1:yoxyU/M8n github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -208,6 +219,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/xdrpp/goxdr v0.1.1 h1:E1B2c6E8eYhOVyd7yEpOyopzTPirUeF6mVOfXfGyJyc= +github.com/xdrpp/goxdr v0.1.1/go.mod h1:dXo1scL/l6s7iME1gxHWo2XCppbHEKZS7m/KyYWkNzA= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -226,6 +238,7 @@ golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxT golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -282,6 +295,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -330,9 +344,11 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From c5bf548727742f55edbeb056374eee3b62bbefc1 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Fri, 27 Oct 2023 12:42:07 -0700 Subject: [PATCH 04/12] updated start script to use latest quickstart env variables for soroban --- Makefile | 1 + start | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 14fd388..55c80db 100644 --- a/Makefile +++ b/Makefile @@ -136,6 +136,7 @@ build-quickstart: build-core build-friendbot build-horizon build-soroban-rpc docker build -t "$(QUICKSTART_STAGE_IMAGE)" \ --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ --build-arg STELLAR_CORE_IMAGE_REF=$$CORE_IMAGE_REF \ + --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ --build-arg HORIZON_IMAGE_REF=$$HORIZON_IMAGE_REF \ --build-arg FRIENDBOT_IMAGE_REF=$$FRIENDBOT_IMAGE_REF \ --build-arg SOROBAN_RPC_IMAGE_REF=$$SOROBAN_RPC_IMAGE_REF \ diff --git a/start b/start index faefa29..46d1126 100755 --- a/start +++ b/start @@ -62,12 +62,16 @@ function main() { process_args "$@" if [ ! -z "$TARGET_NETWORK_RPC_URL" ] && [ ! -z "$TARGET_NETWORK" ]; then - echo "Invalid TargetNetwork config, must be TargetNetwork=standalone|futurenet or TargetNetworkRPCURL, aborting test ..." >&2 + echo "Invalid TargetNetwork config, must set TargetNetwork or TargetNetworkRPCURL, aborting test ..." >&2 exit 1 fi - if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ "$TARGET_NETWORK" != "standalone" ] && [ "$TARGET_NETWORK" != "futurenet" && ]; then - echo "Invalid TargetNetwork, must be one of standalone or futurenet, aborting test ..." >&2 + if [ -z "$TARGET_NETWORK_RPC_URL" ] && \ + [ "$TARGET_NETWORK" != "standalone" ] && \ + [ "$TARGET_NETWORK" != "local" ] && \ + [ "$TARGET_NETWORK" != "futurenet" && ] && \ + [ "$TARGET_NETWORK" != "testnet" && ]; then + echo "Invalid TargetNetwork, must be one of: standalone or local(both mean the same), futurenet, or testnet, aborting test ..." >&2 exit 1 fi @@ -186,7 +190,7 @@ function process_args() { done if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ -z "$TARGET_NETWORK" ]; then - TARGET_NETWORK=standalone + TARGET_NETWORK=local fi } @@ -205,7 +209,13 @@ function soroban_rpc_status () { if [ $(expr $COUNTER % 12) -eq 0 ]; then print_screen_output "waited $(expr $COUNTER / 12) minutes for soroban rpc to report ready state..." fi - COUNTER=$[$COUNTER +1] + COUNTER=$[$COUNTER +1] + + if [ $COUNTER -gt 900 ]; then + echo "Waited longer than 15 minutes for rpc, cancelling and exit." + exit + fi + sleep 5 done print_screen_output "soroban rpc reported ready status, the service can be used by tools/cli now ..." From e011e7e0c0e06ef1170034aca466094cfc7f1e65 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Tue, 31 Oct 2023 05:58:23 -0700 Subject: [PATCH 05/12] include quickstart's soroban high limit override on core cfg by default --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 55c80db..d6ba753 100644 --- a/Makefile +++ b/Makefile @@ -137,6 +137,7 @@ build-quickstart: build-core build-friendbot build-horizon build-soroban-rpc --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ --build-arg STELLAR_CORE_IMAGE_REF=$$CORE_IMAGE_REF \ --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ + --build-arg CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true \ --build-arg HORIZON_IMAGE_REF=$$HORIZON_IMAGE_REF \ --build-arg FRIENDBOT_IMAGE_REF=$$FRIENDBOT_IMAGE_REF \ --build-arg SOROBAN_RPC_IMAGE_REF=$$SOROBAN_RPC_IMAGE_REF \ From 5637e7dd944b3992d291e7a15ce2b7de54c4b180 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 31 Oct 2023 15:43:19 -0700 Subject: [PATCH 06/12] Do renames for the README as well --- README.md | 144 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 3b02e6f..7368645 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # System Test ### Runing tests using the docker image: -To run tests, requires two steps: - (1) First build the system test docker image with the correct versions of core, - horizon, soroban rpc, rust toolchain, soroban cli, this will create a docker image named - `stellar/system-test:dev`. - All `GIT_REF` variables can refer to either a fully qualified local path to checked out git repo, or a fully qualified github remote repo url `https://github.com/repo#` +To run tests, requires two steps: + (1) First build the system test docker image with the correct versions of core, + horizon, soroban rpc, rust toolchain, soroban cli, this will create a docker image named + `stellar/system-test:dev`. + All `GIT_REF` variables can refer to either a fully qualified local path to checked out git repo, or a fully qualified github remote repo url `https://github.com/repo#` ``` - make + make QUICKSTART_GIT_REF=? \ CORE_GIT_REF=? \ CORE_COMPILE_CONFIGURE_FLAGS=? \ @@ -16,12 +16,12 @@ To run tests, requires two steps: GO_GIT_REF=? \ RUST_TOOLCHAIN_VERSION=? \ SOROBAN_CLI_CRATE_VERSION=? \ - JS_SOROBAN_CLIENT_NPM_VERSION=? \ + JS_STELLAR_SDK_NPM_VERSION=? \ NODE_VERSION=? \ - build - ``` + build + ``` - example of build using specific git refs, mainline from repos in this example, or use tags, branches, etc: + example of build using specific git refs, mainline from repos in this example, or use tags, branches, etc: ``` $ make CORE_GIT_REF=https://github.com/stellar/stellar-core.git#f1dc39f0f146815e5e3a94ed162e2f0639cb433f \ CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests --enable-next-protocol-version-unsafe-for-production" \ @@ -29,103 +29,103 @@ To run tests, requires two steps: RUST_TOOLCHAIN_VERSION=stable \ SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#master \ - JS_SOROBAN_CLIENT_NPM_VERSION=https://github.com/stellar/js-soroban-client.git#main \ + JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master \ build - ``` + ``` - example of build using the existing quickstart:soroban-dev image which has latest released soroban server versions and builds soroban cli from local directory of checked out soroban-tools repo: + example of build using the existing quickstart:soroban-dev image which has latest released soroban server versions and builds soroban cli from local directory of checked out soroban-tools repo: ``` $ make QUICKSTART_IMAGE=stellar/quickstart:soroban-dev \ RUST_TOOLCHAIN_VERSION=1.66.0 \ SOROBAN_CLI_GIT_REF=/Users/user/soroban-tools build - ``` + ``` - some settings have defaults pre-set, and optionally be overriden: + some settings have defaults pre-set, and optionally be overriden: ``` - SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git#main - SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main - RUST_TOOLCHAIN_VERSION=stable + SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git#main + SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main + RUST_TOOLCHAIN_VERSION=stable QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#master GO_GIT_REF=https://github.com/stellar/go.git#soroban-xdr-next CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests --enable-next-protocol-version-unsafe-for-production" CORE_GIT_REF=https://github.com/stellar/stellar-core.git#master - JS_SOROBAN_CLIENT_NPM_VERSION=https://github.com/stellar/js-soroban-client.git#main - ``` + JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master + ``` - optional to set: + optional to set: ``` # this will override SOROBAN_CLI_GIT_REF, and install soroban cli from crates repo instead - SOROBAN_CLI_CRATE_VERSION=0.4.0 + SOROBAN_CLI_CRATE_VERSION=0.4.0 # this will override the default Node JS vm version used for running the JS code: NODE_VERSION=14.20.0 - # soroban js client version can be set to a published npm version on https://www.npmjs.com/package/soroban-client - JS_SOROBAN_CLIENT_NPM_VERSION=latest - # or it can be set to a github git ref of a js-soroban-client repo - JS_SOROBAN_CLIENT_NPM_VERSION=https://github.com/stellar/js-soroban-client.git#main + # soroban js client version can be set to a published npm version on https://www.npmjs.com/package/soroban-client + JS_STELLAR_SDK_NPM_VERSION=latest + # or it can be set to a github git ref of a js-stellar-sdk repo + JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master - # Image overrides. - # If using these, the image ref should provide a manifiest version for same - # platform arch as the build host is running on, i.e. linux/amd64 or linux/arm64. + # Image overrides. + # If using these, the image ref should provide a manifiest version for same + # platform arch as the build host is running on, i.e. linux/amd64 or linux/arm64. # Otherwise, build will fail if image is not available for matching host platform. # - # this will skip building core, horizon, rpc and quickstart from git source and instead - # will use the versions already compiled in the existing quickstart docker image provided: + # this will skip building core, horizon, rpc and quickstart from git source and instead + # will use the versions already compiled in the existing quickstart docker image provided: QUICKSTART_IMAGE=/: - # this will skip building core from git source and instead - # will use the bin already compiled at /usr/local/bin/stellar-core in the existing docker image provided: + # this will skip building core from git source and instead + # will use the bin already compiled at /usr/local/bin/stellar-core in the existing docker image provided: CORE_IMAGE=/: - # this will skip building soroban-rpc from git source and instead - # will use the bin already compiled at /bin/soroban-rpc in the existing docker image provided: + # this will skip building soroban-rpc from git source and instead + # will use the bin already compiled at /bin/soroban-rpc in the existing docker image provided: SOROBAN_RPC_IMAGE=/: - # this will skip building soroban-cli from git source and instead - # will use the bin already compiled at /usr/local/cargo/bin/soroban in the existing docker image provided: + # this will skip building soroban-cli from git source and instead + # will use the bin already compiled at /usr/local/cargo/bin/soroban in the existing docker image provided: SOROBAN_CLI_IMAGE=/: - # this will skip building horizon from git source and instead - # will use the bin already compiled at /go/bin/horizon in the existing docker image provided: + # this will skip building horizon from git source and instead + # will use the bin already compiled at /go/bin/horizon in the existing docker image provided: HORIZON_IMAGE=/: - # this will skip building friendbot from git source and instead - # will use the bin already compiled at /app/friendbot in the existing docker image provided: + # this will skip building friendbot from git source and instead + # will use the bin already compiled at /app/friendbot in the existing docker image provided: FRIENDBOT_IMAGE=/: ``` (2) Run the system test docker image: ``` - docker run --rm -it --name e2e_test stellar/system-test:dev --VerboseOutput false + docker run --rm -it --name e2e_test stellar/system-test:dev --VerboseOutput false ``` Optional settings to pass when running system-test image, `stellar/system-test:`: -To specify git version of the smart contract source code used as test fixtures. -`--SorobanExamplesGitHash {branch, tag, git commit hash}` -`--SorobanExamplesRepoURL "https://github.com/stellar/soroban-examples.git"` +To specify git version of the smart contract source code used as test fixtures. +`--SorobanExamplesGitHash {branch, tag, git commit hash}` +`--SorobanExamplesRepoURL "https://github.com/stellar/soroban-examples.git"` -To specify which system test feature/scenarios to run, it is a regex of the feature test name and a scenario defined within, each row in example data for a scenario outline is postfixed with '#01', '#02', examples: -`--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract.*$"` -or -`--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract#01$"` +To specify which system test feature/scenarios to run, it is a regex of the feature test name and a scenario defined within, each row in example data for a scenario outline is postfixed with '#01', '#02', examples: +`--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract.*$"` +or +`--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract#01$"` The ending wildcard allows for all combinations of example data for a scenario outline, without that it would just run the first example data set in a scenario outline. -The default target network for system tests is a new/empty instance of standalone network hosted inside the docker container, tests will use the default root account already seeded into standalone network. Alternatively, can override the network settings here: -* Tests will use an internally hosted core node connected to standalone or futurenet network: -`--TargetNetwork {standalone|futurenet}` -* Tests will use an external rpc instance and the container will not run core, horizon, rpc services internally: -`--TargetNetworkRPCURL {http:///soroban/rpc}` -* Tests use these settings in either target network mode, and these are by default set to work with standalone: -`--TargetNetworkPassphrase "{passphrase}"` -`--TargetNetworkTestAccountSecret "{your test account key pair info}"` -`--TargetNetworkTestAccountPublic "{your test account key pair info}"` +The default target network for system tests is a new/empty instance of standalone network hosted inside the docker container, tests will use the default root account already seeded into standalone network. Alternatively, can override the network settings here: +* Tests will use an internally hosted core node connected to standalone or futurenet network: +`--TargetNetwork {standalone|futurenet}` +* Tests will use an external rpc instance and the container will not run core, horizon, rpc services internally: +`--TargetNetworkRPCURL {http:///soroban/rpc}` +* Tests use these settings in either target network mode, and these are by default set to work with standalone: +`--TargetNetworkPassphrase "{passphrase}"` +`--TargetNetworkTestAccountSecret "{your test account key pair info}"` +`--TargetNetworkTestAccountPublic "{your test account key pair info}"` Debug mode, the docker container will exit with error code when any pre-setup or test fails to pass, -you can enable DEBUG_MODE flag, and the container will stay running, prompting you for enter key before shutting down, make sure you invoke docker with `-it` so the prompt will reach your command line. While container is kept running, you can shell into it via `docker exec -it ` and view log files of services in the stack such as core, rpc located in container at `/var/log/supervisor`. +you can enable DEBUG_MODE flag, and the container will stay running, prompting you for enter key before shutting down, make sure you invoke docker with `-it` so the prompt will reach your command line. While container is kept running, you can shell into it via `docker exec -it ` and view log files of services in the stack such as core, rpc located in container at `/var/log/supervisor`. `--DebugMode=true` @@ -133,30 +133,30 @@ The docker run follows standard exit code conventions, so if all tests pass in t ### Development mode and running tests directly from checked out system-test repo. -This approach allows to run the tests from source code directly on host as go tests, no docker image is used. +This approach allows to run the tests from source code directly on host as go tests, no docker image is used. #### Prerequisites: 1. go 1.18 or above - https://go.dev/doc/install - 2. rust toolchain(cargo and rustc), install the version per testing requirements or stable, - use rustup - https://www.rust-lang.org/tools/install + 2. rust toolchain(cargo and rustc), install the version per testing requirements or stable, - use rustup - https://www.rust-lang.org/tools/install 3. `soroban`, compile or install via cargo crate a version of soroban cli onto your machine and accessible from PATH. 4. target network stack for the tests to access soroban-rpc instance. You can use an existing/running instance if reachable or can use the quickstart image `stellar/quickstart:soroban-dev` from dockerhub to run the latest stable target network stack locally, or build quickstart with specific versions of core, horizon and soroban rpc first [following these instructions](https://github.com/stellar/quickstart#building-custom-images) and run `stellar/quickstart:dev` locally. ``` docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:dev --standalone --enable-soroban-rpc ``` 5. locally checkout stellar/system-test GH repo and go into top folder - `git clone https://github.com/stellar/system-test.git;cd system-test` - -#### Running tests + +#### Running tests ``` # example values used here are for when running quickstart:soroban-dev standalone locally -system-test $ SorobanExamplesGitHash="main" \ -SorobanExamplesRepoURL="https://github.com/stellar/soroban-examples.git" \ -TargetNetworkPassPhrase="Standalone Network ; February 2017" \ -TargetNetworkSecretKey="SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" \ -TargetNetworkPublicKey="GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI" \ -TargetNetworkRPCURL="http://localhost:8000/soroban/rpc" \ -VerboseOutput=false \ +system-test $ SorobanExamplesGitHash="main" \ +SorobanExamplesRepoURL="https://github.com/stellar/soroban-examples.git" \ +TargetNetworkPassPhrase="Standalone Network ; February 2017" \ +TargetNetworkSecretKey="SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" \ +TargetNetworkPublicKey="GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI" \ +TargetNetworkRPCURL="http://localhost:8000/soroban/rpc" \ +VerboseOutput=false \ go test -v --run "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract.*$" ./features/dapp_develop/... ``` @@ -168,8 +168,6 @@ This example uses a feature/scenario filter also to limit which tests are run. * the verbose output of BDD scenerio results for tests is dependent on go's testing verbose output rules, need to specify -v and a directory with single package, if multiple packages detected on directory location, then go won't print verbose output for each package, i.e. you wont see the BDD scenerio summaries printed, just the standard one liner for summary of package pass/fail status. -#### Debugging tests +#### Debugging tests Have provided a debug config [launch.json](.vscode/launch.json) for example reference on how to run a test with the go/dlv debugger to step through, etc. - - From 62f8c37769eb392d1b1b15c7e4c79d050d6dfb41 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 31 Oct 2023 15:49:26 -0700 Subject: [PATCH 07/12] Merge in README changes plus renames --- README.md | 86 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 7368645..6925640 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # System Test -### Runing tests using the docker image: -To run tests, requires two steps: - (1) First build the system test docker image with the correct versions of core, - horizon, soroban rpc, rust toolchain, soroban cli, this will create a docker image named +### Running system tests: + Identify the system-test image you want to use for running tests: + - Use a prebuilt system test image published as tags under `dockerhub.io/stellar/system-test` + - Build the system test docker image locally with specific versions of core, horizon, soroban rpc, rust toolchain, soroban cli, this will create a docker image named `stellar/system-test:dev`. All `GIT_REF` variables can refer to either a fully qualified local path to checked out git repo, or a fully qualified github remote repo url `https://github.com/repo#` ``` @@ -23,7 +23,7 @@ To run tests, requires two steps: example of build using specific git refs, mainline from repos in this example, or use tags, branches, etc: ``` - $ make CORE_GIT_REF=https://github.com/stellar/stellar-core.git#f1dc39f0f146815e5e3a94ed162e2f0639cb433f \ + make CORE_GIT_REF=https://github.com/stellar/stellar-core.git#f1dc39f0f146815e5e3a94ed162e2f0639cb433f \ CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests --enable-next-protocol-version-unsafe-for-production" \ SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ RUST_TOOLCHAIN_VERSION=stable \ @@ -33,9 +33,9 @@ To run tests, requires two steps: build ``` - example of build using the existing quickstart:soroban-dev image which has latest released soroban server versions and builds soroban cli from local directory of checked out soroban-tools repo: + example of build using an existing quickstart image, this can dramatically speed up the build time, as the existing quickstart image will provide the pre-compiled rpc, and core runtimes already: ``` - $ make QUICKSTART_IMAGE=stellar/quickstart:soroban-dev \ + make QUICKSTART_IMAGE=stellar/quickstart:soroban-dev \ RUST_TOOLCHAIN_VERSION=1.66.0 \ SOROBAN_CLI_GIT_REF=/Users/user/soroban-tools build ``` @@ -46,8 +46,10 @@ To run tests, requires two steps: SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main RUST_TOOLCHAIN_VERSION=stable QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#master - GO_GIT_REF=https://github.com/stellar/go.git#soroban-xdr-next - CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests --enable-next-protocol-version-unsafe-for-production" + # the GO_GIT_REF provides the reference on the stellar/go repo from which + # to build horizon + GO_GIT_REF=https://github.com/stellar/go.git#master + CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests" CORE_GIT_REF=https://github.com/stellar/stellar-core.git#master JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master ``` @@ -58,9 +60,9 @@ To run tests, requires two steps: SOROBAN_CLI_CRATE_VERSION=0.4.0 # this will override the default Node JS vm version used for running the JS code: - NODE_VERSION=14.20.0 + NODE_VERSION=16.20.2 - # soroban js client version can be set to a published npm version on https://www.npmjs.com/package/soroban-client + # js sdk version can be set to a published npm version from https://www.npmjs.com/package/stellar-sdk JS_STELLAR_SDK_NPM_VERSION=latest # or it can be set to a github git ref of a js-stellar-sdk repo JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master @@ -70,40 +72,34 @@ To run tests, requires two steps: # platform arch as the build host is running on, i.e. linux/amd64 or linux/arm64. # Otherwise, build will fail if image is not available for matching host platform. # - # this will skip building core, horizon, rpc and quickstart from git source and instead + # this will skip building from source for core(CORE_GIT_REF), rpc(SOROBAN_RPC_GIT_REF) and quickstart(QUICKSTART_GIT_REF), instead # will use the versions already compiled in the existing quickstart docker image provided: QUICKSTART_IMAGE=/: - # this will skip building core from git source and instead + # this will skip building core from CORE_GIT_REF and instead # will use the bin already compiled at /usr/local/bin/stellar-core in the existing docker image provided: CORE_IMAGE=/: - # this will skip building soroban-rpc from git source and instead + # this will skip building soroban-rpc from SOROBAN_RPC_GIT_REF and instead # will use the bin already compiled at /bin/soroban-rpc in the existing docker image provided: SOROBAN_RPC_IMAGE=/: - # this will skip building soroban-cli from git source and instead + # this will skip building soroban-cli from SOROBAN_CLI_GIT_REF and instead # will use the bin already compiled at /usr/local/cargo/bin/soroban in the existing docker image provided: SOROBAN_CLI_IMAGE=/: - # this will skip building horizon from git source and instead + # this will skip building horizon from GO_GIT_REF and instead # will use the bin already compiled at /go/bin/horizon in the existing docker image provided: HORIZON_IMAGE=/: - # this will skip building friendbot from git source and instead + # this will skip building friendbot from GO_GIT_REF and instead # will use the bin already compiled at /app/friendbot in the existing docker image provided: FRIENDBOT_IMAGE=/: ``` - (2) Run the system test docker image: - ``` - docker run --rm -it --name e2e_test stellar/system-test:dev --VerboseOutput false - ``` - - -Optional settings to pass when running system-test image, `stellar/system-test:`: +Optional parameters to pass when running system-test image, `stellar/system-test:`: -To specify git version of the smart contract source code used as test fixtures. +To specify git version of the smart contract source code used in soroban test fixtures. `--SorobanExamplesGitHash {branch, tag, git commit hash}` `--SorobanExamplesRepoURL "https://github.com/stellar/soroban-examples.git"` @@ -112,14 +108,12 @@ To specify which system test feature/scenarios to run, it is a regex of the feat or `--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract#01$"` -The ending wildcard allows for all combinations of example data for a scenario outline, without that it would just run the first example data set in a scenario outline. - -The default target network for system tests is a new/empty instance of standalone network hosted inside the docker container, tests will use the default root account already seeded into standalone network. Alternatively, can override the network settings here: -* Tests will use an internally hosted core node connected to standalone or futurenet network: -`--TargetNetwork {standalone|futurenet}` -* Tests will use an external rpc instance and the container will not run core, horizon, rpc services internally: +The default target network for system tests is a new/empty instance of local network hosted inside the docker container, tests will use the default root account already seeded into local network. Alternatively, can override the network settings for local and remote usages: +- Tests will use an internally hosted core watcher node: +`--TargetNetwork {standalone|futurenet|testnet}` +- Tests will use an external rpc instance and the container will not run core, horizon, rpc services internally: `--TargetNetworkRPCURL {http:///soroban/rpc}` -* Tests use these settings in either target network mode, and these are by default set to work with standalone: +- Tests use these settings in either target network mode, and these are by default set to work with local: `--TargetNetworkPassphrase "{passphrase}"` `--TargetNetworkTestAccountSecret "{your test account key pair info}"` `--TargetNetworkTestAccountPublic "{your test account key pair info}"` @@ -128,9 +122,28 @@ Debug mode, the docker container will exit with error code when any pre-setup or you can enable DEBUG_MODE flag, and the container will stay running, prompting you for enter key before shutting down, make sure you invoke docker with `-it` so the prompt will reach your command line. While container is kept running, you can shell into it via `docker exec -it ` and view log files of services in the stack such as core, rpc located in container at `/var/log/supervisor`. `--DebugMode=true` - The docker run follows standard exit code conventions, so if all tests pass in the container run, exit code from command line execution will be 0, otherwise, if any failures in container or tests, then exit code will be greater than 0. +#### Running Test Examples +- Run tests against an instance of core and rpc on a local network all running in the test container: + + ``` + docker run --rm -t --name e2e_test stellar/system-test: \ + --VerboseOutput true + ``` + +- Run tests against a remote instance of rpc configured for testnet, this will not run core or rpc instances locally in the test container. It requires you provide a key pair of an account that is funded with Lumens on the target network for the tests to use as source account on transactions it will submit to target network: + + ``` + docker run --rm -t --name e2e_test stellar/system-test: \ + --VerboseOutput true \ + --TargetNetworkRPCURL https:// \ + --TargetNetworkPassphrase "Test SDF Network ; September 2015" \ + --TargetNetworkTestAccountSecret \ + --TargetNetworkTestAccountPublic \ + --SorobanExamplesGitHash v20.0.0-rc2 + ``` + ### Development mode and running tests directly from checked out system-test repo. This approach allows to run the tests from source code directly on host as go tests, no docker image is used. @@ -139,7 +152,7 @@ This approach allows to run the tests from source code directly on host as go te 1. go 1.18 or above - https://go.dev/doc/install 2. rust toolchain(cargo and rustc), install the version per testing requirements or stable, - use rustup - https://www.rust-lang.org/tools/install - 3. `soroban`, compile or install via cargo crate a version of soroban cli onto your machine and accessible from PATH. + 3. `soroban` cli, compile or install via cargo crate a version of soroban cli onto your machine and accessible from PATH. 4. target network stack for the tests to access soroban-rpc instance. You can use an existing/running instance if reachable or can use the quickstart image `stellar/quickstart:soroban-dev` from dockerhub to run the latest stable target network stack locally, or build quickstart with specific versions of core, horizon and soroban rpc first [following these instructions](https://github.com/stellar/quickstart#building-custom-images) and run `stellar/quickstart:dev` locally. ``` docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:dev --standalone --enable-soroban-rpc @@ -147,9 +160,8 @@ This approach allows to run the tests from source code directly on host as go te 5. locally checkout stellar/system-test GH repo and go into top folder - `git clone https://github.com/stellar/system-test.git;cd system-test` -#### Running tests +#### Running tests locally as go programs ``` -# example values used here are for when running quickstart:soroban-dev standalone locally system-test $ SorobanExamplesGitHash="main" \ SorobanExamplesRepoURL="https://github.com/stellar/soroban-examples.git" \ TargetNetworkPassPhrase="Standalone Network ; February 2017" \ @@ -170,4 +182,4 @@ This example uses a feature/scenario filter also to limit which tests are run. #### Debugging tests -Have provided a debug config [launch.json](.vscode/launch.json) for example reference on how to run a test with the go/dlv debugger to step through, etc. +A debug config [launch.json](.vscode/launch.json) is provided for example reference on how to run a test with the go/dlv debugger. From 48ed3c19c81a45cd197f7131e33b984322bdc382 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Thu, 2 Nov 2023 13:43:19 -0700 Subject: [PATCH 08/12] remove next-proto flag from core default compile flags --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d6ba753..b608750 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ SOROBAN_CLI_CRATE_VERSION= RUST_TOOLCHAIN_VERSION=stable # temporarily needed, builds core with soroban enabled features -CORE_COMPILE_CONFIGURE_FLAGS=--disable-tests --enable-next-protocol-version-unsafe-for-production +CORE_COMPILE_CONFIGURE_FLAGS=--disable-tests # the final image name that is created in local docker images store for system test SYSTEM_TEST_IMAGE=stellar/system-test:dev From b3f39c31812d0d9ee29de6c3fcd64e1d2c6ec3e4 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Thu, 2 Nov 2023 13:53:04 -0700 Subject: [PATCH 09/12] revert cli --ignore-checks usage --- features/dapp_develop/main.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/features/dapp_develop/main.go b/features/dapp_develop/main.go index 34eae50..358c997 100644 --- a/features/dapp_develop/main.go +++ b/features/dapp_develop/main.go @@ -42,7 +42,6 @@ func compileContract(contractExamplesSubPath string, contractWorkingDirectory st func deployContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, installedContractId string, e2eConfig *e2e.E2EConfig) (string, error) { var envCmd *cmd.Cmd - // Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK. if installedContractId != "" { envCmd = cmd.NewCmd("soroban", "contract", @@ -50,8 +49,7 @@ func deployContract(compiledContractFileName string, contractWorkingDirectory st "--wasm-hash", installedContractId, "--rpc-url", e2eConfig.TargetNetworkRPCURL, "--source", e2eConfig.TargetNetworkSecretKey, - "--network-passphrase", e2eConfig.TargetNetworkPassPhrase, - "--ignore-checks") + "--network-passphrase", e2eConfig.TargetNetworkPassPhrase) } else { envCmd = cmd.NewCmd("soroban", "contract", @@ -59,8 +57,7 @@ func deployContract(compiledContractFileName string, contractWorkingDirectory st "--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName), "--rpc-url", e2eConfig.TargetNetworkRPCURL, "--source", e2eConfig.TargetNetworkSecretKey, - "--network-passphrase", e2eConfig.TargetNetworkPassPhrase, - "--ignore-checks") + "--network-passphrase", e2eConfig.TargetNetworkPassPhrase) } status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig) @@ -77,14 +74,12 @@ func deployContract(compiledContractFileName string, contractWorkingDirectory st } func deployContractUsingConfigParams(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, identityName string, networkConfigName string, e2eConfig *e2e.E2EConfig) (string, error) { - // Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK. envCmd := cmd.NewCmd("soroban", "contract", "deploy", "--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName), "--network", networkConfigName, - "--source", identityName, - "--ignore-checks") + "--source", identityName) status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig) @@ -101,15 +96,13 @@ func deployContractUsingConfigParams(compiledContractFileName string, contractWo // returns the installed contract id func installContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, e2eConfig *e2e.E2EConfig) (string, error) { - // Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK. envCmd := cmd.NewCmd("soroban", "contract", "install", "--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName), "--rpc-url", e2eConfig.TargetNetworkRPCURL, "--source", e2eConfig.TargetNetworkSecretKey, - "--network-passphrase", e2eConfig.TargetNetworkPassPhrase, - "--ignore-checks") + "--network-passphrase", e2eConfig.TargetNetworkPassPhrase) status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig) From 5821f00a01e885ef3eb2a11dfd5a057899a7a86f Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Thu, 2 Nov 2023 13:53:04 -0700 Subject: [PATCH 10/12] Fixup env misname, fixup correct api usage --- Makefile | 2 +- invoke.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b608750..dfbdc9c 100644 --- a/Makefile +++ b/Makefile @@ -154,5 +154,5 @@ build: build-quickstart build-soroban-cli --build-arg SOROBAN_CLI_IMAGE_REF=$$SOROBAN_CLI_IMAGE_REF \ --build-arg RUST_TOOLCHAIN_VERSION=$(RUST_TOOLCHAIN_VERSION) \ --build-arg NODE_VERSION=$(NODE_VERSION) \ - --build-arg JS_STELLAR_SDK_VERSION=$(JS_STELLAR_SDK_VERSION) \ + --build-arg JS_STELLAR_SDK_NPM_VERSION=$(JS_STELLAR_SDK_NPM_VERSION) \ --label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .; diff --git a/invoke.ts b/invoke.ts index 6b5e385..43092f9 100755 --- a/invoke.ts +++ b/invoke.ts @@ -40,7 +40,7 @@ async function main() { const sourceAccount = await server.getAccount(account); // Some hacky param-parsing as csv. Generated Typescript bindings would be better. - const params: xdr.ScVal[] = (functionParams ?? []).split(",").map((param) => { + const params: xdr.ScVal[] = (functionParams ?? '').split(",").map((param) => { return xdr.ScVal.scvSymbol(param); }); @@ -52,10 +52,10 @@ async function main() { .setTimeout(30) .build(); - const txn = await server.prepareTransaction(originalTxn,networkPassphrase); + const txn = await server.prepareTransaction(originalTxn); txn.sign(secretKey); const send = await server.sendTransaction(txn); - if (send.errorResultXdr) { + if (send.errorResult) { throw new Error(`Transaction failed: ${JSON.stringify(send)}`); } let response = await server.getTransaction(send.hash); From 40365c87881368b003b478ebcdda6393add33af3 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 2 Nov 2023 14:36:53 -0700 Subject: [PATCH 11/12] Fixup invocation parameter parsing --- invoke.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/invoke.ts b/invoke.ts index 43092f9..1590833 100755 --- a/invoke.ts +++ b/invoke.ts @@ -40,9 +40,8 @@ async function main() { const sourceAccount = await server.getAccount(account); // Some hacky param-parsing as csv. Generated Typescript bindings would be better. - const params: xdr.ScVal[] = (functionParams ?? '').split(",").map((param) => { - return xdr.ScVal.scvSymbol(param); - }); + const params: xdr.ScVal[] = functionParams + ? functionParams.split(",").map((p) => xdr.ScVal.scvSymbol(p)) : []; const originalTxn = new TransactionBuilder(sourceAccount, { fee: "100", From 57d70ab5210bb1b501b4e633aa99f2c13ba65831 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 2 Nov 2023 14:42:16 -0700 Subject: [PATCH 12/12] More renames, debugging getEvents xdr failure --- .github/workflows/Dockerfile.yml | 10 ++++------ Makefile | 2 +- events.ts | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Dockerfile.yml b/.github/workflows/Dockerfile.yml index 51871cc..24cb276 100644 --- a/.github/workflows/Dockerfile.yml +++ b/.github/workflows/Dockerfile.yml @@ -5,7 +5,7 @@ on: branches: - master tags: - - '*' + - '*' pull_request: release: types: [published] @@ -25,7 +25,7 @@ env: RUST_TOOLCHAIN_VERSION: stable SOROBAN_CLI_GIT_REF: https://github.com/stellar/soroban-tools.git#main QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#master - JS_SOROBAN_CLIENT_NPM_VERSION: https://github.com/stellar/js-soroban-client.git#main + JS_SOROBAN_CLIENT_NPM_VERSION: https://github.com/stellar/js-stellar-sdk.git#master jobs: complete: if: always() @@ -56,7 +56,7 @@ jobs: - if: ${{ env.PUSH_ENABLED == 'true' }} name: Save Docker Image to file run: | - docker save ${{ env.IMAGE }} -o /tmp/image; + docker save ${{ env.IMAGE }} -o /tmp/image; - if: ${{ env.PUSH_ENABLED == 'true' }} name: Upload System Test Image uses: actions/upload-artifact@v2 @@ -66,7 +66,7 @@ jobs: push: # Only push non 'vX.Y.Z' tags as pre-built system test image with versions compiled into image. - # pr's and releases don't need to be pushed as docker images, because system test is meant to be built + # pr's and releases don't need to be pushed as docker images, because system test is meant to be built # from source locally. needs: build permissions: @@ -88,5 +88,3 @@ jobs: registry: ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }} username: ${{ secrets.DOCKERHUB_USERNAME || github.actor }} password: ${{ secrets.DOCKERHUB_TOKEN || github.token }} - - diff --git a/Makefile b/Makefile index dfbdc9c..5ecd53a 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git\#main GO_GIT_REF=https://github.com/stellar/go.git\#master QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git\#master # specify the published npm repo version of soroban-client js library, or you can specify gh git ref url as the version also -JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#main +JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master # variables to set if wanting to use existing dockerhub images instead of compiling # image during build. if using this option, the image ref should provide a version for same diff --git a/events.ts b/events.ts index 44188be..727a178 100755 --- a/events.ts +++ b/events.ts @@ -1,7 +1,7 @@ #!/usr/bin/env ts-node-script import { ArgumentParser } from 'argparse'; -import { xdr, Contract, SorobanRpc } from 'stellar-sdk'; +import { Contract, SorobanRpc } from 'stellar-sdk'; async function main() { const parser = new ArgumentParser({ description: 'Get contract events' })