Skip to content

Commit

Permalink
refactor: re-arrange code
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuchitO committed Aug 7, 2021
1 parent 1511e72 commit 2992a1c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const sleep = (ms) => {
await sleep(20000)

console.log("\n#3 Create Program Account : smart contract need separate account to attach.");

const smartcontract = await fs.readFile('./solana-json.so')
console.log({ smartcontract })
const programAccount = new Keypair()
const programId = programAccount.publicKey
console.log('Program loaded to account')
Expand All @@ -35,6 +32,8 @@ const sleep = (ms) => {
}
})
console.log("\n#4 Loading Program to Account : upload smart contract using BPF LOADER ...");
const smartcontract = await fs.readFile('./solana-json.so')
console.log({ smartcontract })
await solanaWeb3.BpfLoader.load(conn, payerAccount, programAccount, smartcontract, solanaWeb3.BPF_LOADER_PROGRAM_ID)

console.log("\n#5 Create App Account : account for the app itself which will store any data required for the dApp.");
Expand Down Expand Up @@ -96,6 +95,6 @@ const sleep = (ms) => {
const accInfo = Buffer.from(accountInfo?.data || "").toString().substr(4, 1000).trim();
console.log({ accInfo })

console.log("!!!! SUCESSS !!!!")
console.warn(`run: "solana confirm -v ${signature}"`)
console.log({ result: "!!!! SUCESSS !!!!" })
console.warn({ run: `"solana confirm -v ${signature}"` })
})()

0 comments on commit 2992a1c

Please sign in to comment.