Skip to content

Commit

Permalink
feat: add ag-setup-solo compatibility, ag-solo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 21, 2020
1 parent 1fdc1d3 commit 4abe446
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/cosmic-swingset/docker/ag-setup-solo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SOLO_NAME=${SOLO_NAME-agoric}
SOLO_HOME=${SOLO_HOME-$SOLO_NAME}
PORT=${PORT-8000}
HOST_PORT=${HOST_PORT-$PORT}
IMAGE=agoric/cosmic-swingset-setup-solo
IMAGE=agoric/cosmic-swingset-solo
case "$1" in
--pull)
shift
Expand All @@ -24,4 +24,4 @@ exec docker run \
--volume=ag-solo-state:/usr/src/app/solo \
-eAG_SOLO_BASEDIR="$SOLO_HOME" \
--rm -it $FLAGS \
"$IMAGE" ${1+"$@"}
"$IMAGE" setup ${1+"$@"}
14 changes: 14 additions & 0 deletions packages/cosmic-swingset/lib/ag-solo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ start
}

switch (argv[0]) {
case 'setup': {
const { netconfig } = parseArgs(argv.slice(1));
if (!AG_SOLO_BASEDIR) {
console.error(`setup: you must set $AG_SOLO_BASEDIR`);
return;
}
if (!fs.existsSync(AG_SOLO_BASEDIR)) {
await solo(progname, ['init', AG_SOLO_BASEDIR, ...rawArgv.slice(1)]);
}
process.chdir(AG_SOLO_BASEDIR);
await solo(progname, ['add-chain', netconfig]);
await solo(progname, ['start']);
break;
}
case 'init': {
const { _: subArgs, ...subOpts } = parseArgs(argv.slice(1), {
default: {
Expand Down
8 changes: 1 addition & 7 deletions packages/deployment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker-show-fat:
docker build --file=Dockerfile.show-fat ../..

docker-build: docker-build-base docker-build-sdk docker-build-solo \
docker-build-pserver docker-build-setup docker-build-setup-solo
docker-build-setup

docker-build-sdk:
docker build -t $(REPOSITORY_SDK):latest --file=Dockerfile.sdk ../..
Expand All @@ -25,15 +25,9 @@ docker-build-base:
echo "$$hash$$dirty" > $(SS)lib/git-revision.txt
docker build -t $(REPOSITORY):latest $(SS)

docker-build-pserver:
docker build -t $(REPOSITORY)-pserver:latest $(SS)provisioning-server

docker-build-solo:
docker build -t $(REPOSITORY)-solo:latest $(SS)lib/ag-solo

docker-build-setup-solo:
docker build -t $(REPOSITORY)-setup-solo:latest $(SS)setup-solo

docker-push: docker-push-base docker-push-solo docker-push-setup \
docker-push-pserver docker-push-setup-solo docker-push-ibc-alpha

Expand Down
2 changes: 0 additions & 2 deletions packages/deployment/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,6 @@ show-config display the client connection parameters
${chalk.yellow.bold(
`ag-setup-solo --netconfig='${pserverHost}/network-config'`,
)}
and get your codes from:
${chalk.yellow.bold(`curl ${pserverUrl}/request-code?nickname=MY-NICK`)}
`,
);
if (await exists('/vagrant')) {
Expand Down

0 comments on commit 4abe446

Please sign in to comment.