text:
What are the benefits of the two accounts model?
In some answer (see there) someone explained that there are several benefits for the two accounts system (one spending account and one reward account). What are those benefits? Wouldn't it be more practical to get your coins directly on your spending account?

For the user, yes, it would be easier to just get your rewards on your spending account as a UTXO. However, this is not scalable at all.
What this means is that every 5 days, the network would be flooded with hundreds of thousands of transactions to pay out everybody's staking rewards. Someday, it would be millions. Sooner than we think... billions.
Instead, the clever researchers and engineers came up with a system of the rewards account. This ada is "virtual" in that it doesn't really exist on chain until it's claimed with a transaction.
They made it so that the rewards values would count toward staked ada so you can continually accrue compounding rewards without having to flood the network with actual rewards transactions.  Once you claim it (Yoroi), or create any outgoing transaction (Daedalus), this rewards ada then becomes a utxo on the blockchain and thus non-rewards ada. If you don't need it, it's best to leave it be and only claim when you have to use it. You'll also save transaction fees by not continually claiming your rewards.
Clever, isn't it!


text:
Is it possible to send a native token to another wallet while sending the minimum amount of ADA to my own wallet?
Every transaction needs to include at least 1 ADA (See: Is there a minimum amount of ADA I can send in a transaction?).
I want to send a native token to someone else, but I don't want to send them the 1 ADA.
Let's say we have the following wallets (TokenX is a native token or NFT):

WalletA:

UTxO: 2 ADA
UTxO: 1 TokenX

Wallet B:

UTxO: 10 ADA

WalletA wants to send 1 TokenX to WalletB. Can I construct a transaction where I send 1 TokenX to WalletB and 1 ADA to my own WalletA address?
The end result would look like this (ignoring transaction fees for simplicity):

WalletA:

UTxO: 2 ADA

Wallet B:

UTxO: 10 ADA
UTxO: 1 TokenX

How can this be done and is this possible in Yoroi or Daedalus?

Every transaction needs to include at least 1 ADA (See: Is there a minimum amount of ADA I can send in a transaction?).

No, every UTxO (i.e. output you're sending asset to) needs to be atleast 1 ADA. This was included to prevent dust and spamming on blockchain. In future , it will be possible to offload this minUtxo fee to block creators who may opt-in to this feature.
You can read more about it here. There will be updates to protocol parameters as part of Alonzo, but this will likely not change in immediate future.

Thanks for the answer. This kind of sucks as it makes small payments (e.g. tips) using native assets (as well as ADA) pretty much impossible since you always have to pay 1 ADA (currently >$1) extra plus the fees.

With babel (link in the reply) , you dont pay for any minimum output, as it will be offloaded to block producers. The idea is to reduce dust transactions on chain, you would still be able to use scripts for alternate fee models, once plutus is fully live.

Emmanuel is correct, based on the coin name there is an amount of ADA that needs to be sent to every target address.
My native token requires 1.444443 ADA to be sent to each and every target address, i.e. if I want to send 1 Bingo Token to 100 individual addresses, I have to send 1.444443 ADA to each target address, irrespective of whether I batch them all into one transaction.
Really hope this falls away sooner rather than later.

"based on the coin name" - this statement looks like it is incorrect - see comments below.

Can you please elaborate on how the token name influences the amount of ADA needed to send the token?

@eddex, I saw in a thread in discord that it has to do with the length of your native token name and the amount of decimals, but can't vouch for the accuracy. Actually, after looking into it, I found another example of a 1.44443 minimum ada on a token with 4 letters while I have the same minimum with 5 letters.
Here is a reddit thread discussing the fee: https://www.reddit.com/r/ADAXPRO/comments/o6cnle/moving_adax_to_yoroi_wallet/

Every Native Asset is sort of conjoined to 1.4XXXXXX ADA from my experience and so it basically impossible to simply just send the native asset by itself. It’s a part of it. You’ll end up having to cover transaction fees with part of your 2 ADA.
This is all from my time manually minting and sending assets with the CLI. Will advise further research.

What do you mean by "conjoined to 1.4 ADA"? To my understanding native assets are completely independent assets that live next to ADA. You only need ADA to pay for transaction fees and to cover the minimum amount that needs to be sent in a transaction.

Every native asset UTXO must move with at least 1ADA. It’s called the min-ada-value. With time and parameter adjustments that value will change.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Does Daedalus wallet validate transactions on the network in a way that's useful to the network?
Daedalus wallet is a 'full node wallet' does that mean it  acts like a validator node on the network while active? or does it simply mean that it validates all the transactions on the blockchain for internal use only?
Does the distinction make sense?
If I leave Daedalus running on my laptop will it do meaningful work for the network?

From my understanding, it does meaningful work for the network. When you run Daedalus, you run a local cardano-node with which Daedalus' back-end interacts via the node-to-client IPC protocol (more info). From documentation we can see that cardano-node does validate and relay blocks. I wasn't able to find anything about how validation affects relaying but I suppose nodes don't relay invalid blocks.
[update]
I think my assumption was correct. I found a superb video from Andrew Westberg's youtube channel. He talks in more details about how Tx is propagated. Take a look at step 3.3, where cardano-node runs a validation before relaying info further.
1. Cardano-node to mempool (transactions aggregation phase, where mempool is a place where store transactions we hear in a network)

Cardano-node places the tx into its mempool.
Nodes connected to yours ask it “You seen any new transactions lately?”
Your node responds with “Sure have, you want them too?”
Their node asks “Yes, I’d like to have those particular transactions”
Your node says, “Here you go”.
Rinse/repeat and everybody’s mempool looks roughly similar with the transactions it holds.

2. From mempool to block

Some stakepool out there wins the lottery and decides to mint a newhblock.
They add txns from their mempool into the block until it is exhausted or the
maximum block size is reached.
The stakepool then places the block at the tip of its own blockchain.
Any transactions added to the block are removed from the stakepool’s
mempool.

3. From block to the network

Other nodes ask the stakepool, “You seen any blocks lately”
The stakepool responds, “I sure have. Looks like I’ve got one more than you
do. Here’s the header information and the hash.”
“That looks like a valid block, do you mind sending me the whole thing?”
“No problem, here you go!”
Rinse/Repeat and now the whole network agrees that the new block is valid.
All nodes remove the transactions that occur in the block from their
mempools.

does it simply mean that it validates all the transactions on the blockchain for internal use only?

Yes.

does that mean it acts like a validator node on the network while active?

No.

Does the distinction make sense? If I leave Daedalus running on my laptop will it do meaningful work for the network?

No.
The description you are referring to:

Daedalus is a full node wallet. This means that unlike light wallets
(e.g.Yoroi, Adalite etc.) Daedalus downloads a full copy of the
Cardano blockchain and independently validates every transaction in
its history. That way you get maximum security and completely
trustless operation, without centrally hosted 3rd party servers.

only means that Daedalus holds a full copy of the ledger which means the wallet can validate every single block from the past. There is no pruning as you would have with lightweight wallets.
However, Daedauls runs cardano-node in wallet-mode/passive mode, meaning it cannot verify new transactions coming to the network - only producer nodes do that. They can extend the blockchain.

Just to add clarification to answer from @Yanis , in the current implementation - Daedalus plays a role in helping network only when serving an incoming connection, which would be the case if your node is listening on publicly reachable IP:port combination and you have a peer who specified your IP:port in their topology.
However, it does provide you assurance of any transaction you submit is directly submitted to network by broadcasting to the topology (by default only IOG nodes, who would relay it further to network).

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How can I send ADA to a Yoroi wallet?
I have created a new Yoroi wallet and I want to send ADA to the newly created Yoroi wallet, but I don't know how.

You can refer to the Yorio FAQ for this: https://yoroi-wallet.com/#/faq/2

To receive Ada go to the Receive tab in your wallet and generate an address. Use a button in the user interface to copy it to the clipboard and then share it with the person who is going to send you Ada.


text:
Did the token fingerprint hash algorithm change?
I have an question about the asset fingerprint.
For example here:
https://pool.pm/333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b.ExtraHate067
it shows asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm
here it shows the same: https://cardano-tools.io/latest?q=ExtraHate067
but the explorer
https://explorer.cardano.org/en/transaction?id=0d560535733237eaafa4f3c25e648d147dc93a048e3dc66e5199cd86986b5a2c
shows asset1q7c0qhulpty4tcdp3cwt8eg5edws9c8lqyldlr did they change the hash algorithm?

Yes, it's really strange. I managed to find a transaction where fingerprints are equal. Necromancer 003 https://cardano-tools.io/latest?q=f4988f549728dc76b58d7677849443caf6e5385dc67e6c25f6aa901e https://explorer.cardano.org/en/transaction?id=a4b4c4c637bf297af7ece2079bdbf6af8bbbcb6611603ae8a6109a47ea804de7

Wow, good catch. You can see fingerPrint function here. It's located in cardano-graphql project.
export const assetFingerprint = (asset: Pick<Asset, 'assetName' | 'policyId'>) =>
  new AssetFingerprint(
    Buffer.from(asset.policyId, 'hex'),
    asset.assetName !== '' ? Buffer.from(asset.assetName, 'hex') : undefined)
    .fingerprint()

After running this code
const fingerPrint = ({ policyId, assetName }) => {
  const af = new AssetFingerprint(
    Buffer.from(policyId, 'hex'),
    Buffer.from(assetName, 'hex'),
  ).fingerprint()

  return af
}

const combinations = [
  {policyId:'333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b',
   assetName:'457874726148617465303637'},
  {policyId: "",
   assetName:'457874726148617465303637'},
  {policyId: '333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b',
   assetName: ""},
]

combinations.map(fingerPrint)

I got
[
  'asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm',
  'asset1q7c0qhulpty4tcdp3cwt8eg5edws9c8lqyldlr',
  'asset19nqnahcv54krdv8mcc0ne60wlkealw5qaztzvp'
]

Which means that policyId is missing in the explorer but the fingerprint function is the same.
You can rerun my code in replit.
I also created an issue for cardano-explorer-app.

This looks like a bug in explorer.cardano.org.
You can use the JS package @emurgo/cip14-js to check for yourself.
import AssetFingerprint from '@emurgo/cip14-js'

const assetFingerprint = new AssetFingerprint(
    Buffer.from('333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b', 'hex'),
    Buffer.from('457874726148617465303637', 'hex'),
  )
assetFingerprint.fingerprint()
// returns asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm

Fixed in https://github.com/input-output-hk/cardano-graphql/pull/526. Thanks for the investigation.
Edit: Released in 5.0.0, adopted by cardano-explorer-app in 1.6.0


text:
How to transfer ADA from Daedalus wallet to Yoroi wallet?
I have created a new Yoroi wallet but I want to transfer ADA from Daedalus wallet, but I don't know how.
For example:
I have 20 ADA that I want to send to a Yoroi wallet and I want to send them from a Daedalus wallet.

Get your Yoroi wallet address. See How to send ADA to Yoroi wallet?
In Daedalus send some ADA to this address.

Alternatively, you can also restore the Daedalus wallet in Yoroi if you just want to switch the wallet applocation. To do this you can use the restore function in Yoroi. Then you'll see the 20 ADA from Daedolus in Yoroi. This is not a transaction, you just imported the wallet in Yoroi. Yoroi and Daedalus are just different tools to manage your wallet.


text:
What is the correct Plutus repo tag for Plutus Pioneer Program week01?
I'm starting out with the Plutus Pioneer Program at https://github.com/input-output-hk/plutus-pioneer-program. One of the first steps is to clone the Plutus repo https://github.com/input-output-hk/plutus.git from the tag specified in the cabal.project
tag: 3746610e53654a1167aeb4c6294c6096d16b0502.
This doesn't appear to be a tag on the Plutus repo. Is it still possible to get the correct Plutus version for the Pioneer Program code?

With tag: 3746610e53654a1167aeb4c6294c6096d16b0502 in cabal.project they refer to a commit, not a git tag.
You can find it here: https://github.com/input-output-hk/plutus/commit/3746610e53654a1167aeb4c6294c6096d16b0502
So to get the correct version of the repo, you can check out the git commit:
git checkout 3746610e53654a1167aeb4c6294c6096d16b0502

I don't think I have configured anything special in git, but I can git checkout with a shortened hash:  git checkout 3746610e  - less frightening :-)


text:
Is there a penalty for having two block-producing (BP) nodes in a pool that try to mint a block in the same slot?
Is there a penalty for having two block-producing (BP) nodes in a pool that try to mint a block in the same slot? For example, I'd like to bring up a new BP node in another region, but that results in two serving BP nodes for a brief moment, and just maybe that moment just happens to be the leader slot for the pool. What's the worst case scenario under this condition?

There is no such penalty at the protocol level.
However, you will probably get called out on Twitter :)

