Submit Network Proposal using the icon-sdk-js

The process of submitting a network proposal requires signing a transaction calling the registerProposal method of the governance contract using your node validator wallet. The following section will describe how to use the icon-sdk-js to submit a network proposal.

The first step would be to initiate a nodejs project in a folder of your choice and install the icon-sdk-js by running the following command:

npm init -y && npm install icon-sdk-js
Wrote to /home/fidel/code/js/projects/icon-projects/icon-nodejs-tools/network-proposal-test/package.json:
  "name": "network-proposal-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  "keywords": [],
  "author": "",
  "license": "ISC"
added 66 packages, and audited 67 packages in 10s
6 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities

Add the keystore file to the root folder and edit the index.js file with the following code.

const IconService = require("icon-sdk-js");
const fs = require("fs");
const {
} = IconService.default;
const { CallTransactionBuilder } = IconBuilder;
const rpcNodeUrl = "";
const keystorePath = "./keystore.json";
const keystorePassword = "password";
const httpProvider = new HttpProvider(rpcNodeUrl);
const iconService = new IconService(httpProvider);
 * Gets keystore object from keystore file
 * @param {string} path - path to keystore file
 * @return {object} keystore object
function getKeystore(path) {
  const keystore = fs.readFileSync(path, "utf8");
  return keystore;
 * Submits a network proposal
 * @param {object} params - proposal parameters
 * @param {string} amount - amount of ICX to send with transaction
 * @return {string} transaction hash
 * @throws {Error} if transaction fails
async function submitNetworkProposal(params, amount) {
  try {
    const wallet = IconWallet.loadKeystore(
    const txObj = new CallTransactionBuilder()
      .timestamp(new Date().getTime() * 1000)
    const signedTransaction = new SignedTransaction(txObj, wallet);
    return await iconService.sendTransaction(signedTransaction).execute();
  } catch (err) {
async function main() {
  const value = {
    name: "Proposal Name",
    value: {
      text: "Proposal Description"
  const parsedValue = IconConverter.fromUtf8(JSON.stringify(value));
  const params = {
    title: "Proposal Title",
    description: "Proposal Description",
    value: parsedValue
  const networkProposalFee = "0x56bc75e2d63100000";
  const txHash = await submitNetworkProposal(params, networkProposalFee);