0

I am following a tutorial and am on the step where we are uplaoding the metadata and files. The tutorial tells me to use the the following command:

npx ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload ./assets --env devnet --keypair \<PATH\>

When I run this command with my path, it says :

error: required option '-cp, --config-path <string>' not specified

When I type what I think is the config path, it says the keypair does not exist.

I am quite confused how to pass this step, could someone please help me?

Thanks

I am not quite sure what to do.

Reza Rahemtola
  • 1,182
  • 7
  • 16
  • 30
Yusuf BASER
  • 53
  • 1
  • 4
  • Not sure what is not undertood from the error. `-cp` is a required paramater. So find the correct path to the config and try again. – Gerhard Mar 29 '22 at 10:22
  • This is what i tried: I ran the command: Solana config get Output: "Config File: C:\Users\yusuf\.config\solana\cli\config.yml RPC URL: https://api.devnet.solana.com WebSocket URL: wss://api.devnet.solana.com/ (computed) Keypair Path: ~/.config/solana/devnet-hashlips.json Commitment: confirmed " So when I ran the command this is what I typed: "npx ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/devnet.devnet-hashlips.json -cp C:\Users\yusuf\.config\solana\cl\config.yml" "Keypath does not exist" – Yusuf BASER Mar 29 '22 at 11:34
  • Ok look, i have played around with directories and stuff. I may have figure it out, but now I have a syntax error I am confused about, – SyntaxError: Unexpected number in JSON at position 1 at JSON.parse () at getCandyMachineV2Config (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\helpers\various.ts:67:23) at Command. (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\candy-machine-v2-cli.ts:157:38) at processTicksAndRejections (node:internal/process/task_queues:96:5) – Yusuf BASER Mar 29 '22 at 12:06
  • I would say that it should be something like `-cp config.json` – Gerhard Mar 29 '22 at 12:06
  • I have tried that, but ii think I have the correct directory and file, here is the error I am working with : "SyntaxError: Unexpected number in JSON at position 1 at getCandyMachineV2Config (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\helpers\various.ts:67:23) at Command. (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\candy-machine-v2-cli.ts:157:38) at processTicksAndRejections (node:internal/process/task_queues:96:5)" – Yusuf BASER Mar 29 '22 at 12:15
  • Then either you have the wrong `config.json` or your `config.json` is not correctly configured. I would assume that the number in the json is starting with a `0` which is not valid. Only way we''ll know is if you can show the json content. – Gerhard Mar 29 '22 at 12:19
  • The only thing in the JSON file is the private key for the Solana wallet that it generated on the devnet. – Yusuf BASER Mar 29 '22 at 12:24
  • No, that is the wrong file. Look at the [`minimal configuration section`](https://docs.metaplex.com/candy-machine-v2/configuration#minimal-configuration) – Gerhard Mar 29 '22 at 12:28
  • In the tutorial, i have only done up to the Getting started page on metaplex. https://docs.metaplex.com/candy-machine-v2/getting-started And I have changed the keypair directory a bit, and that is what I am using in the command, and from what I understood from the video he used the same file as that. What do you recommend i do? What do you think? – Yusuf BASER Mar 29 '22 at 12:34
  • The `-k` switch is where you specify the keypair, the `-cp` switch is for the Candy Machine config, like I've shown in the previous liink. Now have a look at the [`documentation`](https://docs.metaplex.com/candy-machine-v2/creating-candy-machine) again and look at the exact layout of the `ts-node` command example on the page. – Gerhard Mar 29 '22 at 12:39
  • What does the -c Mean? Is that the previous file I was using that ended with .yml? – Yusuf BASER Mar 29 '22 at 12:50
  • that is the suffix for the cache file, it is all in the example given in the last link I've sent. – Gerhard Mar 29 '22 at 12:58
  • I honestly have no clue what I am doing at the moment. I do not know what to type and where i am just not comprehending anything at the moment right now. I think I might move on to a different tutorial if I cannot figure this out. Or just restart everything. – Yusuf BASER Mar 29 '22 at 13:00
  • Here is the example from the documentation: `ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload -e devnet -k ~/.config/solana/devnet.json -cp config.json -c example ./assets` – Gerhard Mar 29 '22 at 13:00
  • and an exact explanation of it __In this command we are specifying that we will run the upload in the devnet environment (`-e option`), we will use the wallet keypair `~/.config/solana/devnet.json` (`-k option`), the Candy Machine configuration file `config.json` (`-cp option`), the cache file suffix example (`-c option`) and upload our assets from the folder `./assets`__ – Gerhard Mar 29 '22 at 13:01
  • My assets folder is just name assets with nothing in front or behind does this matter? Also how do I find the candy machine config file. I am still not sure about what I type for the -c option sorry. – Yusuf BASER Mar 29 '22 at 13:05
  • You have to create a config file, like I've shown in the first link. – Gerhard Mar 29 '22 at 13:23
  • I am assuming this is the sort of thing I have to type: "ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload -e devnet -k npx/.config/solana/devnet.json -cp config.json -c example ./assets" I have also created the config folder. However there Is a new error that states: "Non-base58 character" – Yusuf BASER Mar 29 '22 at 13:43
  • at: Object.decode (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\node_modules\base-x\src\index.js:111:11) at new PublicKey (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\node_modules\@solana\web3.js\src\publickey.ts:56:30) at getCandyMachineV2Config (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\helpers\various.ts:164:9) at Command. (C:\Users\yusuf\Downloads\haslips start sol\metaplex-master\js\packages\cli\src\candy-machine-v2-cli.ts:157:38) at processTicksAndRejections (node:internal/process/task_queues:96:5) – Yusuf BASER Mar 29 '22 at 13:44
  • ok, I think you to be honest that you need to first follow all the steps in the documentation. You're at a point where you still need to understand the technology and you'll only get to that point once you have gone through that section of the the docs. Read it thoroughly as there is a lot of valuable information that will help you. – Gerhard Mar 29 '22 at 13:52

1 Answers1

0

Your config.json file have to be something like this. If you go through the metaplex documentation, they guide you through all the steps you have to follow from the beginning.

{
        "price": 1,
        "number": 3333,
        "gatekeeper": null,
        "solTreasuryAccount": "<Your Solana Treasury Wallet Address",
        "splTokenAccount": null,
        "splToken": null,
        "goLiveDate": "1 April 2022 20:00:00 GMT",
        "endSettings": null,
        "whitelistMintSettings": {
            "mode" : { "neverBurn" : true },
            "mint" : "<Solana Address of Minter of the whitelist tokens",
            "presale" : true,
            "discountPrice" : null
        },
        "hiddenSettings": null,
        "storage": "arweave-sol",
        "ipfsInfuraProjectId": null,
        "ipfsInfuraSecret": null,
        "nftStorageKey": null,
        "awsS3Bucket": null,
        "noRetainAuthority": false,
        "noMutable": false
    }
  • Sorry, but i have already resolved this issue, I deleted but apparently it did not delete. Thank you. It would also be much appreciated if you could help me in my most recent question which I am really confused about :) – Yusuf BASER Apr 01 '22 at 23:16