Hi, thanks! Can you explain what actually happens in this scenario? My guess is that there's a "slot battle" but in this case the VRF key would be the same for both nodes, so I'm not sure how the protocol handles this situation.


text:
cardano-node goes down after "cardano-cli query pool-params"
Making this query to my cardano-cli
cardano-cli query pool-params \
    --stake-pool-id pool13crd2ljx87988umk22er6ynwadfwdqupdpcq6prc6v59z62kxse \
    --mainnet

Makes my cardano-node goes down. Is this normal behaviour?
I guess not. How can I check why is this happening?
This is the log:
Jun 18 08:38:21 ip-172-31-10-236 cardano-node[1948]: [ip-172-3:cardano.node.ChainDB:Notice:540] [2021-06-18 08:38:21.15 UTC] Chain extended, new tip: 47e663c6efcfd52f6895e020032bfb672deddb8a3d1047a1c40d4ef186177ff0 at slot 32439210
Jun 18 08:39:21 ip-172-31-10-236 cardano-node[1948]: [ip-172-3:cardano.node.BlockFetchDecision:Info:550] [2021-06-18 08:39:21.53 UTC] [TraceLabelPeer (ConnectionId {localAddress = 172.31.10.236:34107, remoteAddress = 52.15.190.154:6000}) (Right [At (Block {blockPointSlot = SlotNo 32439270, blockPointHash = 449361583216f3fe0ec748bc32ea22f3ef3a9fe3e951845e017e49698b65a6fb})])]
Jun 18 08:39:21 ip-172-31-10-236 cardano-node[1948]: [ip-172-3:cardano.node.ChainDB:Notice:540] [2021-06-18 08:39:21.54 UTC] Chain extended, new tip: 449361583216f3fe0ec748bc32ea22f3ef3a9fe3e951845e017e49698b65a6fb at slot 32439270
Jun 18 08:39:49 ip-172-31-10-236 cardano-node[1947]: /home/ubuntu/cardano-my-node/startBlockProducingNode.sh: line 9:  1948 Killed                  /usr/local/bin/cardano-node run --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}
Jun 18 08:39:49 ip-172-31-10-236 systemd[1]: cardano-node.service: Main process exited, code=exited, status=137/n/a
Jun 18 08:39:49 ip-172-31-10-236 systemd[1]: cardano-node.service: Failed with result 'exit-code'.
Jun 18 08:39:54 ip-172-31-10-236 systemd[1]: cardano-node.service: Scheduled restart job, restart counter is at 1.
Jun 18 08:39:54 ip-172-31-10-236 systemd[1]: Stopped Cardano node service.
Jun 18 08:39:54 ip-172-31-10-236 systemd[1]: Started Cardano node service.
Jun 18 08:39:56 ip-172-31-10-236 cardano-node[64305]: Listening on http://127.0.0.1:12798
Jun 18 08:39:57 ip-172-31-10-236 cardano-node[64305]: [ip-172-3:cardano.node.networkMagic:Notice:5] [2021-06-18 08:39:56.52 UTC] NetworkMagic 764824073

I don't have any problem with queries like:
cardano-cli query utxo --address ...

Can you elaborate on what "goes down" means? Can you share the cardano node log?

There is a high likelyhood that you run out of memory when running that query, as it involves querying subset of ledger, which can cause a spike to your memory usage (if it is marginal to minimum recommendations). Assuming you're on Linux , you can check via dmesg -T | grep cardano to see if it was caused by OOM event.
If not, you'd need to check logs and provide more details

Yes, that was the reason. Thank you. Here the log: [Fri Jun 18 08:39:48 2021] Out of memory: Killed process 1948 (cardano-node) total-vm:1074772472kB, anon-rss:5803728kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:11620kB oom_score_adj:0


text:
.NET cardano-cli query utxo Process freezes on a specific address
I have a strange situation where running the cli from a .net Process.Start() it works all of the time (on tested addresses), but on 1 address it just freezes - process.WaitForExit() never exits.
When the cli is run from the command line - I get all results as expected. Pretty sure this is something with Process.Start(), but for the life of me I can't figure it out.
Addresses below
Works (Arguments) - has about 8 UTXOs
query utxo --address addr_test1qz065xj60utnn4d0wmnc3aqt84w73vwlegmpves5v8pyrh5mm26227qq66j3uzr38xn5gy9swm7h4g3lxu8u0nqzddjquz6fqm  --testnet-magic 1097911063

Locks up (Arguments) - has about 40 UTXOs
query utxo --address addr_test1qz7mvmykanj59dz49ef5lvvn0yymmsj77w2pjfynkf3an2vq3jtd2jajxyfylhvpxskdyeum4s6rr4x08kl28r4hc72sskhe6g  --testnet-magic 1097911063

Also I know this should be an async function - but I'll sort that later ;-)
public CardanoCliResult Cli(List<string> arguments, bool useNetwork = false, bool useEra = false) {
    if (useNetwork) arguments.Add($" {_network}");
    if (useEra) arguments.Add($" {_era}");
    ProcessStartInfo start = new ProcessStartInfo() {
        FileName = _cli,
        Arguments = string.Join(" ", arguments),
        UseShellExecute = false,
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        CreateNoWindow = true,
    };
    start.EnvironmentVariables["CARDANO_NODE_SOCKET_PATH"] = _socket;

    var process = Process.Start(start);
    process.WaitForExit(); <<<<------ Locks up here
    var result = new CardanoCliResult() {
        Command = $"{_cli} {string.Join(Environment.NewLine, arguments)}{Environment.NewLine}",
        Ok = process.ExitCode == 0,
        Error = process.StandardError.ReadToEnd().Trim(),
        Output = process.StandardOutput.ReadToEnd().Trim()
    };
    ConsoleUpdateCli(result);
    return result;
}

If anyone has an idea or has seen this before, any help would be great
Thanks

Solution I found at https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.redirectstandardoutput?view=net-5.0:
var process = Process.Start(start);
string so = process.StandardOutput.ReadToEnd();
string se = process.StandardError.ReadToEnd();
process.WaitForExit();

Hopefully it stays working

Ok - I think I have the solution
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.redirectstandardoutput?view=net-5.0
You need to read the output before you wait - who knew ;-).

I found the answer - read the output before the wait
var process = Process.Start(start);
string so = process.StandardOutput.ReadToEnd();
string se = process.StandardError.ReadToEnd();
process.WaitForExit();


text:
Error running cardano-db-sync in docker-compose file as devcontainer
I have a docker-compose.yml file which I use as a devcontainer for VSCode. Part of my application requires access to cardano-db-sync so that I can query the database for transaction information. I am unsure how to get the dev service to communicate with the db-sync service. I have copied the entire docker-compose.yml and config/ directory from cardano-db-sync into my project. The error I'm getting is:
Connecting to network: mainnet
/nix/store/6f4mj582ymmn8zx90j8f8n9sx540hi9x-entry-point/bin/entry-point: line 26: /nix/store/74ky2ipmmh6y7qjxp0q03vh316dxddw2-cardano-db-sync-mainnet: Is a directory
/nix/store/6f4mj582ymmn8zx90j8f8n9sx540hi9x-entry-point/bin/entry-point: line 26: exec: /nix/store/74ky2ipmmh6y7qjxp0q03vh316dxddw2-cardano-db-sync-mainnet: cannot execute: Is a directory
/nix/store/6f4mj582ymmn8zx90j8f8n9sx540hi9x-entry-point/bin/entry-point: line 26: /nix/store/74ky2ipmmh6y7qjxp0q03vh316dxddw2-cardano-db-sync-mainnet: Is a directory
/nix/store/6f4mj582ymmn8zx90j8f8n9sx540hi9x-entry-point/bin/entry-point: line 26: exec: /nix/store/74ky2ipmmh6y7qjxp0q03vh316dxddw2-cardano-db-sync-mainnet: cannot execute: Is a directory

My dev service looks like this:
    dev:
        build:
            context: .
            dockerfile: DevContainer.Dockerfile
        volumes: [
            ../:/app/
        ]
        command: sleep infinity
        ports:
            - "3001:3001"
        networks:
            - dev-network
        cap_add:
            - SYS_PTRACE
        security_opt:
            - seccomp:unconfined

and db-sync is:
    cardano-db-sync:
        image: inputoutput/cardano-db-sync:10.0.0
        environment:
            - NETWORK=${NETWORK:-mainnet}
            - POSTGRES_HOST=postgres
            - POSTGRES_PORT=5432
        depends_on:
            - cardano-node
            - postgres
        secrets:
            - postgres_password
            - postgres_user
            - postgres_db
        volumes:
            - db-sync-data:/var/lib/cdbsync
            - node-ipc:/node-ipc
        networks:
            - dev-network
        restart: on-failure
        logging:
            driver: "json-file"
            options:
                max-size: "200k"
                max-file: "10"

secrets:
    postgres_db:
        file: ./config/secrets/postgres_db
    postgres_password:
        file: ./config/secrets/postgres_password
    postgres_user:
        file: ./config/secrets/postgres_user

volumes:
    db-sync-data:
    postgres:
    node-db:
    node-ipc:

networks:
    dev-network:

saw this GitHub issue
https://github.com/input-output-hk/cardano-db-sync/issues/655

upgrading the image version to 10.0.1 will resolve the entry point issue.
image: inputoutput/cardano-db-sync:10.0.1

Really? The comments on the GitHub issue: https://github.com/input-output-hk/cardano-db-sync/issues/655 say the issue is still unresolved.

