2021-01-01 15:48:25 -08:00
|
|
|
const web3 = require('@solana/web3.js');
|
2020-12-31 17:54:51 -08:00
|
|
|
const anchor = require('.');
|
2021-01-01 15:48:25 -08:00
|
|
|
anchor.setProvider(anchor.Provider.local());
|
2020-12-31 17:54:51 -08:00
|
|
|
|
2021-01-01 15:48:25 -08:00
|
|
|
const idl = JSON.parse(require('fs').readFileSync('../examples/basic/idl.json', 'utf8'));
|
|
|
|
const pid = new web3.PublicKey('9gzNv4hUB1F3jQQNNcZxxjn1bCjgaTCrucDjFh2i8vc6');
|
2021-01-01 15:10:26 -08:00
|
|
|
|
2021-01-01 15:48:25 -08:00
|
|
|
async function test() {
|
|
|
|
const program = new anchor.Program(idl, pid);
|
|
|
|
const sig = await program.rpc.createRoot(
|
|
|
|
new PublicKey(''),
|
|
|
|
1234,
|
|
|
|
);
|
2020-12-31 17:54:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
test();
|