Testing your integration
Testing with FIO Testnet
Most Signed API calls charge fees and require a FIO address that is associated with the user making the call.
Creating a test account with FIO tokens
When running a test you will want to register addresses and transfer funds. But, registering a new address for the first time requires FIO tokens. Therefore, some manual setup is required to associate FIO tokens with a FIO public key. To set up a FIO public key with FIO tokents in a test environment:
- Manually create two private/public FIO key pairs
- Navigate to the website: https://monitor.testnet.fioprotocol.io
- Select the ‘Create Keypair’ button (top left of the website)
- Copy the keypairs and FIO Internal Account
- Manually register a FIO address for both of these FIO key pairs.
- Navigate to the website: https://monitor.testnet.fioprotocol.io
- Select the ‘Register Address’ button
- Type in a FIO address
- Paste in one of the public keys (created above)
- Select the ‘Create’ button
- Do this for each public key pair (twice). The created FIO address will be in this format, “mytest:fiotestnet”
- Manually transfer funds into these FIO addresses.
- Navigate to the website: https://monitor.testnet.fioprotocol.io
- Select the ‘Faucet’ button
- Paste in one of the public keys (created above)
- Select the ‘Send Coins’ button
- Do this for each public key pair (twice)
- These FIO public addresses now have funds available for making Signed API calls.
- Edit the test script to add these FIO addresses and the private/public FIO key pairs
- Edit the privateKey, publicKey, privateKey2, publicKey2, testFioAddressName, testFioAddressName2 variables in the testnet.spec file (/fiofoundation-io-fiosdk/tests/testnet.spec)
- Run the tests: npm test
Testing with Cryptonym
https://github.com/blockpane/cryptonym. Recommend using it against a local node, otherwise it can seem slow.