@NikeDattani It was resolved by 10.0.1 release. check the issue again.

At the time of your answer, the last comment was "This is still an issue as replicated by @meiblorn." It was hours later than the issue was closed (without really answering that last comment).

@NikeDattani
I saw this pull request.
https://github.com/input-output-hk/cardano-db-sync/pull/698


text:
Failed to build eventful-sql-common-0.2.0
For lecture 10 of plutus pioneering program, we had to run cabal run uniswap-pab to create the contract IDs. I got this
 - plutus-pioneer-program-week10-0.1.0.0 (exe:uniswap-pab) (first run)
Starting     eventful-sql-common-0.2.0 (lib)
Building     eventful-sql-common-0.2.0 (lib)

Failed to build eventful-sql-common-0.2.0.
Build log (
/Users/hud/.cabal/logs/ghc-8.10.2/vntfl-sql-cmmn-0.2.0-cb78f53d.log ):
Configuring library for eventful-sql-common-0.2.0..
Preprocessing library for eventful-sql-common-0.2.0..
Building library for eventful-sql-common-0.2.0..
[1 of 5] Compiling Eventful.Store.Sql.JSONString ( src/Eventful/Store/Sql/JSONString.hs, dist/build/Eventful/Store/Sql/JSONString.o, dist/build/Eventful/Store/Sql/JSONString.dyn_o )
[2 of 5] Compiling Eventful.Store.Sql.Orphans ( src/Eventful/Store/Sql/Orphans.hs, dist/build/Eventful/Store/Sql/Orphans.o, dist/build/Eventful/Store/Sql/Orphans.dyn_o )

src/Eventful/Store/Sql/Orphans.hs:19:21: warning: [-Wdeprecations]
    In the use of data constructor ‘PersistDbSpecific’
    (imported from Database.Persist.Sql, but defined in persistent-2.11.0.4:Database.Persist.Types.Base):
    Deprecated: "Deprecated since 2.11 because of inconsistent escaping behavior across backends. The Postgres backend escapes these values, while the MySQL backend does not. If you are using this, please switch to 'PersistLiteral' or 'PersistLiteralEscaped' based on your needs."
   |
19 |   fromPersistValue (PersistDbSpecific t) =
   |                     ^^^^^^^^^^^^^^^^^
[3 of 5] Compiling Eventful.Store.Sql.Operations ( src/Eventful/Store/Sql/Operations.hs, dist/build/Eventful/Store/Sql/Operations.o, dist/build/Eventful/Store/Sql/Operations.dyn_o )

src/Eventful/Store/Sql/Operations.hs:18:1: warning: [-Wunused-imports]
    The import of ‘maybe’ from module ‘Data.Maybe’ is redundant
   |
