Metaplex sign command metadata parameter - solana

After creating an NFT via candy machine v2 I'm trying to execute a sign command (link to the docs)
This is the command from the documentation:
ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts sign \
-e devnet \
-k ~/.config/solana/devnet.json \
-c example
Looking at the code it seems that the docs do not match the implementation.
It requires an -m/--metadata parameter and I'm not sure what it is.
Tried to plug in a bunch of different values, but I get
Transaction failed: Incorrect account owner or in one case Transaction failed: This metadata does not have creators
What should I put as the parameter? Seems to me that it must be a public key/address of some sort, but I'm unsure.
Thank you!

You are right, if you use the sign command you have to add -m
When signing mints made through candy machine I would recommend using the sign-all command or metaboss though. (See metaboss.rs)

Related

Starting bootcamp - MacTerminal and Github SSH fingerprint don't match

I have been following the steps of the courses pre-work, including:
checking for, generating, copy/paste, and
saving the SSH keys to GitHub.
But when I am instructed to check the matching fingerprints using "ssh -T git#github.com", the prints don't match.
I've even started from the beginning clear through, but they still don't match.
Thought I'd reach out here before using my 1 tutoring.
Hopefully the screenshot showing what I see helps(link).
EDIT- I understand there's some stuff in there that shouldn't be, I was just trying things for diff results. I would just like to know where I went wrong and how to avoid it.
What you ssh is the remote site SSH key fingerprint, not you registered SSH key fingerprint.
You see (or should see if you are contacting the correct github.com) the fingerprints exposed with api.github.com/meta as explained here.
Using jq, you can add them to your ~/.ssh/known_hosts with:
curl --silent https://api.github.com/meta \
| jq --raw-output '"github.com "+.ssh_keys[]' >> ~/.ssh/known_hosts
From there, you can test your connection with ssh -Tv github.com, and check if you see a welcome message:
Hi username!
You've successfully authenticated, but GitHub does not provide shell access

JIRA XRAY plugin creates duplicate test case when importing using API and feature file

I have a bash script that takes all the feature files from a specific directory and uses /rest/raven/1.0/import/feature?projectKey=XYZ XRAY-JIRA API to create TEST CASES in JIRA.
XRAY version 4.2.1_j7
I am running this script in a JENKINS-PIPELINE but the problem is when I run it for the first time it creates test cases which are correct but when I re-run the build it starts creating the same test cases again (duplicating them), any suggestion / reason why this is happening
My bash script:
#!/bin/bash
find <DIR_PATH> -type f -name "*.feature" | while read fname;
do
curl -H "Content-Type:multipart/form-data" -X $USERNAME:$PASSWORD -F "file=#$fname"
https://<JIRA_URL>/rest/raven/1.0/import/feature?projectKey=XYZ
done
Sample feature file:
Feature Facebook Login
#Login
Scenario: Log in to FB app
Given: User is at FB login page
When User enters username and password
Then User is logged in successfully
Please suggest me how and where can I debug to fix the issue
Thanks
First, I would highly recommend you to upgrade to the latest version is your current version is "rather old". Version 6.0 was just released few days ago.
I don't any open bug related to that, except this bug that been solved many releases ago.
You can try importing using a zip file, in a single request (which is more efficient btw). Maybe this approach implicitly addresses your problem, in the version in that you have.
Example:
rm -f features.zip
zip -r features.zip src/test/resources/calculator/ -i \*.feature
curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=#features.zip" "http://192.168.56.102/rest/raven/1.0/import/feature?projectKey=CALC"
If the problem persists, then mostly there's a bug there; please reach out Xray support team, so the team can properly analyze it with you.

How to automate helm package --sign non-interactively in bash

