Start Relay Chain error "substrate : command no found" - substrate

I am trying to do a substrate tutorial, "Start your relay chain".
(https://docs.substrate.io/tutorials/v3/cumulus/start-relay/)
Here, I copied the code and run it to start the alice validator.
./target/release/polkadot \
--alice \
--validator \
--base-path /tmp/relay/alice \
--chain <path to spec json> \
--port 30333 \
--ws-port 9944
"path to spec json" - What should I replace this?
I tried to build a chain spec file like this.
substrate build-spec > myCustomSpec.json
Error is here, "substrate : command no found"
What's the problem? Anyone can help me?
Thank you.

Polkadot is used to create the chain spec as described in the tutorial. You don't have substrate installed, and that would be incorrect to use anyway.
See the sections on raw and plain chain spec generation.

Related

The line import openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" is added when generating from openapi-generator prompts login

I am using openapi generator to generate my rest api client. It generates the line
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
In my imports but I can't for the life of me understand why. Running a go mod vendor prompts me to sign in while this line is in place. What is this trying to import? I'm on an enterprise github, which would complicate things. The example README says to add this line but provides no explanation of what it is doing https://github.com/OpenAPITools/openapi-generator/blob/master/samples/openapi3/client/petstore/go/go-petstore/README.md#:~:text=%22github.com/GIT_USER_ID/GIT_REPO_ID%22
You can pass those to the OpenAPI Generator client as parameters:
openapi-generator-cli generate \
-i openapi.yaml
-g go \
-p packageName=mypackage \
-o /src \
--git-repo-id my-go-lib/v1 --git-user-id user1 \
that will result in
openapiclient "github.com/user1/my-go-lib/v1"

AsyncAPI: Only generate payload

Is it possible to skip generation of specific files using asyncapi-generator?
I am using the Go generator but I only need the payload.go. Right now it always generates all files:
handlers.go payloads.go publishers.go router.go server.go subscribers.go
The command I am using is:
$ docker run --rm -it \
-v ${PWD}/asyncapi.yaml:/app/asyncapi.yml \
-v ${PWD}/output:/app/output \
asyncapi/generator -o /app/output /app/asyncapi.yml #asyncapi/go-watermill-template --force-write
You cannot selectively generate only selected files yet. I encourage you to join the related discussion on GitHub
From what I understand is that you are interested only in models generation. So maybe you should just use directly the Modelina tool that is used there in go-watermill-template.
Modelina is already integrated with AsyncAPI CLI and you can do asyncapi generate models golang asyncapi.yml

Grpc Go Generated.pb.go import was not formatted

I imported proto file (validator.proto) from one of my project https://github.com/maanasasubrahmanyam-sd/customValidation to another project (test.proto) https://github.com/maanasasubrahmanyam-sd/customeValTest/tree/master/interfaces/test_server
go get github.com/maanasasubrahmanyam-sd/customValidation
protoc \
-I. \
-I $GOPATH/src/ \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.1.0 \
--proto_path=${GOPATH}/src/github.com/google/protobuf/src \
--go_out="plugins=grpc:./generated" \
--validate_out="lang=go:./generated" \
--govalidators_out=. \
./interfaces/test_server/*.proto
The correct import should come as github.com/maanasasubrahmanyam-sd/customValidation/validator. But test.pb.go import was coming as _ "./validator" which shows red line in Goland.
EDIT - All pb.go files are showing errors in them. I suspect it is due to bad import.
I google it but did not found any relevant information. Any suggestion experts ?
You can address the proto path in two ways,
One: if your import proto file is in your local then you should move it to your parent directory then address it from your parent path like this:
- parentDirectory
-- directory1
--- proto1.proto
-- importDirectory
--- proto2.proto
you can build this file(proto1.proto) with this command :
protoc --proto_path=parentDirectory/directory1 --proto_path=parentDirectory --go-grpc_out=***your output path*** --go_out=***your output path*** parentDirectory/directory1/proto1.proto
also if you use Goland you need to add parentDirectory to your setting(File | Settings | Languages & Frameworks | Protocol Buffers) then uncheck Configure automatically and add your parent path.
Two: If your proto file is in URL: then you can add it to your build command like this:
protoc --proto_path=src \
--go_opt=Mprotos/buzz.proto=example.com/project/protos/fizz \
--go_opt=Mprotos/bar.proto=example.com/project/protos/foo \
protos/buzz.proto protos/bar.proto

Turtle build:android fails in azuredevops pipeline, what am i missing?

I get this error when running turtle build:android
turtle[4754] ERROR: Failed to build standalone app
err: ConfigError: The expected package.json path: /Users/runner/work/1/s/<key_alias>/package.json does not exist
This is what the script looks like in my .yml
turtle setup:ios \
IOS_DIST_P12_PASSWORD=$(IOS_DIST_P12_PASSWORD) \
turtle build:ios -u $(EXPO_CLI_USER) -p $(EXPO_CLI_PASSWORD)\
--team-id $(APPLE_TEAM_ID) \
--dist-p12-path ./my-app_dist.p12 \
--provisioning-profile-path ./myapp.mobileprovision \
--release-channel deployment
turtle setup:android \
ANDROID_KEYSTORE_PASSWORD=$(ANDROID_KEYSTORE_PASSWORD) \
ANDROID_KEY_PASSWORD=$(ANDROID_KEY_PASSWORD) \
turtle build:android -u $(EXPO_CLI_USER) -p $(EXPO_CLI_PASSWORD)\
--keystore-path ./my-app.jks \
--keystore-alias $(KEY_ALIAS) \
-t apk \
--release-channel deployment
I have all the correct information in the yml and all the env variables are defined. Do I also need to run keytool command before i run turtle build? I have already done it for the app in the past and the filepaths are there.
Same issue for ios, it says the path/package.json doesnt exist.
As a workaround:
Remove the Expo variables in front of the build command (they were already declared as variables) and it worked fine.
For details, please refer to this case.
In addition, you can try to check whether the android.package key is included in the expo object of the app.json file
{
"expo": {
"sdkVersion": "26.0.0",
"name": "TongPos",
"description": "your app desc",
"android": {
"package": "com.sohagfaruque.tongpos"
}
}
}

TeamCity API setting configuration parameters

I have configuration parametr current_build_date (User Defined Parameter) I want just to set this parameter to current date by API TeamCity.
On docs I have seen this:
http://teamcity:8111/httpAuth/app/rest/buildTypes/<buildTypeLocator>/parameters/<parameter_name>
I know my Build configuration ID, but I can't understand how by this to make buildTypeLocator.
I assume result will be something like this:
curl -u Login:Password \
-X PUT \
-d 'valueOfMyParam' \
-H 'Content-Type: text/plain' \
http://teamcity:8111/httpAuth/app/rest/buildTypes/<buildTypeLocator>/parameters/current_build_date
I will realy appreciate if somebody who knows TeamCity API will help me with this problem.
I made attempt just to pass instead of buildTypeLocator my Build configuration ID and I got ERROR:
[17:08:25][Step 3/3] Error has occurred during request processing (Not Found).
[17:08:25][Step 3/3] Error: jetbrains.buildServer.server.rest.errors.NotFoundException: No project found by name or internal/external id 'BuildConfigurationID'.
If there are any problems or ambiguities with my question please add comment, i'll try to fix it.
If you browse the REST API endpoints in a browser you'll be able to see the format of the build locator.
Visit http://teamcity:8111/httpAuth/app/rest/buildTypes/ and you'll see the entries have a href attribute that contains the buildLocator (generally a property:value combination)
You'll then be able to navigate using that url / communicate via the API
Hope this helps
I solved problem: build type locator was id:Build configuration ID
current_build_date=`date +%%Y-%%m-%%d:%%H:%%M:%%S`
echo $current_build_date;
curl -u Login:Password \
-X PUT \
-d $current_build_date \
-H 'Content-Type: text/plain' \
https://teamcity.billing.ru/httpAuth/app/rest/buildTypes/id:Build
configuration ID/parameters/current_build_date

Resources