Questions tagged [logs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers

How can I make `msg!` print to stdout when run off-chain?

I have code that's used both in my program and off-chain. In the code, I use msg!. If that msg! line is run off-chain, I get this error: Invoke context not set! What do I need to do to make msg! ...
user9125's user avatar
0 votes
1 answer

Listen for new token contracts and log the contract address

I am writing a program in golang. I am using the solana-go RPC client. I want to listen to all events and when a new token is created I want to print the tokens contract. So far I have managed to find ...
Jonnmye's user avatar
2 votes
1 answer

Cost of logging vs storing data in Solana programs?

The Way Ethereum stores data through Events I want to do the same on Solana but not sure How do the compare the cost of storing it in logs or in Solana programs? Are there any other cheaper ways to ...
Ajay Yadav's user avatar
2 votes
1 answer

How to view logs on anchor rust client

I am trying to send a transaction to my program through rust client. But i am running into an issue and i would like to see the logs so that i can trace it. I am using the anchor rust client and ...
Dhruv D Jain's user avatar
3 votes
1 answer

How to get all transaction logs for a specific program? Both old and new transactions

What is the best way to get all the program logs from a specific program? There are two types of logs I am curious about getting for any given programId: all the older, already finalized, transaction ...
nickfrosty's user avatar
1 vote
3 answers

How to log into terminal in anchor program

I'm debugging my program and I don't know where my code is dead. So is there any way to log strings and variables to the terminal?
marethyu's user avatar
  • 333
3 votes
1 answer

What is the Solana idiomatic way of logging/accessing information about who sent tokens via a program?

I have a Game-program. Several users can play a game and receive a reward afterwards. When a user starts a game, I create a Game account in which I store the game state and the sum of rewards (just a ...
Sasha Shpota's user avatar
1 vote
1 answer

Sometimes receiving duplicate logs using solana_client::nonblocking::pubsub_client::PubsubClient

I am using solana_client v1.10.34 nonblocking PubsubClient to subscribe to program logs and I am sometimes seeing duplicate logs with the same metadata but 1 slot apart. Is this a bug? Ps: Must use ...
Jayyunit's user avatar
4 votes
2 answers

How to parse event in transaction log with Anchor

I have following transaction logs which contains triggered event and I want to parse it: 'Program log: Instruction: Init', 'Program data: 867fyqeFJJGYZDSk+Vy/7Cpm35d+fps/e3WovaZGp4v+...
Void's user avatar
  • 396
3 votes
2 answers

Relating logs to their instructions

For an individual transaction, how would you be able to relate a log to its corresponding set of instructions? I'm having difficulty finding a way to identify which logs belong to an instruction, ...
TarikFS's user avatar
  • 31
1 vote
1 answer

Am I able to search for specific transactions based what's in the program instruction logs?

I'm interested in trying to find all transactions for a specific program that include a specific instruction. Take this Mango transaction for example, I can see that someone is placing multiple Perp ...
seruob's user avatar
  • 91
1 vote
1 answer

Where do InstructionErrors go?

I have my validator running, I have my logs running, I have a program loaded with many different custom InstructionErrors. I submit a tx, and when it succeeds I see all the log messages. When the tx ...
Blair Munro's user avatar
1 vote
1 answer

How do I prevent logs from being truncated?

'Program log: Instruction: PositionSwap', 'Program log: a_to_b: true', 'Program log: amount: 0', ... 15 more items ], programErrorStack: ProgramErrorStack { stack: [ [PublicKey], [...
joebuild's user avatar
  • 455