I am writing a bash script on a machine without expect.
The script automates the build of a helm (v2.9.1) chart.
I've got to the part in the script where it runs a
helm package --sign --key 'mykey' --keyring 'path/to/keyring' -d chartdir chart
and because helm prompts for the passphrase of the gpg key I created in order to use provenance files (a requirement), I cannot script around the soliciting of the passphrase, which I would like to prompt for separately as the script is part of a CI/CD build chain.
I have tried using
yes $promptedPassPhrase | helm package --sign...
and I got
xrealloc: cannot allocate 18446744071562067968 bytes (237568 bytes allocated)
I also tried plain old
echo $promptedPassPhrase | helm package --sign...
and I got
Error: inappropriate ioctl for device
I also tried script and got the same response. As I do not have expect on the server, I cannot expect my way round it, so I'm stumped as to how to automate the helm package command and am not going to use a key without a passphrase as it is bad practice.
I don't know how long this has been the case, or exactly which versions this works on, but this doc page says:
If your PGP private key has a passphrase, [...] You can set the HELM_KEY_PASSPHRASE environment variable to that passphrase in case you don't want to be prompted to enter the passphrase.
This works for me on v2.13.1. It looks like it was added in October of 2018, so my guess is that it was first available in v2.12.0-rc.1.
Although this doesn't directly answer the OP's question (since they asked about v2.9.1), it will hopefully help anyone who ends up here because they (like me the first time round) missed that line in the doc.

Accessing commit history from github via terminal?

Need some quick help. Novice terminal user here. Trying to use these instructions: https://developer.github.com/v3/repos/statistics/#commit-activity to get commit history for a specific user.
However, I don't know what to do with this:
GET /repos/:owner/:repo/stats/contributors
When I replace the owner and repo with the specific names i'm using, nothing happens because I get this error in my terminal:
-bash: GET: command not found
This is a very time sensitive issue, help! Thanks!
You can follow this curl tutorial using GitHub's API to see how you would translate
GET /repos/:owner/:repo/stats/contributors
As you notice in the comments, the ":" shouldn't be included.
curl --include https://api.github.com/users/caspyin
Pass user credential to basic auth to access protected resources like a users starred gists, or private info associated with their profile
curl --user "caspyin:PASSWD" https://api.github.com/gists/starred
curl --user "caspyin:PASSWD" https://api.github.com/users/caspyin
Passing just the username without the colon (:) will cause you to be prompted for your account password.
This avoids having your password in your command line history
curl --user "caspyin" https://api.github.com/users/caspyin
In your case, replacing <owner> and <reponame> by the right owner and repo names:
curl https://api.github.com/repos/<owner>/<reponame>/stats/contributors

Using cURL to send JSON within a BASH script

Alright, here's what I'm trying to do. I'm attempting to write a quick build script in bash that will check out a private repository from GitHub on a remote server. To do this a "hands off" as possible, I want to generate a local RSA key set on the remote server and add the public key as a Deploy Key for that particular repository. I know how to do this using GitHub's API, but I'm having trouble building the JSON payload using Bash.
So far, I have this particular process included below:
#!/bin/bash
ssh-keygen -t rsa -N '' -f ~/.ssh/keyname -q
public_key=`cat ~/.ssh/keyname.pub`
curl -u 'username:password' -d '{"title":"Test Deploy Key", "key":"'$public_key'"}' -i https://api.github.com/repos/username/repository/keys
It's just not properly building the payload. I'm not an expert when it comes to string manipulation in Bash, so I could seriously use some assistance. Thanks!
It's not certain, but it may help to quote where you use public_key, i.e.
curl -u 'username:password' \
-d '{"title":"Test Deploy Key", "key":"'"$public_key"'"}' \
-i https://api.github.com/repos/username/repository/keys
Otherwise it will be much easier to debug if you use the shell's debugging options set -vx near the top of your bash script.
You'll see each line of code (or block (for, while, etc) as it is in your file. Then you see each line of code with the variables expanded to their values.
If you're still stuck, edit your post to show the expanded values of variables for the problem line in your script. What you have looks reasonable at first glance.

Resources