Introduction
Understanding blockchain technology, APIs, and the specifics of GalaChain can be complex, especially for developers new to this ecosystem. This FAQ aims to provide clear and concise answers to common technical questions, offering practical steps and resources to help you navigate and utilize GalaChain effectively.
For more in-depth information on building with GalaChain, please refer to this article series: <link>
General Questions
1. What is GalaChain's native token?
- $GALA is the native token of the GalaChain network. It is utilized for all network fees, such as channel establishment and gas fees. To learn more about the Gala token, please visit What is $GALA? article.
2. How do I create a GalaChain wallet?
- To create a GalaChain wallet, please refer to this step-by-step guide: Set Up a GalaChain Wallet.
3. Which channel is $GALA on?
- The $GALA token is on the asset channel.
4. How do we avoid transaction replay in GalaChain?
- The uniqueKey you generate for each request prevents transaction replay.
5. What is a channel, and how does one channel differ from another?
- Each channel has its own ledger and worldstate.
6. What is the maximum number of transactions per block?
- The maximum number of transactions per block is configurable per channel, but it is generally set at 200 tx/block.
7. What GalaChain Explorers are available?
- The following explorers are available for GalaChain: GyTrace, GalaScan, Official GalaChain Explorer. These explorers provide detailed insights into transactions, blocks, and other blockchain activities on GalaChain.
8. How long does it take for each channel to produce a block?
- The block timeout is 1 second, configurable per channel. A block is written whenever it is full (200 tx) or the block timeout is reached (1 second), whichever comes first.
9. What does “instance = 0” signify in the GalaChain ecosystem?
- For NFTs, the instance indicates the uniqueness of the token. GameToken #1 is different from GameToken #2. Instances of fungible tokens are represented by the value 0 as they are not unique.
10. What is the signature algorithm we use?
- Signatures are in secp256k1 format. This is a hex string with concatenated r, s, v values (no DER format). The documents on the GalaSwap API provide more details about how to use private keys to sign DTOs.
11. How do I get token decimals and distinguish between a token and an NFT?
- The GetTokenClasses endpoint provides token decimals and the isNonFungible flag, which you can use to differentiate between NFTs and FTs.
12. How do I identify an NFT ID in the transaction record?
- For Non-Fungible Tokens, the instance field is used as a unique identifier, whereas Fungible Tokens will have 0 as their instance.
13. Does $GALA have a token address?
- $GALA does not have an address.
14. How does an ERC-20 Token Contract work in GalaChain?
- The GalaChain Token Contract can produce multiple tokens. $GALA has been created on the asset channel.
15. How do I get $GALA on production?
- GALA can be acquired via distribution (running a Founders Node) or by purchasing it (via GalaSwap on GalaChain or exchanges on ETH).
16. Is there an on-chain event listener in GalaChain?
- We are currently using an internal service.
17. Do all transfer transactions occur in the asset channel?
- All channels have a token contract with token transfer capabilities, but most tokens are on the asset channel.
18. Where can I find the GalaChain SDK?
- You can find the GalaChain SDK at the following link: GalaChain SDK.
19. How many blocks in GalaChain can determine a transaction?
- Each block in GalaChain can contain multiple transactions. While some methods use multiple blocks to improve concurrency, each step within these methods is treated as a separate transaction. Once a transaction is committed to a block, it is considered validated by the authority consensus of the network.
20. Can $GALA transactions occur only on the asset channel?
- Yes, currently $GALA transactions occur only on the asset channel and cannot bridge to other GalaChain channels.
21. What's the rate limit for GalaSwap API?
- The GalaSwap API has a global rate limit of 20 requests per 10 seconds. Additionally, wallet creation requests are limited to 4 requests per minute. If you have specific needs or concerns regarding these limits, please let us know.
22. What is GalaSwap and how is it integrated with GalaChain?
- GalaSwap is a decentralized application (dApp) on GalaChain, similar to Uniswap, but it operates on an order book system.
23. Is there an API available for a GalaChain explorer?
Yes, an API is available for the GalaChain explorer. For detailed documentation on the current explorer API capabilities, please refer to: GalaChain Explorer API Documentation.
24. How do I get blockchain data through the API to find a user transfer transaction?
You can visit https://explorer-api.galachain.com/docs/ to check blocks and scan their transactions.
25. How do I query GalaChain data?
- You can query blockchain data on GalaChain using the following APIs: GalaChain Explorer API (for detailed block and transaction information), GalaSwap API (for operations related to token swaps and other transactions).
26. How do I generate a uniqueKey?
- You can generate a uniqueKey using any method, as long as it is a unique string value for each transaction you submit.
27. After generating keys and addresses using the /v1/CreateHeadlessWallet method, should the system keep the public key in the record? Is the private key exposed?
- Yes, the system should keep the public key in the record, as only the public key is recorded on the chain. The private key should remain confidential and should not be exposed. Chaincode methods use the public key to verify the signatures of digital transactions (DTOs).
28. If there are two transactions with the same uniqueKey value, which one will be successful?
- The first one that is saved in the block will be successful, and the other will return an error.
29. What happens if I build a transaction that uses the uniqueKey of an already on-chain transaction?
- It will return an error: “Unique Transaction key ${uniqueKey} is already saved for transaction ${transactionId}”.
API Questions
1. How can I use the GalaChain API to find out which tokens are supported and which channel they can be traded on?
- The GalaSwap Operations API provides a list of swappable fungible tokens: GalaSwap API.
2. How do I generate a uniqueKey field and calculate the txid in advance?
- The uniqueKey can be any unique identifier you choose to track the transaction. It is not recommended to pre-generate the txid.
3. How can I get the data in the blockchain through the API without missing a user’s transfer transaction?
- You can poll the Explorer API for blocks and scan them for your transaction.
4. How do I query an NFT metadata?
- Our platform creator tools API provides a metadata endpoint for tokens.
5. Which endpoint can I query to get NFT metadata information?
- To retrieve NFT metadata information, you can query the following endpoint: https://token-metadata-platform-creators-prod-gala.gala.com/metadata/
6. How do I query the latest block height of the current blockchain?
- To query the latest block height of the current blockchain, you can use the following endpoint: https://explorer-api.galachain.com/v1/explorer/height/{channel}
Replace {channel} with the specific blockchain channel you are interested in.
7. Is there an API for querying on-chain transactions using uniqueKey or txid as a parameter?
- Not a direct API endpoint, but you should be able to use the explorer API (/v1/explorer/search) search endpoint to find uniqueKeys.
8. How to query the balance of a specific address?
- Use the FetchBalances endpoint for a specific token's balance.
9. How do I query the corresponding header according to the height?
- To query the corresponding header according to the block height, you can use the following endpoint: https://explorer-api.galachain.com/v1/explorer/blocks/{channel}/latest
Replace {channel} with the specific blockchain channel you are interested in.
10. How do I query the corresponding block and all the transaction details inside the block according to the height, including but not limited to: ‘hash, txid, amount, from, to, token, fee, status, timestamp, type’?
- Use the following endpoint: https://explorer-api.galachain.com/v1/explorer/blocks/{channel}/latest
11. What is the equivalent of an on-chain event listener in GalaChain?
- The Gala team uses Kafka events and they are planning to give access to it in the future.
12. How do we find the real user address from the transaction for analysis?
- You can reference the data in the transaction. transactions.actions[0].args gives you the DTO sent to RegisterUser.
13. How can I use the API to determine which tokens are available and the channels on which they can be traded?
- The GalaSwap API provides a list of currently swappable fungible tokens and the channels on which they can be traded. You can use the following endpoint to get this information: https://galaswap.gala.com/info/api.html#tag/API:-GalaSwap-Operations/paths/~1v1~1tokens/get This endpoint will provide a comprehensive list of available fungible tokens that can be swapped. Most of the tokens are in the asset channel, except for $MUSIC, which is in a different channel.
14. How can we get the token decimals?
- The GetTokenClasses endpoint provides the token decimals.
15. How can we identify the ID of the NFT in the transaction record?
- The instance field is the unique identifier for NFTs.
16. How to avoid transaction replay in GalaChain?
- The uniqueKey generated for each request prevents transaction replay.
17. How can I find the real user address from the transaction for analysis?
- Reference the data in the transaction: transactions.actions[0].args gives the DTO sent to RegisterUser.
18. How do I query all balances corresponding to the address?
- We’re currently working on an endpoint for this. It’s currently queryable internally, but we need to clean it up and decide how to expose it publicly.
Wallet and Transactions Questions
1. Should the exchange support an address format with an 'eth|' prefix?
- Yes, all wallets created using the provided endpoint will create addresses with the 'eth|' prefix.
2. Can addresses with the "client|" prefix format transfer funds to addresses with the "eth|" prefix format? And vice versa?
- Yes, addresses with the "client|" prefix can transfer funds to "eth|" prefixed addresses and vice versa, as they are all on the same network.
3. How many GalaChain address formats are there?
- There are two main formats: 'eth|' and 'client|'. Addresses are case-sensitive. 'client|' prefixed addresses are created by the Gala platform, while 'eth|' prefixed addresses are created externally.
4. How do we find the real user address from the transaction for analysis?
- You can reference the data in the transaction. transactions.actions[0].args gives you the DTO sent to RegisterUser.
Common Errors
1. Error: 'PUBLIC_KEY_ALREADY_IN_USE'
- This error indicates that you attempted to create a wallet with a public key that already exists. Each user profile/wallet must have a unique public key.