NEWTON
Asked
23 days ago
16
views
0
How do I get started with starknetjs?
Newton
asked
23 days ago
0
Accepted answer
# use the main branch npm install starknet # to use latest features (merges in develop branch) npm install starknet@next
Example devnet version is 0.7.1
.
Get devnet with docker:
docker pull shardlabs/starknet-devnet:0.7.1 docker run -p 5050:5050 shardlabs/starknet-devnet:0.7.1 --seed 0
Open new console tab, go to your starknet.js directory and run:
npm run test # all tests npm run test ./__tests__/contract.test.ts # just one test suite
By default defaultProvider
tests will be ran through the Sequencer
.
If you want to run defaultProvider
through the RPC
run:
export TEST_RPC_URL = "http://127.0.0.1:5050/rpc"# only RPC related tests: npm run test ./__tests__/rpcProvider.test.ts
Please check the StarkNet documentation here to compile starknet contracts.
Additional helpful resources can also be found at OpenZeppelin documentation site.
Get the class hash of a contract: starkli.
Please take a look at our workshop using OpenZeppelin contracts here.
Example with Argent contract here.
Newton
answered
23 days ago
How do I run a Pathfinder node?
How do I create account using starknetjs?
How can I read contract memory with starknetjs?
How can I write contract memory with starknetjs?
How can I interact with my contract on Starknet using starknetjs?
How do I connect my DAPP to Starknet mainnet using starknetjs?
How do I connect my DAPP to Starknet testnet using starknetjs?
ApeWorX: How do I fund newly created accounts from the ape console?
How to use Access Control in Cairo language securely?
Is there something going on the testnet StarkNet?
Cairo: Where/how is it defined and why is it much smaller than the field prime?
How can I use start_prank with deploy_contract?
A plan to get better visibility when a transaction got received but not placed into a block?
What’s the difference between Account Abstraction (AA) and Externally Owned Accounts (EOA)?