From edd7d549d9d46b422a731b4ccbe4e2ff69152c30 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 7 Mar 2023 16:04:43 -0700 Subject: [PATCH] Update fixturenet-laconicd docs Former-commit-id: 89b33c0e38383221d29955f240eabfc725d9d38a --- app/data/stacks/build-support/README.md | 13 +++-- app/data/stacks/fixturenet-laconicd/README.md | 50 +++++++++++++++---- app/data/stacks/package-registry/README.md | 5 ++ 3 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 app/data/stacks/package-registry/README.md diff --git a/app/data/stacks/build-support/README.md b/app/data/stacks/build-support/README.md index 9f7a74b4..99747f03 100644 --- a/app/data/stacks/build-support/README.md +++ b/app/data/stacks/build-support/README.md @@ -11,20 +11,25 @@ To use a user-supplied registry set these environment variables: Leave `CERC_NPM_REGISTRY_URL` un-set to use the local gitea registry. -### Build support containers +### 1. Build support containers ``` $ laconic-so --stack build-support build-containers ``` -### Deploy Gitea Package Registry +Note that the scheme/gerbil builder container can take a while to build so if you aren't going to build scheme projects it can be skipped with: +``` +$ laconic-so --stack build-support build-containers --exclude cerc/builder-gerbil +``` +### 2. Deploy Gitea Package Registry ``` $ laconic-so --stack package-registry setup-repositories -$ laconic-so --stack package-registry deploy-system up +$ laconic-so --stack package-registry deploy up This is your gitea access token: 84fe66a73698bf11edbdccd0a338236b7d1d5c45. Keep it safe and secure, it can not be fetched again from gitea. -$ export CERC_NPM_AUTH_TOKEN=84fe66a73698bf11edbdccd0a338236b7d1d5c45 ``` Now npm packages can be built: ### Build npm Packages +Ensure that `CERC_NPM_AUTH_TOKEN` is set with the token printed above when the package-registry stack was deployed (the actual token value will be different than shown in this example): ``` +$ export CERC_NPM_AUTH_TOKEN=84fe66a73698bf11edbdccd0a338236b7d1d5c45 $ laconic-so build-npms --include laconic-sdk ``` diff --git a/app/data/stacks/fixturenet-laconicd/README.md b/app/data/stacks/fixturenet-laconicd/README.md index 7fdc2003..80903b7e 100644 --- a/app/data/stacks/fixturenet-laconicd/README.md +++ b/app/data/stacks/fixturenet-laconicd/README.md @@ -1,18 +1,50 @@ # Laconicd Fixturenet -Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#user-mode)): +Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator. -## Clone required repositories +## 1. Install Laconic Stack Orchestrator +Installation is covered in detail [here](https://github.com/cerc-io/stack-orchestrator#user-mode) but if you're on Linux and already have docker installed it should be as simple as: ``` -$ laconic-so setup-repositories --include cerc-io/laconicd,cerc-io/laconic-sdk,cerc-io/laconic-registry-cli +$ mkdir my-working-dir +$ cd my-working-dir +$ curl -L -o ./laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so +$ chmod +x ./laconic-so +$ export PATH=$PATH:$(pwd) # Or move laconic-so to ~/bin or your favorite on-path directory ``` -## Build the laconicd container +## 2. Prepare the local build environment +Note that this step needs only to be done once on a new machine. +Detailed instructions can be found [here](../build-support/README.md). For the impatient run these commands: ``` -$ laconic-so build-containers --include cerc/laconicd +$ laconic-so --stack build-support build-containers --exclude cerc/builder-gerbil +$ laconic-so --stack package-registry setup-repositories +$ laconic-so --stack package-registry deploy-system up ``` -This should create a container with tag `cerc/laconicd` in the local image registry. -## Deploy the stack +Then add the localhost alias `gitea.local` and set `CERC_NPM_AUTH_TOKEN` to the token printed when the package-registry stack was deployed above: ``` -$ laconic-so deploy-system --include fixturenet-laconicd up +$ sudo vi /etc/hosts +$ export CERC_NPM_AUTH_TOKEN= +``` + +## 3. Clone required repositories +``` +$ laconic-so --stack fixturenet-laconicd setup-repositories +``` +## 4. Build the stack's packages and containers +``` +$ laconic-so --stack fixturenet-laconicd build-npms +$ laconic-so --stack fixturenet-laconicd build-containers +``` +## 5. Deploy the stack +``` +$ laconic-so --stack fixturenet-laconicd deploy up +``` +Correct operation should be verified by checking the laconicd container's logs with: +``` +$ laconic-so --stack fixturenet-laconicd deploy logs +``` +## 6. Test with the Registry CLI +``` +$ laconic-so --stack fixturenet-laconicd deploy exec laconicd "sh /docker-entrypoint-scripts.d/export-mykey.sh" +$ laconic-so --stack fixturenet-laconicd deploy exec cli "sh /scripts/import-key.sh xxxxxxxxxxxxxxxxxxxxxxx" +$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status" ``` -Correct operation should be verified by checking the laconicd container's log. diff --git a/app/data/stacks/package-registry/README.md b/app/data/stacks/package-registry/README.md new file mode 100644 index 00000000..ddb36a3f --- /dev/null +++ b/app/data/stacks/package-registry/README.md @@ -0,0 +1,5 @@ +# Package Registry Stack + +The Package Registry Stack supports a build environment that requires a package registry (initially for NPM packages only). + +Setup instructions can be found [here](../build-support/README.md).