NEWTON
Asked
3 months ago
26
views
0
How do I get started with starknetjs?
Newton
asked
3 months 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
3 months 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?
Where can I learn more about starknet?
What are multi-calls in Account Abstraction? What will it bring to the UX?
Nethermind's warp error: JavaScript heap out of memory
Cairo: How do I find the current contract's address?
What are the projects on starknet that plan to do the domain .stark?
Is there any simple way to concat two arrays with known sizes in Cairo?
Is there a way to cache context + StarkNet state?