18 | import Data.Maybe (listToMaybe, maybe)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Eventful/Store/Sql/Operations.hs:19:1: warning: [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
   |
19 | import Data.Monoid ((<>))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
[4 of 5] Compiling Eventful.Store.Sql.DefaultEntity ( src/Eventful/Store/Sql/DefaultEntity.hs, dist/build/Eventful/Store/Sql/DefaultEntity.o, dist/build/Eventful/Store/Sql/DefaultEntity.dyn_o )

src/Eventful/Store/Sql/DefaultEntity.hs:25:1: error:
    Generating Persistent entities now requires the MultiParamTypeClasses language extension. Please enable it by copy/pasting this line to the top of your file:

{-# LANGUAGE MultiParamTypeClasses #-}
   |
25 | share [mkPersist sqlSettings, mkMigrate "migrateSqlEvent"] [persistLowerCase|
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
cabal: Failed to build eventful-sql-common-0.2.0 (which is required by
exe:uniswap-pab from plutus-pioneer-program-week10-0.1.0.0). See the build log
above for details.

I tried to remove the dist-newstyle folder and tried run cabal configure && cabal build but to no avail. How do I deal with eventful sql errors?

Can you provide more of the error message?

@MatthiasSieber added!

So I solved it. Recollect in lesson 3 where you have to update the  plutus repo with the tag in cabal.project (from lesson 10). Then in the plutus repo, nix build -f default.nix plutus.haskell.packages.plutus-core (this may or may not be necessary) and run nix-shell. Then cabal run uniswap-pab in the lesson 10 repo should work.

Altering cabal.project line for eventful-sql-common is also an option: the error suggests that build needs another extension (MultiParamTypeClasses) which can be added to respective line of cabal.project:
@ code/week10/cabal.project:41 @ source-repository-package
-- newer version of persistent. See stack.yaml for the mirrored
-- configuration.
package eventful-sql-common
-  ghc-options: -XDerivingStrategies -XStandaloneDeriving -XUndecidableInstances -XDataKinds -XFlexibleInstances
+  ghc-options: -XDerivingStrategies -XStandaloneDeriving -XUndecidableInstances -XDataKinds -XFlexibleInstances -XMultiParamTypeClasses


text:
Invalid KES signature OCERT but gLiveView shows KES is valid
Have recently rotated KES following steps.
I cannot get any block to get adopted despite being selected as a slot leader number of times already. As you can see Guild LiveView tool shows that KES kes are valid. But the logs from cardano-node show otherwise.

Jun 17 16:39:29 wladyslawa bash[1021152]:

[wladysla:cardano.node.ChainDB:Error:82] [2021-06-17 15:39:29.01 UTC]
Invalid block
95def156e23112ebe3f9c6832ac96059d10ff5c446bdbbbc275b2698dfc336d0 at
slot 32378078: ExtValidationErrorHeader (HeaderProtocolError
(HardForkValidationErrFromEra S (S (S (Z (WrapValidationErr
{unwrapValidationErr = ChainTransitionError [OverlayFailure
(OcertFailure (InvalidKesSignatureOCERT 249 243 6 "Reject"))]}))))))

More errors:
maciej@ola:~/Downloads$ grep -ir ":error" logs.txt  -C 1
Jun 17 14:00:38 wladyslawa bash[1021152]: [wladysla:cardano.node.Forge:Info:92] [2021-06-17 13:00:38.00 UTC] fromList [("val",Object (fromList [("kind",String "TraceNodeNotLeader"),("slot",Number 3.2368547e7)])),("credentials",String "Cardano")]
Jun 17 14:00:38 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Error:73120] [2021-06-17 13:00:38.48 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Application Exception: 192.168.0.12:6000 ExceededTimeLimit (ChainSync (Header (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (Tip HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (ServerAgency TokNext TokMustReply)
Jun 17 14:00:38 wladyslawa bash[1021152]: [wladysla:cardano.node.ErrorPolicy:Notice:100] [2021-06-17 13:00:38.48 UTC] IP 192.168.0.12:6000 ErrorPolicySuspendConsumer (Just (ApplicationExceptionTrace ExceededTimeLimit (ChainSync (Header (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (Tip HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (ServerAgency TokNext TokMustReply))) 20s
--
Jun 17 14:04:25 wladyslawa bash[1021152]: [wladysla:cardano.node.Forge:Info:92] [2021-06-17 13:04:25.00 UTC] fromList [("val",Object (fromList [("kind",String "TraceNodeNotLeader"),("slot",Number 3.2368774e7)])),("credentials",String "Cardano")]
Jun 17 14:04:25 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Error:99511] [2021-06-17 13:04:25.20 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Application Exception: 192.168.0.12:6000 ExceededTimeLimit (ChainSync (Header (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (Tip HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (ServerAgency TokNext TokMustReply)
Jun 17 14:04:25 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Info:99511] [2021-06-17 13:04:25.20 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Closed socket to 192.168.0.12:6000
--
Jun 17 14:05:56 wladyslawa bash[1021152]: [wladysla:cardano.node.Forge:Info:92] [2021-06-17 13:05:56.00 UTC] fromList [("val",Object (fromList [("kind",String "TraceNodeNotLeader"),("slot",Number 3.2368865e7)])),("credentials",String "Cardano")]
Jun 17 14:05:56 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Error:99547] [2021-06-17 13:05:56.21 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Application Exception: 192.168.0.12:6000 ExceededTimeLimit (ChainSync (Header (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (Tip HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (ServerAgency TokNext TokMustReply)
Jun 17 14:05:56 wladyslawa bash[1021152]: [wladysla:cardano.node.ErrorPolicy:Notice:100] [2021-06-17 13:05:56.21 UTC] IP 192.168.0.12:6000 ErrorPolicySuspendConsumer (Just (ApplicationExceptionTrace ExceededTimeLimit (ChainSync (Header (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (Tip HardForkBlock (': * ByronBlock (': * (ShelleyBlock (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Allegra StandardCrypto)) (': * (ShelleyBlock (ShelleyMAEra 'Mary StandardCrypto)) ('[] *))))))) (ServerAgency TokNext TokMustReply))) 20s
--
Jun 17 14:05:57 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Info:102] [2021-06-17 13:05:57.21 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Skipping peer 192.168.0.12:6000
Jun 17 14:05:57 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Error:102] [2021-06-17 13:05:57.21 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Failed to start all required subscriptions
Jun 17 14:05:57 wladyslawa bash[1021152]: [wladysla:cardano.node.Mempool:Info:99577] [2021-06-17 13:05:57.23 UTC] fromList [("tx",Object (fromList [("txid",String "txid: TxId {_unTxId = SafeHash \"fb5f593592735aa5507b2881705e902611729620968b4c890718cb775ce9d4fc\"}")])),("mempoolSize",Object (fromList [("bytes",Number 87490.0),("numTxs",Number 152.0)])),("kind",String "TraceMempoolRejectedTx"),("err",Object (fromList [("badInputs",Array [String "d22db824b458406b322b8e2620768bd3c5ff1120208de2fbce57d5b553a69ff5#1"]),("consumed",Object (fromList [("lovelace",Number 0.0),("policies",Object (fromList []))])),("error",String "This transaction consumed Value 0 (fromList []) but produced Value 284069674 (fromList [(PolicyID {policyID = ScriptHash \"defca4b95934aec82b818cbafd4bd0ab45511c1d690b58759f07d9b1\"},fromList [(\"VyFi\",24900)])])"),("kind",String "ValueNotConservedUTxO"),("produced",Object (fromList [("lovelace",Number 2.84069674e8),("policies",Object (fromList [("defca4b95934aec82b818cbafd4bd0ab45511c1d690b58759f07d9b1",Object (fromList [("56794669",Number 24900.0)]))]))]))]))]
--
Jun 17 14:06:07 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Info:102] [2021-06-17 13:06:07.21 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Skipping peer 192.168.0.12:6000
Jun 17 14:06:07 wladyslawa bash[1021152]: [wladysla:cardano.node.IpSubscription:Error:102] [2021-06-17 13:06:07.21 UTC] IPs: 0.0.0.0:0 [192.168.0.12:6000] Failed to start all required subscriptions
Jun 17 14:06:08 wladyslawa bash[1021152]: [wladysla:cardano.node.LeadershipCheck:Info:92] [2021-06-17 13:06:08.00 UTC] {"kind":"TraceStartLeadershipCheck","chainDensity":5.040153e-2,"slot":32368877,"delegMapSize":644495,"utxoSize":2660038,"credentials":"Cardano"}
--
Jun 17 16:39:29 wladyslawa bash[1021152]: [wladysla:cardano.node.Forge:Info:92] [2021-06-17 15:39:29.00 UTC] fromList [("val",Object (fromList [("kind",String "TraceForgedBlock"),("slot",Number 3.2378078e7)])),("credentials",String "Cardano")]
Jun 17 16:39:29 wladyslawa bash[1021152]: [wladysla:cardano.node.ChainDB:Error:82] [2021-06-17 15:39:29.01 UTC] Invalid block 95def156e23112ebe3f9c6832ac96059d10ff5c446bdbbbc275b2698dfc336d0 at slot 32378078: ExtValidationErrorHeader (HeaderProtocolError (HardForkValidationErrFromEra S (S (S (Z (WrapValidationErr {unwrapValidationErr = ChainTransitionError [OverlayFailure (OcertFailure (InvalidKesSignatureOCERT 249 243 6 "Reject"))]}))))))
Jun 17 16:39:29 wladyslawa bash[1021152]: [wladysla:cardano.node.ChainDB:Info:82] [2021-06-17 15:39:29.01 UTC] Valid candidate 82548006ab042d802e1f885e028ea93038282d028b9530999e9dfc63473ff247 at slot 32378076
Jun 17 16:39:29 wladyslawa bash[1021152]: [wladysla:cardano.node.Forge:Error:92] [2021-06-17 15:39:29.01 UTC] fromList [("val",Object (fromList [("kind",String "TraceForgedInvalidBlock"),("reason",Object (fromList [("error",Object (fromList [("error",Object (fromList [("failures",Array [Object (fromList [("error",String "Reject"),("kind",String "InvalidKesSignatureOCERT"),("opCertExpectedKESEvolutions",String "6"),("opCertKESCurrentPeriod",String "249"),("opCertKESStartPeriod",String "243")])]),("kind",String "ChainTransitionError")])),("kind",String "HeaderProtocolError")])),("kind",String "ValidationError")])),("slot",Number 3.2378078e7)])),("credentials",String "Cardano")]
Jun 17 16:39:30 wladyslawa bash[1021152]: [wladysla:cardano.node.LeadershipCheck:Info:92] [2021-06-17 15:39:30.00 UTC] {"kind":"TraceStartLeadershipCheck","chainDensity":5.0332207e-2,"slot":32378079,"delegMapSize":644766,"utxoSize":2661388,"credentials":"Cardano"}

All logs at Dropbox.
Update:
I followed the directions to make sure that the opCertExpectedKESEvolutions matched the actual evolutions.
The command cardano-cli text-view decode-cbor --in-file <path>/op.cert  | grep int | head -1 returns 6 but now the expected evolutions is 8???
That did not work. I am getting the same error again.
Jul 01 16:02:50 wladyslawa bash[680275]: [wladysla:cardano.node.Forge:Error:115] [2021-07-01 15:02:50.01 UTC] fromList [("val",Object (fromList [("kind",String "TraceForgedInvalidBlock"),("reason",Object (fromList [("error",Object (fromList [("error",Object (fromList [("failures",Array [Object (fromList [("error",String "Reject"),("kind",String "InvalidKesSignatureOCERT"),("opCertExpectedKESEvolutions",String "8"),("opCertKESCurrentPeriod",String "259"),("opCertKESStartPeriod",String "251")])]),("kind",String "ChainTransitionError")])),("kind",String "HeaderProtocolError")])),("kind",String "ValidationError")])),("slot",Number 3.3585479e7)])),("credentials",String "Cardano")]

gLiveView can only tell you what your current KES key's start/expiry time is. But another base property of KES key is the number of times your key was rotated. You can check your current key using cardano-cli text-view decode-cbor --in-file <path>/op.cert  | grep int | head -1. Your current cert can only be higher, (not lower) than the one used for your previous blocks.
The upcoming public pgrest API on guild-operators website (currently in alpha stage) will allow you to query your last created block's OCert number for validation too.
PS: You can rotate multiple times to a higher counter (so for example, you can go rotate until counter is 10) just fine, as it will still be higher than your previous block's OCert counter.

Thank you. That number shows 2 which is what I would expect given that I rotated KES twice already. Would you mind clarify further because I cannot see how I can use this number for further debugging.

As per your original thread, it lookslike the counter expected is 6 , not 2. So there is block on chain where your pool's opcert counter was 5 already, and you need to rotate it 4 more times for your index to be higher.

I think you can also just open the counter file and manually increase it to something higher.

My pooled was elected a block leader yesterday. Unfortunately that changes that you proposed and I enacted did not work. Same error, though expected KES evolutions is now 8.

Please specify both your current counter, new counter in opcert and whether your new KES is generated from same cold key

We are seeing similar error. We only have rotated the cert once and that was after minting our first block.
@RdLrT this command shows just 1.
cardano-cli.sh "text-view decode-cbor --in-file node.cert"  | grep int | head -1
      01  # int(1)

But the error says
"opCertExpectedKESEvolutions",String "17"
Does this mean I have to rotate it 16 more times?
cardano-node    | [93f57906:cardano.node.ChainDB:Info:537] [2021-06-17 11:48:08.00 UTC] Valid candidate 1ef53e05e0c8ac9a35519dedc61e974036cb66fbf15a6ecc4c3420fa0db9f8ef at slot 32364102
cardano-node    | [93f57906:cardano.node.Forge:Error:547] [2021-06-17 11:48:08.01 UTC] fromList [("val",Object (fromList [("kind",String "TraceForgedInvalidBlock"),("reason",Object (fromList [("error",Object (fromList [("error",Object (fromList [("failures",Array [Object (fromList [("error",String "Reject"),("kind",String "InvalidKesSignatureOCERT"),("opCertExpectedKESEvolutions",String "17"),("opCertKESCurrentPeriod",String "249"),("opCertKESStartPeriod",String "232")])]),("kind",String "ChainTransitionError")])),("kind",String "HeaderProtocolError")])),("kind",String "ValidationError")])),("slot",Number 3.2364197e7)])),("credentials",String "Cardano")]
cardano-node    | [93f57906:cardano.node.LeadershipCheck:Info:547] [2021-06-17 11:48:09.00 UTC] {"kind":"TraceStartLeadershipCheck","chainDensity":4.991215e-2,"slot":32364198,"delegMapSize":644407,"utxoSize":2659418,"credentials":"Cardano"}

I followed that advice but there is no way to verify if it solves the problem before any blocks are actually minted. I should know the answer within next week or two.

This appears to be a new question, not really an answer to the original question.  Please consider whether you should make it a separate question, update or delete it.  Welcome aboard, I hope my feedback is helpful.

@gRebel the problem is exactly the same and didn't want to open a new thread on this to avoid missed context.

@user2107938 Based on the log message, yes (or you can verify in your dbsync instance too)

If it's not the counter issue mentioned above, I had a similar error in the past:

[cardano-:cardano.node.Forge:Error:195] [2021-03-15 23:36:47.00 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceForgedInvalidBlock"),("reason",Object (fromList [("kind",String "ValidationError"),("error",Object (fromList [("kind",String "HeaderProtocolError"),("error",Object (fromList [("kind",String "ChainTransitionError"),("failures",Array [Object (fromList [("kind",String "InvalidKesSignatureOCERT"),("error",String "Reject"),("opCertKESCurrentPeriod",String "165"),("opCertExpectedKESEvolutions",String "1"),("opCertKESStartPeriod",String "164")])])]))]))])),("slot",Number 2.1482191e7)]))]

I believe the cause was that I only copied the updated kes file to the producer, and not the new node.cert file. I re-copied both files over to the producer and restarted, and the blocks started working correctly.

Thank you. May I ask you. The steps that I followed only mention about copying node.cert to the prodcution environment.
https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#18-1-rotate-pools-kes-keys-updating-the-operational-cert-with-a-new-kes-period
What steps did you follow? Did you manage to find any officals Cardano docs for this?

@matcheek - The issue is already proven to be as per first reply based on log extract and your first reply about current ocert number. It would best for you to rotate your KES 4 more times (so that current is 6 or above) and verify next block assignment is created correctly.

@RdLrT Done. Do you know how to verify if KES is correct now before waiting for another minted block?

I've no idea why it only mentions one, I'm pretty certain you need to copy both! I followed the instructions on the official Cardano site (which has just been updated and is hard to find things now), and I just repeated the bit I assumed was required for KES rotation. I don't know of any way to verify things are correct before minting a block though (I hit this issue on testnet where I had a large delegation and was able to verify fairly quickly).


text:
Catalyst voting power not including staking rewards?
Why did my voting power not include all of my staking rewards during Fund3 or Fund4 voting?
My catalyst app shows less voting power than what my Daedalus wallet has in balance (and had in balance on the June 11th 2021 snapshot).
The difference it is roughly the staking rewards I accrued during the Shelley mainnet.

Looks like it does not at this time. If you use Yoroi and move the rewards over from the reward key to the main wallet that is one work around. The other would be to have a tx on Daedalus as that seems to consolidate from the staking key as well to the main wallet.
However, I'm not sure about future versions of catalyst which could change how this functions and perhaps not need to do the above.

To confirm (18 months later) - this is still the way the catalyst app works. I'm not sure why it does not take the "unspent" staking rewards into account, it would seem like a pretty sensible idea for it to include them. However, Daedalus users will need to make a transaction to claim the staking rewards into the main wallet.
You could, for example, send a couple of Ada to Coinbase, Binance, etc. You can always send them back if you want to. You'll notice the wallet balance in Daedalus will update and the "unspent rewards" will change to 0.

It's not clear how quickly the Catalyst app will refresh the wallet balance though - I assume it doesn't refresh on a regular basis but I have no doubt that the snapshot will be correct when it takes place.

The most simple way to move the staking rewards to your wallet in Daedalus would be to send some ADA to your own wallet. No need to send them to a third party.

@eddex you mean send from your wallet to the same wallet you're sending from? For some reason I assumed you couldn't send to the same wallet you're sending from but thinking about it I can't see why not

Exactly. You go to "receive", copy your address, go to "send", paste your address and send e.g. 1 ADA to your own address.


text:
How to verify if KES is valid without needing to wait for the next minted block?
With reference to my previous question regarding inconsistent reading of KES validity given by cardano-node and gLiveView, is there any way I could objectively verify KES validity without waiting for the next block?

Things you can verify:

Current opcert counter is higher than previous counter on chain in a block created by your pool (you can use dbsync or query a public instance) - you already saw in your previous thread that expected OCert for your node was 6). Starting Vasil fork, it is expected that - upon rotation, your opcert counter is higher by exactly 1
Expiry date of KES  (can query EKG or also just check gLiveView).
Make sure your cert was derived using kes from your cold key using which pool was created.

Once each of above is verified, it's simply a matter of waiting for your next block to get the proof/assurance. The above are pretty much the only checks you can perform.

What if you haven't done any blocks yet? Mine is currently up to 9, no blocks done, and the cert instantly expires.

@Cyberience - "instantly expires" => That suggests you're likely not using right start period for KES (assuming you're verifying it correctly using right files and post node restart)

Try the 2 commands below to see if they give you the info that you need.
1 - Cardano version 1.34.0 (and 1.34.1?) has a bug that does not show KES calculations correctly - this should be fixed in 1.35.0. Below is from 1.34.1 after I did a KES rotation earlier today.
$cardano-cli query kes-period-info --mainnet --op-cert-file op.cert

✓ The operational certificate counter agrees with the node protocol state counter
✓ Operational certificate's kes period is within the correct KES period interval
{
    "qKesNodeStateOperationalCertificateNumber": 14,
    "qKesCurrentKesPeriod": 505,
    "qKesOnDiskOperationalCertificateNumber": 15,
    "qKesRemainingSlotsInKesPeriod": 6783509,
    "qKesMaxKESEvolutions": 62,
    "qKesKesKeyExpiry": "2022-09-22T21:44:51Z",
    "qKesEndKesInterval": 558,
    "qKesStartKesInterval": 496,
    "qKesSlotsPerKesPeriod": 129600
}

2 - Try using the localhost HTTP metrics details via CLI - note your port number may vary:
$curl -s 127.0.0.1:12798/metrics | grep KES

cardano_node_metrics_operationalCertificateExpiryKESPeriod_int 567
cardano_node_metrics_currentKESPeriod_int 505
cardano_node_metrics_remainingKESPeriods_int 62
cardano_node_metrics_operationalCertificateStartKESPeriod_int 505


text:
Does Cardano Node support chained transactions?
Does Cardano node supports processing of chained transactions?
E.g. we have an output [O1], and want to create a transaction [TX1] using [O1] as an input and creating new output [O2] and then, until [TX1] is confirmed in the network create [TX2] using [O2] as an input and creating new output [O3].

Is Cardano node capable of handling this chain [TX1, TX2] properly? It has to lookup [O2] in mempool in order to verify TX2 is valid.
Is it possible at all that [TX1, TX2] get into one block? Does the current block validation protocol allows that at all?

No - as it would also opens a web of security issues, including deficiencies of accounting model - also, it enables a possibility to DDoS network for a small duration.
*Correction: Apparently you can do this already, it is just not easily made available to end-user facing tools yet.

What security issues are you talking about exactly? Bitcoin and Ergo have been successfully supporting this feature for quite a long time already - and no significant vulnerabilities were found in this approach so far. So what's special about Cardano here?
As fo DDoS, I guess the network can be DDoSed anyway and tx chaining doesn't make much difference here.

Oh, that's great. Can you elaborate on how can I do that? It's ok to use any Haskell SDK for me.


text:
Is there documentation on the Prerequisites for Plutus Pioneer code?
I'm trying to run the Plutus Pioneer code on a Docker container based on https://hub.docker.com/r/nixos/nix.
I've followed this guide to install Cabal and GHC https://www.reddit.com/r/haskell/comments/dg4dvs/install_ghc_in_25mins_or_ghcjs_in_one_sleep_with/
I haven't been able to get GHCJS installed, though I'm not sure if it is necessary.
Is there any guide on pre-requisites for the Plutus Pioneer Program, ideally with install instructions?

It might be easier to start with the plutus-starter container, although I can't get it to work right now - I'm not sure if it's broken or that's just me (https://github.com/input-output-hk/plutus/issues/3405)

There are instructions on the official input-output-hk/plutus-pioneer-program repo in the exercises chapter here: https://github.com/input-output-hk/plutus-pioneer-program#exercises
I think you may be missing the following step:

Set-up IOHK binary caches How to set up the IOHK binary caches. "If you do not do this, you will end up building GHC, which takes several hours. If you find yourself building GHC, STOP and fix the cache."

As far as I can tell, GHCJS is not necessary, but I haven't tested this.

I do have the binary caches set up. The instructions in the input-output-hk/plutus-pioneer-program repo assume quite a lot is set up already. This includes but may not be limited to : nix, ghc, cabal and npm. I have installed all these and the Plutus Client is still not working for me. I was hoping for a one page "How to set up an environment from scratch". A ready made docker container would be even better.

I am running the Plutus Pioneer code in a nixos/nix based Docker container and it works a treat. I use the nix-shell as recommended in the pioneer program repo and I only needed to set up the IOHK binary caches and install git (using nix) as a prerequisite. I added curl and tmux to make it more user friendly. I use tmux to set up a three pane session containing the Plutus server, the playground GUI and one for interactive cabal. Below is the contents of the Dockerfile I use to buid the image.
FROM nixos/nix

RUN echo "substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/" >> /etc/nix/nix.conf && \
    echo "trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" >> /etc/nix/nix.conf && \
    nix-env --install git && \
    nix-env --install curl && \
    nix-env --install tmux

It is important to map the /nix folder to a data volume for better performance and to keep the size of the running container down. This folder can easily contain a few tens of Gb of data.
I keep the Plutus and Pioneer code repos on the host and map a data volume to bring it into the container:
docker run -it -p 8009:8009 -v hkvb_nixos_plutus:/nix -v $(pwd):/plutus hkvb/nixos.plutus:original sh

This command only exposes the port of the Playground UI. The hkvb/nixos.plutus image was built using the Dockerfile above and is available on Docker Hub.
There is one minor change required in the Plutus code to make the playground accessible from outside the container. This is in the webpack.config.js file of the plutus-playground-client. THe DevServer is only bound to the localhost network interface (of the container). Adding the line
host: "0.0.0.0",

makes the server available external to the container.
[UPDATE 08/08/2021]
I have found out that it is best to start from a freshly cloned (or new copy) of the Plutus repository when changing commits for build. Changing commit on a Plutus repository that was already used for a build often resulted in problems for me, often leading to never ending builds, especially when building the documentation.

I'm trying to get this work on my MacOS host, but when I run the Dockerfile, the resulting container has no nix commands available on it.
I must be missing something, and will have to do some more research about this, but shouldn't the docker image at nixos/nix have nix already set up on it?

I found the issue with this for me: when I build the image, the nix folder is there in the image, but when I run it, mounting the /nix folder as a volume overrides the nix folder from the image, so it has nothing in it.
I've now made a new Ubuntu based Dockerfile that sets up Nix, which is very similar to how the Nixos/Nix Dockerfile sets it up on Alpine, but I skip mounting the nix folder to a host volume.


text:
Daedalus on Ubuntu 20.04 cannot contact the network
I am unable to connect to the Daedalus mainnet for over four days now.  The time sync is correct, so that is not the issue.  Running Ubuntu 20.04, and have not had this problem for a very long time. I have tried countless times.

What have you done so far to try and work out the issue?  Do you have any errors or warnings in the logs?

No, but see my comment below.  I solved it, but not sure what actually solved it!  Thanks

Try reinstalling Ubuntu or Linux Mint then install again. It could be multiple things going on so reinstalling the OS for weird stuff can work. I use Linux mint without issues.

Hi, I rebooted my modem, rebooted my machine and it finally worked, but it took a long time to connect to the network.  So really I have no idea what it was, but it is working now.  cheers and thanks

I'm sure there are many reasons why this might happen, but my last experience of this on Ubuntu (Pop OS) was when I was connected to a VPN. Disconnecting immediately solved the problem, so it's possible if you use a company VPN that the network traffic is being blocked for the wallet.

Thanks, I don't use a VPN, other than in browser.  I don't think I am going toknow what it was, but IOHK checked my logs and said there was an issue, I think maybe at their end, but seems ot be solved now.  cheers

Have you tied restarting the Cardano node within Daedalus? I have have flight running on Ubuntu with no issues. Once you reset the node walk away for a bit and come back and see if you've connected.

I think I did something like that.  Whatever I did it worked, and there was an issue, which the logs showed, but I am not sure what it was.  Works now though.  cheers


text:
How can you check if a local node is running properly?
I am running a Cardano node using docker, on the testnet, and now I need to check if it works properly and accepts cardano-cli arguments like querying and what not.
Is there a convenient way to do it?

What happens when you enter cardano-cli into the terminal of the docker container running the Cardano node?

Resolving it, as I reached success with connecting to the docker container and running the queries from there, and everything works fine.

The correct way to do that was to docker exec into the container, and cardano-cli works just fine from there.

To run cardano-cli in the container:
docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli
So to check the tip:
docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli query tip --mainnet
I put cardano-cli as an alias:
alias cardano-cli='docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli'. That way you can just invoke the cli as if the cardano-cli was in your PATH.


text:
Blockfrost assets api issues
We are developing an app that must get the asset id and get its details from metadata, right now we are using blockfrost.io. It works very good for policy Id's, we can use the pool.pm website and get the information regarding all the assets the policy has.
Unfortunately, it doesn't work very well for the asset id... The blockfrost only accepts the concatenation of policy id and the hex encoded asset name. I can't determine the hex encoded asset name. If any of you know how to do that let me know.
Thanks in advance.
this is the endpoint:
https://cardano-mainnet.blockfrost.io/api/v0/assets/{asset}
some valid id's I found using postman:
0e14267a8020229adc0184dd25fa3174c3f7d6caadcb4425c70e7c04756e7369673236383531

Meta comment. Why would you use a centralized, single point of failure component in a service whose main goal is to create decentralized ecosystem? So, instead of calling blockchain wrapped with web api you should be querying the blockchain yourself. Web api for blockchain does not make much sense.

@matcheek makes a lot of sense, I don't have the resources to build an API like this for my project, I can focus on whatever my project needs and use their api. this is industry standard development. The JSON web api is used in several types of frameworks and libraries, do I need to create everything from scratch just for purism and never delivers my app? That doesnt make sense, if the point of failure happens we can fix the app but never develop anything with premature optimizations its amateurism approach.

Let's take this asset as an example: https://pool.pm/0e14267a8020229adc0184dd25fa3174c3f7d6caadcb4425c70e7c04.unsig26071

Policy ID: 0e14267a8020229adc0184dd25fa3174c3f7d6caadcb4425c70e7c04
Asset name: unsig26071

To request this asset from the blockfrost.io API, you have to convert the name to HEX and then concatenate them (without a . in between).
How you do this depends on the programming language you use. You need to find a way to convert a string to its HEX representation.
Here's an example in C#:
using System;
using System.Text;

string assetName = "unsig26071";
byte[] bytes = Encoding.UTF8.GetBytes(assetName);
string hexAssetName = Convert.ToHexString(bytes); // 756e7369673236303731

To verify that you convert the names correctly, you can use a page like this one: http://string-functions.com/string-hex.aspx
Here's the converted example on cardanoscan:
https://cardanoscan.io/token/0e14267a8020229adc0184dd25fa3174c3f7d6caadcb4425c70e7c04.756e7369673236303731
Your blockfrost.io request would look like this:
https://cardano-mainnet.blockfrost.io/api/v0/assets/0e14267a8020229adc0184dd25fa3174c3f7d6caadcb4425c70e7c04756e7369673236303731

thanks this is the accepted


text:
Nix shell fails to start for Plutus
maciej@ola:~/workdir/plutus/plutus$ nix-env --version
nix-env (Nix) 2.3.12

Running the nix-shell command for the default.nix in Plutus and getting a genuine http 404 error that stops the whole nix shell from starting.
trying https://bintray.com/joneshf/generic/download_file?file_path=purty-6.2.0-linux.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
error: cannot download download_file?file_path=purty-6.2.0-linux.tar.gz from any mirror
builder for '/nix/store/g0drypafpyzckkpwzplp9k9amx4bf7a4-download_file?file_path=purty-6.2.0-linux.tar.gz.drv' failed with exit code 1
building '/nix/store/a7wvz8wy4iqy5ynbx49lf23a4w7dxixg-drv.r29349.tar.xz.drv'...
cannot build derivation '/nix/store/wdgbj9xf3rz44xz5afw20m1ns0n8llpg-purty-6.2.0.drv': 1 dependencies couldn't be built

Git log
git log
commit e11d59a181f558fb5d2e5b0a2a32afd496660bc1 (HEAD -> master, origin/master, origin/HEAD)
    Author: Jann Müller <j-mueller@users.noreply.github.com>
    Date:   Tue Jun 22 08:28:10 2021 +0200

Am I using a wrong Plutus branch? If so which branch / tag should I use to start the Plutus Playground.

I got stuck here, any ideas? I've done all steps needed, so not sure what the problem is.

I was just able to pull down the latest Plutus code and start a nix shell so I don't think it is the branch.
What does your binary cache configuration look like?
https://github.com/input-output-hk/plutus#how-to-set-up-the-iohk-binary-caches

Neither the /etc/nix/nix.conf nor the /.config/nix/nix.conf exists, so I take I don't have caches set up.

I had to manually create these files on my machine

Thanks. The way I read it is this, could it be that you only managed to succeed to run nix-shell because you had binary caches specified, i.e., you downloaded the binaries without actually building plutus that is? Or did you succeed with running nix-shell without binary caches?

Actually, I don't need to build it if I can just use the binaries. Thanks.


text:
Identifying node locations by region
I want to operate stake pool nodes in underserved areas. My cloud provider automatically chooses the cheapest datacenter nearest to me. But I am willing to pay more to deploy to data centers in underdeveloped countries.
How can I identify which regions are saturated and which regions have little or no nearby connectivity?
The IOHK Shelley node map, is the best I have found, but it looks hard to interpret. I came away thinking half the nodes are in the ocean.
Yes, it was...

Mobile is bunked. But if there’s something in particular besides boilerplate Good Question stuff I’m not sure what you mean. I want to operate a staking pool where there are few to none, how can I spin up some nodes with in underserved areas?

Are you talking about staking in under-served locations?  It would also be a good idea to take a look at [ask] for guidance on improving your question.

I mean there are no links to the docs on mobile.

Yeah I definitely did a couple of searches. I think participating in the network health is on topic. Thank you for the link

what was wrong with my question? it has 86% upvote  standing on r/cardano.

This is not r/Cardano and has a clear mission to provide mostly fact based, enduring, clear and concise answers to Cardano questions.  Take a look at [so] and [se] for the direction this site needs to head in the long run.

Seems like a waste of time. Just fix it for me. I really don't know what you want.

Thank you, gRebel. Let's reset. :)

Reddit variety understood the pasta.
PoolGermany says:

There are some maps:
https://www.adatainment.com/index.php?page=pool_map
https://poolpeek.com/poolpeek.com/poolsearchmap
https://monadpool.com/cardano.html
Enjoy! :)

https://adatools.io/hologram only slightly helpful. But adatainment allows one to drill down on to staking pools to see where they are on a political map.
I don't think any of these are exhaustive.


text:
Fetching all Tokens that belong to a Minting Policy
Is there a way to programmatically get all the TokenNames belonging to a CurrencySymbol with Plutus?

Do you mean all the TokenNames ever minted by a policy, or within a specified scope?

@MitchellTurner I mean all TokenNames ever minted by a policy. But I've come to realize that it may only be possible using an Oracle. I may be wrong tho.

Yes. Using ghci in Plutus repo I'll show you how. I will use fully qualified functions for clarity, and don't forget to :set -XOverloadedStrings.
Plutus observes all tokens in an output using txOutValue of TxOut. To define our own Value we can do (taken from PPP Lecture#5):
> let v = Plutus.V1.Ledger.Value.singleton "a8ff" "ABC" 7 <> Plutus.V1.Ledger.Ada.lovelaceValueOf 42 <> Plutus.V1.Ledger.Value.singleton "a8ff" "XYZ" 100
> v
Value (Map [(,Map [("",42)]),(a8ff,Map [("ABC",7),("XYZ",100)])])

To filter by CurrencySymbol we can do:
> PlutusTx.AssocMap.keys $ Data.Maybe.fromJust $ PlutusTx.AssocMap.lookup "a8ff" (Plutus.V1.Ledger.Value.getValue v)
["ABC","XYZ"]

This gives you TokenNames for CurrencySymbol a8ff. Ada's CurrencySymbol of "" has been filtered out.

You cannot have multiple TokenNames belonging to the same CurrencySymbol. Together, TokenName & CurrencySymbol can form an asset class. Once this asset class is formed, it can be wrapped in a Value list.
The reason that TokenName & CurrencySymbol must be 1-1 is that the CurrencySymbol is the hash of the monitary policy script used to validate the Token.
If you had multiple tokens with different TokenNames using the same CurrencySymbol, they would all use the same monitary policy, and that would create some issues with validation.

@Aoaddeola, you can edit and delete your own comments ;-)

Thanks @gRebel :)

According to lecture #5 of the PPP, Lars demonstrated on the command line how to combine tokens using the Value.singleton function... singleton "a8ff" "ABC" 7 <> lovelaceValueOf 42 <> singleton "a8ff" "XYZ" 100 thereby producing: Value (Map [(,Map [("",42)]),(a8ff,Map [("ABC",7),("XYZ",100)])])... Hence, I fail to see how multiple TokenNames can't map to a single CurrencySymbol/Monetary Policy.

Mmmm I see the confusion. Value is simply a container for a token or multiple tokens of different types(as shown above). It is different from the CurrencySymbol. In the above example, each one of these singleton tokens have their own TokenName and  CurrencySymbol. They are then grouped using the <> operator into a Value.

Yes, you are correct in your explanation. But the fact remains that both TokenNames "XYZ" and "ABC" belong to the same CurrencySymbol "a8ff"

The same name is used by Lars because he was being slightly lazy here. When the singleton function is used on the blockchain, there will be a check to ensure that the Currency Symbol does not already exist. In the example above its okay to have the same CurrencySymbol because these functions are not being executed on the blockchain.

I'd like you to demonstrate what you mean by "there will be a check to ensure that the Currency Symbol does not already exist". You can find me on discord with same user account (aoaddeola) :)

This is an incorrect answer: there is not a 1-1 relationship between CurrencySymbol and TokenName, in fact on the contrary one can have an arbitrary number of tokens ( TokenName ) operating within the same CurrencySymbol (policy).

You sure? I need some more info! I want to know the answer for sure

Alright I'm a fool. The snippet of code provided by Aoddeola pretty much sums it up.


text:
Blockfrost API and IPFS issues
Right now I have some NFTs to pin on the blockfrost IPFS. That way I don't need to run the node 24h a day. But for some reason the API returns an error when I try to add new assets.
I'm using a free account and have used 0/100mb so far. I used that before and it worked but now it doesn't anymore.
This is the endpoint I'm using:
curl "https://ipfs.blockfrost.io/api/v0/ipfs/add" \
  -X POST \
  -H "project_id: $PROJECT_ID" \
  -F "file=@./README.md"

The file I want to upload is a zip with a few KB, so not a big thing.
The error is an invalid project key, support says I need an IPFS key but I don't know how to obtain that.

Can you please share the error?

@MarekMahut-StakeNuts hi, this is basically a forbidden 403 error. I dont know why because I'm using my correct api. support says I must use a ipfs key but I dont know how to generate those...

Well, this is strange but blockfrost doesnt have the same api key for cardano mainnet and the ipfs.
You must create another project in order to use their api.
that's it.

Yes, that's correct - each network is a different API endpoint. Cardano maininet, Cardano testnet, IPFS, Cardano Alonzo...


text:
Deriving Show Compilation Error on Plutus Playground
I seem to be getting a compilation error when I try to compile any of the example files on my local host configuration for the Plutus Playground. The error is pictured here:
And basically it seems that no matter which example file I try and run I always end up getting a deriving show error. I am using an oracle VM and have installed the binaries for nix and have been running everything out of nix-shell.
Here is a better version of the error I've been receiving, this time on Week03's IsData.hs file, and I get the error at the 'Deriving Show' for MySillyRedeemer:
Then when I add the 'Show' to the Playground.Contract the error morphs into this:

So at this point I am really not sure what to do, all of these errors I encounter on my localhost server. I've reinstalled the plutus git and nix as well and I can't seem to figure out why I have these errors. And the errors do all seem to be 'not in scope' related so maybe its a a case of me not having certain files downloaded?
EDIT: Here is a copy of both the 'deriving show' error code:
error:
    Not in scope: type constructor or class ‘Show’
    Perhaps you want to add ‘Show’ to one of these import lists:
      ‘Prelude’ (/run/user/1000/web-ghc-work-f4d3c6b7d9d2297b/Main.hs:32:1-54)
      ‘Playground.Contract’ (/run/user/1000/web-ghc-work-f4d3c6b7d9d2297b/Main.hs:29:1-103)
   |
38 |     } deriving Show
   |                ^^^^

As well as one of the error code I get when I add 'Show' to the import list via Playground.Contract:
error:
    Not in scope: type constructor or class ‘Scripts.ScriptType’
    Module ‘Ledger.Typed.Scripts’ does not export ‘ScriptType’.
   |
59 | instance Scripts.ScriptType Vesting where
   |          ^^^^^^^^^^^^^^^^^^

+1 and welcome to the site, but it's typically better to copy and paste code and error messages into code blocks: This would help for blind people that are using screen readers, it would help with seachability, readability, reproducability, speed of loading on phones and on browsers with image blockers, etc.

Thank you @NikeDattani I've gone back and added code blocks to make it more understandable. Luckily I found the reddit post where somebody is hosting a public plutus playground that I can work on, found here (https://www.reddit.com/r/CardanoDevelopers/comments/mno89m/plutus_community_playground/). Its not ideal but it is a partial solution to my problem.

I believe your issue is stemming from the fact that the plutus team is updating the plutus library relatively quickly, and since the code written in the plutus-pioneer-program is now a month or two old, it is outdated and will only compile on the older version of the plutus playground.
I suggest you keep using the publicly hosted playground and then eventually move over to cabal and the terminal.

Yep, thats the plan for me going forward, it does the job but if I manage to find some workaround to it I'll post my solution, thanks!

You can run the Playground locally in Week 3 if you checkout the Plutus branch referenced in the Week03 cabal.project. See the tag option below.
source-repository-package
  type: git
  location: https://github.com/input-output-hk/plutus.git
  subdir:
    freer-extras
    playground-common
    plutus-core
    plutus-contract
    plutus-ledger
    plutus-ledger-api
    plutus-tx
    plutus-tx-plugin
    prettyprinter-configurable
    quickcheck-dynamic
  tag: 3aa86304e9bfc425667051a8a94db73fcdc38878

These are exactly the same errors that I get when I try to compile the Week 3 code with the latest Plutus master, so there is nothing wrong with your setup.
I was migrating the code to work with the master branch, but there have been a lot of Plutus changes since the Week 3 code was written which involved a lot of head scratching trying to figure out what was what.
As other posters have mentioned, checking out the correct commit should fix this for you.


text:
Did I just convert my ada to a wrapped/pegged token?
I purchased ada on binance us and for some dumb reason, I used the BEP2 network vs the Cardano network to send my ada on binance us to Daedalus/ledger. It all shows up in Daedalus as ADA but after reading some threads did I just convert this to a wrapped token vs a native token? I'm still pretty new to this and may be misunderstanding this, but I want to ensure the ada I have in my Daedalus wallet is the native token and not wrapped or pegged, and if it is what do I need to do to get back the native token? Thank you in advance.

As long as you use the Daedalus mainnet client and see your balance, you are using ADA.
To be absolutely sure you can copy your public address and look it up on the cardano explorer: https://explorer.cardano.org/en/address?address=YOUR_ADDRESS
Example:
https://explorer.cardano.org/en/address?address=addr1qy273uqgsnv2v9hrllgp32g4gkxke85d8nsk4nup6t354kyluklkqpppvma530cs4se0gd46m5njrwtqraknat2ef9rq4v2my2
There you'll be able to see your ADA balance

Dude! Thank you so much, I've spent hours looking for this answer and after utilizing this tool I was able to verify that I did actually use the cardano network and all is good, thank you so much, this was super helpful, now I can go to bed:)

@ChristopherJManganello glad eddex was able to help you. Make sure to upvote and accept the answer, so others can see that this issue has been solved for you.

Got it, thank you all so much, this is a wonderful community so far:)


text:
Are there any Java APIs allowing to make applications on top of Cardano?
cf. title of the question, is there a Java API to make Cardano developers ?

Welcome to our community! I recommend you add more detail to your question, simply because it's very unusual for the question body to just be a repeat of the question title. Perhaps you could say a bit about your overall goals with such an API or the motivation for why want this, or if you prefer open-source vs proprietary, etc.

Yes, try cardano-client-lib SDK written in Java.


text:
Append metadata to transaction from Plutus code
Is there a way to append metadata to transactions that are send from plutus code?
Right now we send transactions from the contracts like follows (or something alike):
ledgerTx <- submitTxConstraintsWith @Cube constraints tx
void $ awaitTxConfirmed $ txId ledgerTx

I know Alonzo is still in development/testing phase, but I was wondering if there is already something in the API do this or there will be (I cant find anything in the code base as of right now).

AngelCastillo -  just wondering if you ever got anywhere with this? I'm currently looking into the same requirement.

Not yet, haven't found any info regarding this. I hope by the time we can access the test net to test our dapps, there is some information.

Any Updates on how to achieve this ?

Should one of the answers be marked as accepted?

None of the answers provided so far are correct

I'm not sure in what context you need to append metadata to a transaction, but you may want to check this documentation for any of these helper functions used for creating TxContraints:

mustIncludeDatum :: forall i o. Datum -> TxConstraints i o
mustPayToOtherScript :: forall i o. ValidatorHash -> Datum -> Value -> TxConstraints i o
mustPayToTheScript :: forall i o. IsData o => o -> Value -> TxConstraints i o

The first two require a Datum while the last one could be any arbitrary data type converted to a Data using PlutusTx.unstableMakeIsData or its equivalents.
EDIT:
You might want to look into StateMachines. Especially the transition function (which also requires TxConstraints). You may start with this documentation,

Aoaddeola, I am no referring to the data embedded in the UTXO as Datum, I am referring to this: https://iohk.io/en/blog/posts/2020/11/03/getting-to-grips-with-metadata-on-cardano/

No, it is not possible right now.
To change that, we would need a hard fork introducing this functionality.

Why would this require a hard fork?. This is off-chain code, is just a matter of serializing the metadata and appending it to the transaction. Or am I missing something?


text:
ERC20 / ERC721 vs Plutus smart contracts
I thought about curating some literature on ETH and Cardano interoperability and was wondering about ERC20/ERC721 and plutus smart contracts. If I understand it right, ERC20/ERC721 are contract standards that users copy-paste into their code that can later be user-defined. In contrast, Plutus has a native token that can only manipulated via minting policy script.
Is there such a wrapper to convert the ERC20/721 standards into a plutus minting policy script? Or does this not make sense? If not, why?

We already have similar contracts, which are re-used by other more complex contracts (like Uniswap).
Take a look at mintContract which is part of plutus-use-cases package.
Since smart contracts are using Haskell, we also get full namespaces, modules and package support handled for us by Haskell so re-using such contract means adding a correct package to your projects dependencies and importing it.
Note: during Plutus Pioneers course the function was called forgeContract.
I think there's also a ERC20 converter in the pipeline.

Indeed forgeContract has now been changed to mintContract since commit #3403.


text:
Cardando project idea
I'm currently very interested in getting deeper in web3 and blockchain development. I will have this masters dissertation to which I'd like to propose a project that allowed me to develop some sort of infrastructure or dapp for the Cardano ecosystem.
I have particular interest in infrastructures such as bridges and was thinking about proposing a prototype for a bridge between Cardano and another blockchain such as Cosmos or Polkadot. I know this may be a daunting development process, and definitely not a "one man job". However, do you think this could be a somewhat interesting project to approach from a proof of concept perspective? As a means to engage in this development field, as well as eventually adding value to the ecosystem?
Let me know your thoughts on this, and any suggestions or feedback will be more than welcome!
Thanks!

So in summary, you are wondering whether or not it would be worth it to do a project where the goal is to build a bridge between Cardano and Cosmos or Polkadot?

@NikeDattani, yeah that's exacly it :) I am also open to other suggestions for projects, basically all feedback is welcome

Welcome to the community. While this stack exchange may not be a good fit for questions that open themselves up for rather subjective answers, I figured this topic (would people find this project interesting) may come up often enough to warrant a compilation of resources to better answer and pursue such undertaking.
Project Catalyst (introduced in 2020) is a fund for community innovation. You could gauge the interest on various Cardano community channels (official Telegram, several discord servers, the weekly Project Catalyst town hall, reddit etc) or post a proposal right away on ideascale during the proposal stage of a Project Catalyst fund. The community-run site https://cardanocataly.st/ has further information and links to additional resources.

Thanks for the feedback, I’ve considered some of those options, but found this to be the most straightfoward channel to start with. Nonetheless I’ll give them a try :)


text:
cardano-cli: QueryEncoderUnsupportedQuery Query GetSystemStart TopLevelQueryDisabled
cardano-cli --version
cardano-cli 1.27.0 - linux-x86_64 - ghc-8.10
git rev d870347b48c8ba0a81566876153eff23fce3ec64

cardano-cli query tip --mainnet
cardano-cli: QueryEncoderUnsupportedQuery Query GetSystemStart TopLevelQueryDisabled

I'm trying to get the current tip(slot) for my my transaction ttl.
eidt:
cardano-cli query tip --shelley-mode --mainnet
Command failed: query tip  Error: Unsupported mode: ShelleyMode

after i added --shelley-mode flag, it still doesn't work.

Can you try running the query with --shelley-mode flag?

You're not using the release version, which - for 1.27.0 (current mainnet) - is 8fe46140a52810b6ca456be01d652ca08fe730bf.
Using commits later than current stable release should only be done if you're sure if a specific commit is compatible and works - and should be done on testnet instead


text:
Is there an API or website where I can see all addresses that hold a specific native token/asset?
I want to get all addresses that hold a specific native asset/token. I'm not talking about NFTs but tokens that have a quantity of more than one. Examples would be the spacecoins or the hosks.
I want to do this using an API or a website (without running my own full node). Options would be blockfrost.io or other websites like pool.pm, cardanoscan.io, explorer.cardano.org or similar services.
Are there tools that can do this already out there somewhere?

You are probably looking for the Blockfrost.io's /assets/{asset}/addresses endpoint that lists all addresses containing a specific asset.

This is exactly what I was looking for. If there are other services that provide the same functionality, I'd still be interested to know about them.

There is a website called cardanoassets.com where one can see the mint history and transactions that include a specific asset. This doesn't answer the question but is related so I'm leaving it here too.
Example: https://cardanoassets.com/spacecoins-250


text:
Question about Daedalus deposit withdrawal
I'm willing to reorganize my wallets but as I read over here; https://cardano.stackexchange.com/a/555/1927 this feature was "removed" (?!) from the Daedalus wallet and I know that there's an open "feature-request" topic over here; https://github.com/input-output-hk/daedalus/pull/2351
But I was wondering if anyone had any knowledge on the subject, like when it's planned to be added or why was it removed in the first place etc?

Please re-formulate this question so that the viewer doesn't have to navigate to several other links to understand what question you're asking. It will make it more useful to people searching later.

Does this answer your question? Questions about Daedalus deposit withdrawal and delegation privacy?

@intrinsic-values please don't mark things as a duplicate of a closed question!

I will vote to close it as it is better addressed by request for clarification and/or detail in the question that is referenced in the body of the question.  @user3152883, I think you will have more success with your efforts here if you follow the guidance at [ask]


text:
About Daedalus (also ADA in general) delegation privacy
I'm feeling really uncomfortable about delegation privacy. No matter how many wallets/addresses I use to separate my funds people can use https://cardanoscan.io to see which addresses are delegated into which pools.
Even though it's not solid proof for who's the owner of those addresses, exchanges and pool owners can backtrack my delegation addresses and see into which other pools have been delegated relating to that account.
I feel very disturbed about this. I know there are some ways to separate staking address from receiving address and using only the receiving address hash output for transactions, using terminals and programming but I'm not a coder and was wondering if there are any future plans to implement such privacy features in a user friendly fashion into Daedalus?

I understand your issue, for privacy try using https://adalite.io/. They let you generate multiple Cardano Accounts that have their own stake keys. You can use this with hardwallets.
Now you can stake separately from the address you want to use for commerce.
I think this issue would be something that is down the road in the development.

Thank you so much for your response and showing an alternative wallet. I really appreciate it. But I rather stick to the official wallet and wait for an official update for it. Glad hear you think the issue would be addressed down the line, I just hope it's not way down.


text:
Invoking lock endpoint on the plutus-starter guessing game is giving me "endpoint not available" error
Using the nix-shell approach, I'm able to build and execute the plutus starter PAB project, which includes the guessing game contract. GIT repo link
In a separate terminal window, I can run the GET request to see the contract definition.  The response shows the GameContract along with the schema, which has lock and guess endpoints.
I successfully call the activate endpoint for each of wallet1 and wallet2.
However, when I call the lock endpoint for wallet1 ID, it gives me the following error. If I look at the logs in the terminal, where the PAB is running, there is no evidence that an endpoint execution failed.
curl -H "Content-Type: application/json" \
>   --request POST \
>   --data '{"amount":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},90]]]]},"secretWord":"eagle"}' \
>   http://localhost:8080/api/new/contract/instance/2acb116b-5488-4672-99c2-f2940cfd7b3a/endpoint/lock

EndpointCallError (EndpointNotAvailable (ContractInstanceId {unContractInstanceId = 2acb116b-5488-4672-99c2-f2940cfd7b3a}) (EndpointDescription {getEndpointDescription = "lock"}))

The format of the API call appears correct.  Based on PAB docs, it should be
POST /api/new/contract/instance/:contract-instance-id/endpoint/:endpoint-name

Has anyone had this issue?  What am I missing?

I can reproduce this - it was happening prior recent Plutus bump pull request as well. I'm not sure what the root cause is yet - week10 example from plutus-pioneers works.
Tests in plutus-starter pass as well but they don't call HTTP API at all. Check that pab executable logs Exposing endpoint <name> message as well (it does for me but I'm not able to call lock).


text:
How does DApp front-end integrate with user wallets?
I'm familiar with using the Plutus Playground and Plutus TraceEmulator library to configure the wallet actions for the endpoints of a smart contract.  These simulators are great for testing the smart contract interactions.
I'd like to understand how a real-world DApp would integrate with user wallets. If the DApp front-end is a web-app running in the browser, would the app require users to set up something like a MetaMask plugin to link their wallets and give permission to the DApp to submit operations from their wallet?  Is there another way to let user grant access to a wallet node?  In general, how does the DApp front-end get access to user wallets and will the DApp front-end need to be deployed on the same machine as the wallet is running?

If you've found an answer to this, please post it. I'll be looking into it too soon.

@marcel_g, no, not yet.  I'd like to build a simple example of using a wallet connector, but have some server-side exploration work planned next. Pls let me know, what wallet connectors you try and how it goes.

Good question, this is one that many people are curious about as the only real way to interact with the Cardano blockchain is through cardano-node, but obviously a dApp user visiting a website isn't going to run their own node to submit transactions and interact with smart contracts themselves.
In my view, Yoroi looks best positioned at the moment to become the MetaMask of Cardano but as always, look into things for yourself and determine the best solution for your particular use-case.
https://www.emurgo.io/blog/emurgo-launches-beta-version-of-yoroi-wallet-dapp-connector
As you can see dApp Browser integration is slated for sometime 2021, I think this is the direction you should look. Also worthy of looking into is the ATALA Prism which also seeks to provide DIDs (Digital Identities) on the cardano blockchain and I'm assuming will at some point try and provide some dApp connector solution for the browser.

I guess after 1 year, this deserves a more up-to date answer. There are two ways you can integrate with a browser wallet, you can take a server-based approach and a client-based one.
Server Constructed Transaction
The First way is to have a back-end that will create the transaction and send the CBOR result to the front-end so the wallet can sign it and send it back to be submitted.
This is what you would do with the PAB, for example, and it's what DJED is using in their testnet. The problem is that if a lot of users are requesting a transaction at the same time, it will overload your back-end.
Other than the PAB you can use basically any tool that supports creating a cardano transaction. For me, pycardano has been really useful since I am more familiar with Python than Haskell and the PAB is just not very well documented right now in my opinion. You can see an example here.
Client Constructed Transaction
The second way would be to do everything in the client-side. So you would build the transaction, sign and submit from the user browser. The drawback here is that the front-end application get's a little bit more heavy and there is not a great support for plutus and smart contracts with the current tools.
The most used tool right now is the cardano-serialization-lib and you can see an example of a transaction being fully built on the client side here.
As I said, it doesn't offer great support for plutus right now (if any) and you would need to use a custom module for doing most of the things (like in the example I mentioned). There are some other tools, though, that could be more useful depending on the case: cardano-multiplatform-lib from dcspark and lucid from alessandro are the ones that come to my mind.


text:
What are the differences between the Shelley and Byron phases of Cardano?
Is there anything of significance beyond Shelley is required for staking?

I think that the upcoming Vasil fork will bring us into the Basho era that introduce scalability to the current Goguen.

With the Shelley upgrade, Cardano became a fully decentralized and dynamic ecosystem. In the Byron era there were no stake pools (and therefore no staking) and the blockchain was run by the creators alone.

I believe number of slots reserved in a single epoch is also increased in Shelley. In DBSync, syncing Shelley takes way too much time to sync compare to Byron era.

Yes, correct. Neverthless I think that the scope of the question was less technical al more tehorical.


text:
What does @ prefix means?
like this:
auctionInstance = Scripts.validator @Auctioning

and Hello-world app from https://playground.plutus.iohkdev.io/tutorial/tutorials/plutus-playground.html#running-the-hello-world-app
hello = logInfo @String "Hello, world"

It means type application.
In this case, the function is polymorphic with the following type:
logInfo :: forall a effs. Member (LogMsg a) effs => a -> Eff effs ()

by using TypeApplications extension, you can use @SomeType hint for the compiler, so the logInfo call is not ambiguous.
logInfo @String "Hello world" means apply type String to functions type variable a (the order depends on the order of type variables in explicit forall section - forall a effs - sometimes you may want to add multiple hints e.g. convert @String @Text someArg otherArg).
Ambiguity here stems from multiple string types in Haskell so you need to tell the compiler which type you are using (String, Text orByteString).


text:
OutputTooSmallUTxO error, trying to send more than 9 tokens
I have a generated wallet, so I need to use these commands to transfer my minted NFT's out.
I'm not stuck with this very odd and annoying stuff, saying OutputTooSmallUTxO...
I really don't know what to do about it, I'm copying here the commands I'm trying omitting the names and policy ids for privacy and easy for you guys to helping me out...
cardano-cli transaction build-raw \
--mary-era \
--fee 0 \
--tx-in $tx_id#0 \
--tx-out $sender+6506622+"1 token1 + 1 token2 + 1 token3 + 1 token4 + 1 token5 + 1 token6 + 1 token7 + 16 token8 + 101 token9" \
--tx-out $recipient+0+"1 token1 + 1 token2 + 1 token3 + 1 token4 + 1 token5 + 1 token6 + 1 token7 + 16 token8 + 101 token9" \
--out-file tx.raw

fee=$(cardano-cli transaction calculate-min-fee \
  --tx-body-file tx.raw \
  --tx-in-count 1 \
  --tx-out-count 2 \
  --witness-count 1 \
  --mainnet \
  --protocol-params-file protocol.json | awk '{ print $1 }')
afterfee=$(($total_balance-$fee-2000000))

cardano-cli transaction build-raw \
--mary-era \
--fee $fee \
--tx-in $tx_id#0 \
--tx-out $sender+$afterfee+"1 token1 + 1 token2 + 1 token3 + 1 token4 + 1 token5 + 1 token6 + 1 token7 + 16 token8 + 101 token9" \
--tx-out $recipient+2000000+"1 token1 + 1 token2 + 1 token3 + 1 token4 + 1 token5 + 1 token6 + 1 token7 + 16 token8 + 101 token9" \
--out-file rec_matx.raw

Error:
    Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (**OutputTooSmallUTxO** [(Addr Mainnet (KeyHashObj (KeyHash "...")) (StakeRefBase (KeyHashObj (KeyHash "..."))),Value 2000000 (fromList [(PolicyID {policyID = ScriptHash "..."},fromList [("x",1)]),(PolicyID {policyID = ScriptHash "..."},fromList [("token1",1),("token2",1),("token3",1),("token4",1),("token5",1),("token6",1)]),

(PolicyID {policyID = ScriptHash "..."},fromList [("x",16),("x",101)])]))])),UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 8506622 (fromList [(PolicyID {policyID = ScriptHash "mmmmmm....."},fromList

[("y",1)]),(PolicyID {policyID = ScriptHash "..."},fromList [("x",1),("a",1),("x",1),("x",1),("b",1),("x",1)]),(PolicyID {policyID = ScriptHash "xxxxx"},fromList [("n",16),("a",101)])])) (Value 8506622 (fromList [(PolicyID

{policyID = ScriptHash "..."},fromList [("x",2)]),(PolicyID {policyID = ScriptHash "..."},fromList [token list]),
(PolicyID {policyID = ScriptHash "..."},fromList [token list])]))))])

The final goal is to transfer out all these tokens to another wallet in order to clean this out because I have to mint more 23 NFT's now...

On first glance it seems like your not building  your outputs in the transactions properly.
When using the same address to mint multiple tokens and NFTs, you need to build an output for them when building a transaction. On testnet you may want to use fresh addresses to avoid this.

yeah I just did it again using a new walet. thanks


text:
npm build of plutus client fails with "permission denied"
I am trying to run the Plutus playground using the Gitbook recipe (https://docs.plutus-community.com/docs/setup/WindowsWSL.html).
At step 15, the server starts fine, but trying to run the client with "npm run start" fails with the following
    [info] Copying from global cache: "tuples"
    [info] Copying from global cache: "web-html"
    [error] Installation failed
    [error] Error:
    [error] .spago/__download-catenable-lists-v5.0.1-1293619144260987/download: rename: permission denied (Permission denied)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! plutus-playground-client@1.0.0 purs:compile: `spago build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the plutus-playground-client@1.0.0 purs:compile script.

It seems that the npm script is trying to download something into a (read-only) nix store. How do I get the client to start?
I found some other issues (e.g. Installation failed on Ubuntu 20.04 in WSL on Windows 10 #689) reporting this error, but the reported fix is to close VSCode, so it is no longer accessing the build directories.  I am not currently using VSCode.  However, to make sure it was not some other lingering file contention, I restarted my PC and did nothing except the build on a newly restarted system.  Same error.

Have you tried deleting .spago directory? The npm or spago for purescript builds are not using nix store when you invoke them directly.

I deleted .spago.  Still fails, same error on a different file.  Per the cookbook instructions, I am running "npm run start" within a Nix shell, so all the files are within the nix store.  Your comment implies that I should not be using nix-shell? Is that what you meant?

No, you should be using nix-shell, it spawns a development shell for you with the required tools available but these have their own state directories. Also check if you have enough free space.

210 GB free on my C drive.

I found a resolution to the problem.
In sheer frustration, I spun up a Windows Hyper-Visor VM and started provisioning it from scratch with WSL2, Nix, etc, and nothing else.  After cloning the plutus repository, I got a strange git error (https://github.com/docker/for-win/issues/6284).  The resolution was to move the git repository from the windows-hosted file system (e.g. C:...) to the Ubuntu-hosted file system (\WSL$/mnt...).  Even though the systems are allegedly interoperable, apparently it is not perfect.
Re-cloning the plutus repository under my linux home directory caused the build problem to disappear.   (I had been downloading under my Windows-home directory when the error occured.)
Now I can do my Plutus Pioneer homework...

I just tried to run this using the latest Plutus commit and received the same errors. I tried deleting various generated files with no luck. However, when I re-cloned the entire Plutus repo and tried again, all was good once more, so there was something hanging around that needed to be deleted, but not sure what it was.
If you haven't already, could you try deleting and re-cloning and see if that helps?

I deleted, cloned, checked out the commit referenced in week01 cabal.build and reexecuted the recipe. I still get the same error - ".spago/__download-aff-v5.1.2-db16975bf2436f41/download: rename: permission denied (Permission denied)"