Migration Guide

This document is a reference for those who want to migrate their BApps from their individual ENs to KAS. It will mainly deal with the differences between using EN and KAS.

  1. Sign up on KAS, generate authentication key: Before you can use KAS, you have to sign up and generate an API authentication key. For more information, please refer to this link: Sign Up, Auth, Permission, SDK

    Note) Using this authentication key directly in the frontend code can be very risky in terms of security. Use it on a backend server with limited access.

  2. Add the authentication key to the existing codes: All APIs on KAS can be called via HTTP. And these calls must contain authentication data in the headers. Once that call is made, it will look something like this with caver.js:

     const accessKeyId = "{{your_accessKeyId}}";
     const secretAccessKey = "{{your_secretAccessKey}}";
    
     const option = {
         headers: [
           {name: 'Authorization', value: 'Basic ' +  Buffer.from(accessKeyId + ':' + secretAccessKey).toString('base64')},
           {name: 'x-chain-id', value: '8217'},
         ]
     }
     const caver = new Caver(new Caver.providers.HttpProvider("https://node-api.klaytnapi.com/v1/klaytn", option))
  3. Migrate the old key: If you have been using EN as a keystore instead of an individual wallet, you may also have to migrate your old key. In order to use your old key on KAS, you need a separate Wallet API, which also contains the API for migrating old keys. Please contact support@klaytnapi.com.

  4. Additional modifications: There are certain JSON RPC APIs supported by an average EN but not on KAS. If you are using any of these APIs, you may have to make certain modifications to the API. You can find out whether your JSON RPC API is supported or not in this link: JSON-RPC API

For any other issues or inquiries, you can visit our KAS Forum, or contact us by email at support@klaytnapi.com.

Last updated