Skip to content

nameskyteam/state-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean contract state

Clean contract state with NEAR CLI JS

Step

  1. Compile the state-cleanup contract
    make all
  2. Deploy the state-cleanup contract to the account (e.g. example.near)
    near deploy example.near ./res/state_cleanup.wasm --network-id mainnet
  3. View the contact state and you can find the state keys with base64 encoding
    near storage example.near --finality optimistic --network-id mainnet
  4. Clean the state keys
    near call example.near clean '{"keys":[<base64 state keys>]}' --network-id mainnet --account-id example.near --gas 300000000000000

Sometimes you may meet the error State of contract example.near is too large to be viewed. This is RPC issue, so you need to use the RPC that allows unlimited view

NEAR_MAINNET_RPC=https://beta.rpc.mainnet.near.org near storage example.near --finality optimistic --network-id mainnet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published