test.js 462 B

12345678910111213141516
  1. const web3 = require('@solana/web3.js');
  2. const anchor = require('.');
  3. anchor.setProvider(anchor.Provider.local());
  4. const idl = JSON.parse(require('fs').readFileSync('../examples/basic/idl.json', 'utf8'));
  5. const pid = new web3.PublicKey('9gzNv4hUB1F3jQQNNcZxxjn1bCjgaTCrucDjFh2i8vc6');
  6. async function test() {
  7. const program = new anchor.Program(idl, pid);
  8. const sig = await program.rpc.createRoot(
  9. new PublicKey(''),
  10. 1234,
  11. );
  12. }
  13. test();