Socket
Socket
Sign inDemoInstall

@audius/anchor-audius-data

Package Overview
Dependencies
68
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @audius/anchor-audius-data

Audius solana anchor js bindings


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

AudiusData <-> Anchor

Overview:

Implementation of audius data layer in Anchor (Solana framework)

./cli/
    - CLI to interact with deployed instance of AudiusData, has helpers as well for reuse in shared libs layer

./lib/
    - Typescript bindings for program interaction, shared with programs/tests and cli/
    - Utils typescript located here as well

./programs/
    src/
        - Program source code deployed to blockchain
        - Single file, lib.rs

    tests/
        - Unit tests to validate program functionality

Developing:

  1. Provision a fresh dev environment (ubuntu)
  2. Install dependencies:
npm run install-dev
  1. In one terminal, run test validator:
solana-test-validator

Deploying:

  • Build:
npm run build-dev
  • Provision localnet in one shell:
npm run localnet-up
  • In another shell, deploy:
npm run deploy-dev
  • kill your test validator and run tests to confirm IDL:
npm run localnet-down && npm test

Note that if you get error logs during tests but tests still pass, you can ignore the logs.

Sending transactions:

As a prerequisite, you should run npm run localnet-up and npm run deploy-dev to deploy your program to the solana test validator.

To deploy program and seed tx, simply run npm run localnet-up in one window and then run npm run dev-setup in another.

See README.

Troubleshooting:

Validate any tx:

solana confirm <txhash>

Open up logs (in a dedicated shell) - this usually has more detailed error info:

solana logs

Check balance:

solana balance

Check an account:

solana account <acct-pubkey-or-path-to-storage-keypair.json>

Check a program:

solana program show <program-id>

Airdrop funds:

solana airdrop <num SOL> <pubkey-or-path-to-storage-keypair.json>

Deploying to non-local cluster:

Can also specify a particular cluster at deploy time, per the following:

anchor deploy --provider.cluster https://audius.rpcpool.com/
Deploying workspace: https://audius.rpcpool.com/
Upgrade authority: /Users/hareeshnagaraj/.config/solana/id.json
Deploying program "audius-data"...
Program path: /Users/hareeshnagaraj/Development/audius-protocol/solana-programs/anchor/audius-data/target/deploy/audius_data.so...
Program Id: EoDXzUBiESoz9FEYdTScXgmfmzBKDRLVxgnNkFjpKtJc

Reference

https://github.com/project-serum/anchor/blob/master/lang/src/error.rs

FAQs

Last updated on 03 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc